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) */
int
spcdevVisit(
@ -4319,6 +4320,7 @@ mergeAttr(
* ----------------------------------------------------------------------------
*/
/* ARGSUSED */
/* @typedef cb_extflat_visitdevs_t (UNUSED) */
int
devMergeVisit(
@ -4540,6 +4542,7 @@ update_w(
* ----------------------------------------------------------------------------
*/
/* ARGSUSED */
/* @typedef cb_extflat_visitdevs_t (UNUSED) */
int
devDistJunctVisit(

View File

@ -246,14 +246,15 @@ EFGetLengthAndWidth(dev, lptr, wptr)
* Visit all the devs in the circuit.
* Must be called after EFFlatBuild().
* 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)
* Dev *dev;
* HierName *hierName;
* float scale;
* Transform *trans;
* ClientData cdata;
* int (*devProc)(
* Dev *dev,
* HierContext *hc,
* float scale,
* Transform *trans,
* ClientData cdata)
* {
* }
*
@ -274,13 +275,13 @@ EFGetLengthAndWidth(dev, lptr, wptr)
*/
int
EFVisitDevs(devProc, cdata)
int (*devProc)();
ClientData cdata;
EFVisitDevs(
const cb_extflat_visitdevs_t devProc,
ClientData cdata)
{
CallArg ca;
ca.ca_proc = devProc;
ca.ca_proc = (int (*)()) devProc;
ca.ca_cdata = cdata;
return efVisitDevs(&efFlatContext, (ClientData) &ca);
}

View File

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