extflat: integrate cb_extflat_visitdevs_t for EFVisitDevs()

This commit is contained in:
Darryl L. Miles 2025-07-20 00:03:14 +01:00
parent 6876c007f5
commit e1be3fe7d2
3 changed files with 18 additions and 13 deletions

View File

@ -2475,6 +2475,7 @@ swapDrainSource(
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
/* ARGSUSED */
/* @typedef cb_extflat_visitdevs_t (UNUSED) */ /* @typedef cb_extflat_visitdevs_t (UNUSED) */
int int
spcdevVisit( spcdevVisit(
@ -4319,6 +4320,7 @@ mergeAttr(
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
/* ARGSUSED */
/* @typedef cb_extflat_visitdevs_t (UNUSED) */ /* @typedef cb_extflat_visitdevs_t (UNUSED) */
int int
devMergeVisit( devMergeVisit(
@ -4540,6 +4542,7 @@ update_w(
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
/* ARGSUSED */
/* @typedef cb_extflat_visitdevs_t (UNUSED) */ /* @typedef cb_extflat_visitdevs_t (UNUSED) */
int int
devDistJunctVisit( devDistJunctVisit(

View File

@ -246,14 +246,15 @@ EFGetLengthAndWidth(dev, lptr, wptr)
* Visit all the devs in the circuit. * Visit all the devs in the circuit.
* Must be called after EFFlatBuild(). * Must be called after EFFlatBuild().
* For each dev in the circuit, call the user-supplied procedure * For each dev in the circuit, call the user-supplied procedure
* (*devProc)(), which should be of the following form: * (*devProc)(), which should be of the following form
* see also typedef cb_extflat_visitdevs_t:
* *
* (*devProc)(dev, hierName, scale, cdata) * int (*devProc)(
* Dev *dev; * Dev *dev,
* HierName *hierName; * HierContext *hc,
* float scale; * float scale,
* Transform *trans; * Transform *trans,
* ClientData cdata; * ClientData cdata)
* { * {
* } * }
* *
@ -274,13 +275,13 @@ EFGetLengthAndWidth(dev, lptr, wptr)
*/ */
int int
EFVisitDevs(devProc, cdata) EFVisitDevs(
int (*devProc)(); const cb_extflat_visitdevs_t devProc,
ClientData cdata; ClientData cdata)
{ {
CallArg ca; CallArg ca;
ca.ca_proc = devProc; ca.ca_proc = (int (*)()) devProc;
ca.ca_cdata = cdata; ca.ca_cdata = cdata;
return efVisitDevs(&efFlatContext, (ClientData) &ca); return efVisitDevs(&efFlatContext, (ClientData) &ca);
} }

View File

@ -114,8 +114,9 @@ extern void EFFlatDone();
extern bool EFHNIsGND(); extern bool EFHNIsGND();
extern void EFInit(); extern void EFInit();
extern bool EFReadFile(); extern bool EFReadFile();
extern int EFVisitDevs(); typedef int (*cb_extflat_visitdevs_t)(Dev *dev, HierContext *hc, float scale, Transform *trans, ClientData cdata);
extern int efVisitDevs(); extern int EFVisitDevs(const cb_extflat_visitdevs_t devProc, ClientData cdata);
extern int efVisitDevs(HierContext *hc, CallArg *ca);
extern bool efSymLook(); extern bool efSymLook();
extern int efVisitResists(); extern int efVisitResists();
extern int EFVisitResists(); extern int EFVisitResists();