rename Region to ExtRegion

On Macos, Tk includes X11, which has this define:

    #if !defined(MAC_OSX_TK)
    #   include <X11/X.h>
    #endif
    #ifdef MAC_OSX_TK
    #   include <X11/X.h>
    #   define Cursor XCursor
    #   define Region XRegion
    #endif

This causes the keywords `Cursor` and `Region` to be reserved, which
prevents magic from building.

Rename `Region` to `ExtRegion` as suggested by @RTimothyEdwards in
https://github.com/RTimothyEdwards/magic/issues/195#issuecomment-1298870983
and https://github.com/RTimothyEdwards/magic/pull/222#pullrequestreview-1334900670

Signed-off-by: Sean Cross <[email protected]>
This commit is contained in:
Sean Cross
2023-03-10 11:07:55 -05:00
committed by Tim Edwards
parent 5e5879c53d
commit 1e7da74672
14 changed files with 69 additions and 69 deletions
+1 -1
View File
@@ -734,7 +734,7 @@ extArrayNodeName(np, ha, et1, et2)
* The node associated with a tile can be determined in one of the
* following ways:
*
* (1) Look for a label on the list of the Region pointed to by the
* (1) Look for a label on the list of the ExtRegion pointed to by the
* tile planes of 'et->et_use->cu_def'. If no label was found,
* then try (2).
*
+16 -16
View File
@@ -173,7 +173,7 @@ extFoundFunc(tile, cxp)
* file 'outFile'.
*
* Results:
* Returns a list of Region structs that comprise all
* Returns a list of ExtRegion structs that comprise all
* the nodes in 'def'. It is the caller's responsibility
* to call ExtResetTile() and ExtFreeLabRegions() to restore
* the CellDef to its original state and to free the list
@@ -191,7 +191,7 @@ extFoundFunc(tile, cxp)
* device
*
* Interruptible in a limited sense. We will still return a
* Region list, but labels may not have been assigned, and
* ExtRegion list, but labels may not have been assigned, and
* nodes and fets may not have been output.
*
* ----------------------------------------------------------------------------
@@ -260,7 +260,7 @@ extBasic(def, outFile)
/*
* Build up a list of the electrical nodes (equipotentials)
* for extOutputNodes() below. For this, we definitely want
* to leave each tile pointing to its associated Region struct.
* to leave each tile pointing to its associated ExtRegion struct.
* Compute resistance and capacitance on the fly.
* Use a special-purpose version of ExtFindRegions for speed.
*/
@@ -1858,13 +1858,13 @@ extOutputDevices(def, transList, outFile)
/* Mark with reg and process each perimeter segment */
arg.fra_uninit = (ClientData) extTransRec.tr_gatenode;
arg.fra_region = (Region *) reg;
arg.fra_region = (ExtRegion *) reg;
arg.fra_each = extTransTileFunc;
ntiles = ExtFindNeighbors(reg->treg_tile, arg.fra_pNum, &arg);
/* Re-mark with extTransRec.tr_gatenode */
arg.fra_uninit = (ClientData) reg;
arg.fra_region = (Region *) extTransRec.tr_gatenode;
arg.fra_region = (ExtRegion *) extTransRec.tr_gatenode;
arg.fra_each = (int (*)()) NULL;
(void) ExtFindNeighbors(reg->treg_tile, arg.fra_pNum, &arg);
@@ -2158,7 +2158,7 @@ extOutputDevices(def, transList, outFile)
/* Mark with reg and process each perimeter segment */
arg.fra_uninit = (ClientData) extTransRec.tr_gatenode;
arg.fra_region = (Region *) reg;
arg.fra_region = (ExtRegion *) reg;
arg.fra_each = extAnnularTileFunc;
(void) ExtFindNeighbors(reg->treg_tile, arg.fra_pNum, &arg);
@@ -2178,7 +2178,7 @@ extOutputDevices(def, transList, outFile)
/* Re-mark with extTransRec.tr_gatenode */
arg.fra_uninit = (ClientData) reg;
arg.fra_region = (Region *) extTransRec.tr_gatenode;
arg.fra_region = (ExtRegion *) extTransRec.tr_gatenode;
arg.fra_each = (int (*)()) NULL;
(void) ExtFindNeighbors(reg->treg_tile, arg.fra_pNum, &arg);
@@ -2240,7 +2240,7 @@ extOutputDevices(def, transList, outFile)
/* Mark with reg and process each perimeter segment */
arg.fra_uninit = (ClientData) extTransRec.tr_gatenode;
arg.fra_region = (Region *) reg;
arg.fra_region = (ExtRegion *) reg;
if (isAnnular)
arg.fra_each = extAnnularTileFunc;
else
@@ -2276,7 +2276,7 @@ extOutputDevices(def, transList, outFile)
/* Re-mark with extTransRec.tr_gatenode */
arg.fra_uninit = (ClientData) reg;
arg.fra_region = (Region *) extTransRec.tr_gatenode;
arg.fra_region = (ExtRegion *) extTransRec.tr_gatenode;
arg.fra_each = (int (*)()) NULL;
(void) ExtFindNeighbors(reg->treg_tile, arg.fra_pNum, &arg);
}
@@ -2378,7 +2378,7 @@ extOutputDevices(def, transList, outFile)
/* Mark with reg and process each perimeter segment */
arg.fra_uninit = (ClientData) extTransRec.tr_gatenode;
arg.fra_region = (Region *) reg;
arg.fra_region = (ExtRegion *) reg;
arg.fra_each = extAnnularTileFunc;
(void) ExtFindNeighbors(reg->treg_tile, arg.fra_pNum, &arg);
@@ -2395,7 +2395,7 @@ extOutputDevices(def, transList, outFile)
/* Re-mark with extTransRec.tr_gatenode */
arg.fra_uninit = (ClientData) reg;
arg.fra_region = (Region *) extTransRec.tr_gatenode;
arg.fra_region = (ExtRegion *) extTransRec.tr_gatenode;
arg.fra_each = (int (*)()) NULL;
(void) ExtFindNeighbors(reg->treg_tile, arg.fra_pNum, &arg);
}
@@ -3893,7 +3893,7 @@ extSetNodeNum(reg, plane, tile)
* ----------------------------------------------------------------------------
*/
Region *
ExtRegion *
extTransFirst(tile, arg)
Tile *tile;
FindRegion *arg;
@@ -3914,8 +3914,8 @@ extTransFirst(tile, arg)
/* Prepend it to the region list */
reg->treg_next = (TransRegion *) arg->fra_region;
arg->fra_region = (Region *) reg;
return ((Region *) reg);
arg->fra_region = (ExtRegion *) reg;
return ((ExtRegion *) reg);
}
/*ARGSUSED*/
@@ -3998,7 +3998,7 @@ extFindNodes(def, clipArea, subonly)
extNodeStack = StackNew(64);
arg.fra_def = def;
arg.fra_region = (Region *) NULL;
arg.fra_region = (ExtRegion *) NULL;
SigDisableInterrupts();
@@ -4244,7 +4244,7 @@ extNodeAreaFunc(tile, arg)
/* Prepend the new node to the region list */
reg->nreg_next = (NodeRegion *) arg->fra_region;
arg->fra_region = (Region *) reg;
arg->fra_region = (ExtRegion *) reg;
/* Used by substrate generating routine */
if (tile == NULL) return 1;
+1 -1
View File
@@ -248,7 +248,7 @@ extFileOpen(def, file, mode, doLocal, prealfile)
* a cell on the plane representing the substrate to determine if the area is
* the default substrate or an isolated region. If an isolated region, it
* must be painted with a tile type so that the extraction code can tag the
* tiles with a Region and assign it a node. This code creates the substrate
* tiles with a ExtRegion and assign it a node. This code creates the substrate
* paint in the isolated regions for the duration of the extration, then
* reverts back to the original plane afterward.
*
+7 -7
View File
@@ -70,7 +70,7 @@ bool extHardSetLabel();
* ----------------------------------------------------------------------------
*/
Region *
ExtRegion *
extLabFirst(tile, arg)
Tile *tile;
FindRegion *arg;
@@ -85,8 +85,8 @@ extLabFirst(tile, arg)
/* Prepend it to the region list */
reg->treg_next = (TransRegion *) arg->fra_region;
arg->fra_region = (Region *) reg;
return ((Region *) reg);
arg->fra_region = (ExtRegion *) reg;
return ((ExtRegion *) reg);
}
/*ARGSUSED*/
@@ -211,7 +211,7 @@ extHardProc(scx, arg)
* If labels are being generated automatically on this pass,
* we don't bother to assign labels to geometry. Instead, we
* construct a new label based on the lower-leftmost tile in
* the Region labRegList.
* the ExtRegion labRegList.
*/
if (arg->hw_autogen)
{
@@ -300,7 +300,7 @@ extHardSetLabel(scx, reg, arg)
* coordinates in the def scx->scx_use->cu_def
* up to root coordinates.
*/
TransRegion *reg; /* Region with a label list */
TransRegion *reg; /* ExtRegion with a label list */
HardWay *arg; /* We will set arg->hw_label if a node
* label is found on the label list of 'reg'.
*/
@@ -414,7 +414,7 @@ extHardGenerateLabel(scx, reg, arg)
* generated label's coordinates up to
* root coordinates.
*/
TransRegion *reg; /* Region whose treg_ll and treg_pnum we use
TransRegion *reg; /* ExtRegion whose treg_ll and treg_pnum we use
* to generate a new label name.
*/
HardWay *arg; /* We set arg->hw_label to the new label */
@@ -493,7 +493,7 @@ extHardFreeAll(def, tReg)
arg.fra_connectsTo = ExtCurStyle->exts_nodeConn;
arg.fra_def = def;
arg.fra_each = (int (*)()) NULL;
arg.fra_region = (Region *) extUnInit;
arg.fra_region = (ExtRegion *) extUnInit;
for (reg = tReg; reg; reg = reg->treg_next)
{
+3 -3
View File
@@ -941,7 +941,7 @@ extHierNewNode(he)
*/
/*ARGSUSED*/
Region *
ExtRegion *
extHierLabFirst(tile, arg)
Tile *tile;
FindRegion *arg;
@@ -955,9 +955,9 @@ extHierLabFirst(tile, arg)
/* Prepend it to the region list */
new->lreg_next = (LabRegion *) arg->fra_region;
arg->fra_region = (Region *) new;
arg->fra_region = (ExtRegion *) new;
return ((Region *) new);
return ((ExtRegion *) new);
}
/*ARGSUSED*/
+16 -16
View File
@@ -46,11 +46,11 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
* Two procedures are supplied by the caller, 'first' and 'each'.
*
* The function 'first' must be non-NULL. It is called for each tile
* tile found in the region. It must return a pointer to a Region
* struct (or one of the client forms of a Region struct; see the
* tile found in the region. It must return a pointer to a ExtRegion
* struct (or one of the client forms of a ExtRegion struct; see the
* comments in extractInt.h).
*
* Region *
* ExtRegion *
* (*first)(tile, arg)
* Tile *tile; /# Tile is on plane arg->fra_pNum #/
* FindRegion *arg;
@@ -69,13 +69,13 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
*
* Results:
* Returns a pointer to the first element in the linked list
* of Region structures for this CellDef. The Region structs
* may in fact contain more than the basic Region struct; this
* of ExtRegion structures for this CellDef. The ExtRegion structs
* may in fact contain more than the basic ExtRegion struct; this
* will depend on what the function 'first' allocates.
*
* Side effects:
* Each non-space tile has its ti_client field left pointing
* to a Region structure that describes the region that tile
* to a ExtRegion structure that describes the region that tile
* belongs to.
*
* Non-interruptible. It is the caller's responsibility to check
@@ -84,7 +84,7 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
* ----------------------------------------------------------------------------
*/
Region *
ExtRegion *
ExtFindRegions(def, area, mask, connectsTo, uninit, first, each)
CellDef *def; /* Cell definition being searched */
Rect *area; /* Area to search initially for tiles */
@@ -104,7 +104,7 @@ ExtFindRegions(def, area, mask, connectsTo, uninit, first, each)
ClientData uninit; /* Contents of a ti_client field indicating
* that the tile has not yet been visited.
*/
Region * (*first)(); /* Applied to first tile in region */
ExtRegion * (*first)(); /* Applied to first tile in region */
int (*each)(); /* Applied to each tile in region */
{
FindRegion arg;
@@ -116,7 +116,7 @@ ExtFindRegions(def, area, mask, connectsTo, uninit, first, each)
arg.fra_uninit = uninit;
arg.fra_first = first;
arg.fra_each = each;
arg.fra_region = (Region *) NULL;
arg.fra_region = (ExtRegion *) NULL;
/* Make sure temp_subsnode is NULL */
temp_subsnode = NULL;
@@ -140,7 +140,7 @@ ExtFindRegions(def, area, mask, connectsTo, uninit, first, each)
* equal to arg->fra_uninit are visited.
*
* We call 'fra_first' to allocate a new region struct for it, and then
* prepend it to the Region list (Region *) arg->fra_clientData. We
* prepend it to the ExtRegion list (ExtRegion *) arg->fra_clientData. We
* then call ExtFindNeighbors to trace out recursively all the remaining
* tiles in the region.
*
@@ -148,7 +148,7 @@ ExtFindRegions(def, area, mask, connectsTo, uninit, first, each)
* Always returns 0, to cause DBSrPaintClient to continue its search.
*
* Side effects:
* Allocates a new Region struct if the tile has not yet been visited.
* Allocates a new ExtRegion struct if the tile has not yet been visited.
* See also the comments for ExtFindNeighbors.
*
* ----------------------------------------------------------------------------
@@ -425,7 +425,7 @@ ExtLabelOneRegion(def, connTo, reg)
*
* Side effects:
* All the non-space tiles in the CellDef have their ti_client
* fields set back to uninitialized. Does not free the Region
* fields set back to uninitialized. Does not free the ExtRegion
* structs that these tiles point to; that must be done by
* ExtFreeRegions, ExtFreeLabRegions, or ExtFreeHierLabRegions.
*
@@ -470,9 +470,9 @@ ExtResetTiles(def, resetTo)
void
ExtFreeRegions(regList)
Region *regList; /* List of regions to be freed */
ExtRegion *regList; /* List of regions to be freed */
{
Region *reg;
ExtRegion *reg;
for (reg = regList; reg; reg = reg->reg_next)
freeMagic((char *) reg);
@@ -495,9 +495,9 @@ ExtFreeLabRegions(regList)
void
ExtFreeHierLabRegions(regList)
Region *regList; /* List of regions to be freed */
ExtRegion *regList; /* List of regions to be freed */
{
Region *reg;
ExtRegion *reg;
LabelList *ll;
for (reg = regList; reg; reg = reg->reg_next)
+1 -1
View File
@@ -950,7 +950,7 @@ extSubstrateFunc(scx, ha)
* The node associated with a tile can be determined in one of the
* following ways:
*
* (1) Look for a label on the list of the Region pointed to by the
* (1) Look for a label on the list of the ExtRegion pointed to by the
* tile planes of the yank buffer. If no label was found, then
* try (2).
*
+12 -12
View File
@@ -132,7 +132,7 @@ typedef struct ll
* The following are the structures built up by the various
* clients of ExtFindRegions. The general rule for these
* structures is that their initial fields must be identical
* to those in a Region, but subsequent fields are up to
* to those in a ExtRegion, but subsequent fields are up to
* the individual client.
*
* Regions marked as GENERIC are the types accepted by
@@ -140,8 +140,8 @@ typedef struct ll
*/
/*
* GENERIC Region struct.
* All this provides is a pointer to the next Region.
* GENERIC ExtRegion struct.
* All this provides is a pointer to the next ExtRegion.
* This is the type passed to functions like ExtFreeRegions,
* and is the type returned by ExtFindRegions. Clients should
* cast pointers of this type to their own, client type.
@@ -149,7 +149,7 @@ typedef struct ll
typedef struct reg
{
struct reg *reg_next; /* Next region in list */
} Region;
} ExtRegion;
/*
* GENERIC region with labels.
@@ -253,9 +253,9 @@ typedef struct
* field of a tile if it's not yet
* been visited.
*/
Region *(*fra_first)(); /* Function to init new region */
ExtRegion *(*fra_first)(); /* Function to init new region */
int (*fra_each)(); /* Function for each tile in region */
Region *fra_region; /* Ptr to Region struct for current
ExtRegion *fra_region; /* Ptr to ExtRegion struct for current
* region. May be set by fra_first
* and used by fra_each.
*/
@@ -1027,16 +1027,16 @@ extern ClientData extUnInit;
STACKPUSH((ClientData)(pointertype)(pl | TT_SIDE), extNodeStack); \
STACKPUSH((ClientData)(pointertype)tp, extNodeStack)
/* ------------------------- Region finding --------------------------- */
/* ------------------------- ExtRegion finding --------------------------- */
extern Region *ExtFindRegions();
extern ExtRegion *ExtFindRegions();
extern LabelList *ExtLabelRegions();
/* Filter functions for ExtFindRegions() */
extern Region *extTransFirst(); extern int extTransEach();
extern Region *extResFirst(); extern int extResEach();
extern Region *extNodeFirst(); extern int extNodeEach();
extern Region *extHierLabFirst(); extern int extHierLabEach();
extern ExtRegion *extTransFirst(); extern int extTransEach();
extern ExtRegion *extResFirst(); extern int extResEach();
extern ExtRegion *extNodeFirst(); extern int extNodeEach();
extern ExtRegion *extHierLabFirst(); extern int extHierLabEach();
extern Tile *extNodeToTile();