database: convert K&R function definitions to ANSI C

Convert the old-style (K&R) function definitions in database/ to ANSI C
prototypes, formatted in the project's convention: the return type on its
own line and each parameter on its own line, indented four spaces, with
the original parameter comments retained.

Updates the database prototypes through the database.h.in template
(database.h is generated) and adds a forward typedef for FontChar so
those prototypes need not pull in database/fonts.h.  Also fixes a latent
bug exposed by the now-checked prototype: dbStampFunc was defined with two
parameters but called recursively with one.

Builds cleanly under GCC 16 / C23 (with the -std=gnu17 build change).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Andreas Wendleder 2026-06-10 03:48:52 +02:00
parent da6d49d1b3
commit da2438e5cf
No known key found for this signature in database
GPG Key ID: 588785BFDFB01ABD
26 changed files with 1313 additions and 1268 deletions

View File

@ -53,10 +53,10 @@ typedef struct dbcellboundstruct
*/ */
int int
DBBoundCellPlane(def, extended, rect) DBBoundCellPlane(
CellDef *def; CellDef *def,
Rect *extended; Rect *extended,
Rect *rect; Rect *rect)
{ {
TreeFilter filter; TreeFilter filter;
DBCellBoundStruct cbs; DBCellBoundStruct cbs;
@ -79,9 +79,9 @@ DBBoundCellPlane(def, extended, rect)
} }
int int
dbCellBoundFunc(use, fp) dbCellBoundFunc(
CellUse *use; CellUse *use,
TreeFilter *fp; TreeFilter *fp)
{ {
DBCellBoundStruct *cbs; DBCellBoundStruct *cbs;
@ -124,9 +124,9 @@ dbCellBoundFunc(use, fp)
*/ */
bool bool
DBBoundPlane(plane, rect) DBBoundPlane(
Plane *plane; Plane *plane,
Rect *rect; Rect *rect)
{ {
Tile *left, *right, *top, *bottom, *tp; Tile *left, *right, *top, *bottom, *tp;
@ -205,9 +205,9 @@ DBBoundPlane(plane, rect)
*/ */
bool bool
DBBoundPlaneVert(plane, rect) DBBoundPlaneVert(
Plane *plane; Plane *plane,
Rect *rect; Rect *rect)
{ {
Tile *left, *right, *top, *bottom, *tp; Tile *left, *right, *top, *bottom, *tp;

View File

@ -57,7 +57,8 @@ struct searchArg
int dbCellDebug = 0; int dbCellDebug = 0;
void void
dbInstanceUnplace(CellUse *use) dbInstanceUnplace(
CellUse *use)
{ {
ASSERT(use != (CellUse *) NULL, "dbInstanceUnplace"); ASSERT(use != (CellUse *) NULL, "dbInstanceUnplace");
@ -93,11 +94,11 @@ dbInstanceUnplace(CellUse *use)
*/ */
CellUse * CellUse *
DBCellFindDup(use, parent) DBCellFindDup(
CellUse *use; /* Use that is about to be placed in parent. CellUse *use, /* Use that is about to be placed in parent.
* Is it a duplicate? * Is it a duplicate?
*/ */
CellDef *parent; /* Parent definiton: does it already have CellDef *parent) /* Parent definiton: does it already have
* something identical to use? * something identical to use?
*/ */
{ {
@ -185,9 +186,9 @@ DBCellFindDup(use, parent)
*/ */
void void
DBPlaceCell (use, def) DBPlaceCell(
CellUse * use; /* new celluse to add to subcell tile plane */ CellUse * use, /* new celluse to add to subcell tile plane */
CellDef * def; /* parent cell's definition */ CellDef * def) /* parent cell's definition */
{ {
Rect rect; /* argument to DBSrCellPlaneArea(), placeCellFunc() */ Rect rect; /* argument to DBSrCellPlaneArea(), placeCellFunc() */
BPlane *bplane; /* argument to DBSrCellPlaneArea(), placeCellFunc() */ BPlane *bplane; /* argument to DBSrCellPlaneArea(), placeCellFunc() */
@ -219,9 +220,9 @@ DBPlaceCell (use, def)
/* this does not mean that anything in the parent cell has changed. */ /* this does not mean that anything in the parent cell has changed. */
void void
DBPlaceCellNoModify (use, def) DBPlaceCellNoModify(
CellUse * use; /* new celluse to add to subcell tile plane */ CellUse * use, /* new celluse to add to subcell tile plane */
CellDef * def; /* parent cell's definition */ CellDef * def) /* parent cell's definition */
{ {
Rect rect; /* argument to DBSrCellPlaneArea(), placeCellFunc() */ Rect rect; /* argument to DBSrCellPlaneArea(), placeCellFunc() */
BPlane *bplane; /* argument to DBSrCellPlaneArea(), placeCellFunc() */ BPlane *bplane; /* argument to DBSrCellPlaneArea(), placeCellFunc() */
@ -264,8 +265,8 @@ DBPlaceCellNoModify (use, def)
*/ */
void void
DBDeleteCell (use) DBDeleteCell(
CellUse * use; CellUse * use)
{ {
ASSERT(use != (CellUse *) NULL, "DBDeleteCell"); ASSERT(use != (CellUse *) NULL, "DBDeleteCell");
@ -302,8 +303,8 @@ DBDeleteCell (use)
*/ */
void void
DBDeleteCellNoModify (use) DBDeleteCellNoModify(
CellUse * use; CellUse * use)
{ {
ASSERT(use != (CellUse *) NULL, "DBDeleteCell"); ASSERT(use != (CellUse *) NULL, "DBDeleteCell");

View File

@ -126,8 +126,8 @@ DBPrintUseId(
*/ */
void void
DBCellSetAvail(cellDef) DBCellSetAvail(
CellDef *cellDef; /* Pointer to definition of cell we wish to CellDef *cellDef) /* Pointer to definition of cell we wish to
* mark as available. * mark as available.
*/ */
{ {
@ -136,8 +136,8 @@ DBCellSetAvail(cellDef)
} }
void void
DBCellClearAvail(cellDef) DBCellClearAvail(
CellDef *cellDef; /* Pointer to definition of cell we wish to CellDef *cellDef) /* Pointer to definition of cell we wish to
* mark as available. * mark as available.
*/ */
{ {
@ -168,16 +168,16 @@ DBCellClearAvail(cellDef)
*/ */
bool bool
DBCellGetModified(cellDef) DBCellGetModified(
CellDef *cellDef; /* Pointer to definition of cell */ CellDef *cellDef) /* Pointer to definition of cell */
{ {
return ((cellDef->cd_flags & CDMODIFIED) != 0); return ((cellDef->cd_flags & CDMODIFIED) != 0);
} }
void void
DBCellSetModified(cellDef, ismod) DBCellSetModified(
CellDef *cellDef; CellDef *cellDef,
bool ismod; /* If TRUE, mark the cell as modified; if FALSE, bool ismod) /* If TRUE, mark the cell as modified; if FALSE,
* mark it as unmodified. * mark it as unmodified.
*/ */
{ {
@ -205,8 +205,8 @@ DBCellSetModified(cellDef, ismod)
*/ */
void void
DBComputeUseBbox(use) DBComputeUseBbox(
CellUse *use; CellUse *use)
{ {
Rect *box, *extended; Rect *box, *extended;
Rect childRect, childExtend; Rect childRect, childExtend;
@ -271,8 +271,9 @@ DBComputeUseBbox(use)
*/ */
bool bool
DBIsChild(cu1, cu2) DBIsChild(
CellUse *cu1, *cu2; CellUse *cu1,
CellUse *cu2)
{ {
return (cu1->cu_parent == cu2->cu_def); return (cu1->cu_parent == cu2->cu_def);
} }
@ -294,9 +295,9 @@ DBIsChild(cu1, cu2)
*/ */
void void
DBSetArray(fromCellUse, toCellUse) DBSetArray(
CellUse *fromCellUse; CellUse *fromCellUse,
CellUse *toCellUse; CellUse *toCellUse)
{ {
toCellUse->cu_xlo = fromCellUse->cu_xlo; toCellUse->cu_xlo = fromCellUse->cu_xlo;
toCellUse->cu_ylo = fromCellUse->cu_ylo; toCellUse->cu_ylo = fromCellUse->cu_ylo;
@ -323,9 +324,9 @@ DBSetArray(fromCellUse, toCellUse)
*/ */
void void
DBSetTrans(cellUse, trans) DBSetTrans(
CellUse *cellUse; CellUse *cellUse,
Transform *trans; Transform *trans)
{ {
cellUse->cu_transform = *trans; cellUse->cu_transform = *trans;
DBComputeUseBbox(cellUse); DBComputeUseBbox(cellUse);
@ -357,12 +358,15 @@ DBSetTrans(cellUse, trans)
*/ */
void void
DBMakeArray(cellUse, rootToCell, xlo, ylo, xhi, yhi, xsep, ysep) DBMakeArray(
CellUse *cellUse; CellUse *cellUse,
Transform *rootToCell; Transform *rootToCell,
int xlo, ylo; int xlo,
int xhi, yhi; int ylo,
int xsep, ysep; int xhi,
int yhi,
int xsep,
int ysep)
{ {
int t; int t;
@ -417,11 +421,13 @@ DBMakeArray(cellUse, rootToCell, xlo, ylo, xhi, yhi, xsep, ysep)
*/ */
void void
DBArrayOverlap(cu, parentRect, pxlo, pxhi, pylo, pyhi) DBArrayOverlap(
CellUse *cu; /* Pointer to cell use which may be an array */ CellUse *cu, /* Pointer to cell use which may be an array */
Rect *parentRect; /* Clipping rectangle cu->cu_parent coords */ Rect *parentRect, /* Clipping rectangle cu->cu_parent coords */
int *pxlo, *pxhi; int *pxlo,
int *pylo, *pyhi; int *pxhi,
int *pylo,
int *pyhi)
{ {
int outxlo, outxhi, outylo, outyhi, t; int outxlo, outxhi, outylo, outyhi, t;
int xlo, ylo, xhi, yhi, xsep, ysep; int xlo, ylo, xhi, yhi, xsep, ysep;
@ -584,8 +590,8 @@ DBArrayOverlap(cu, parentRect, pxlo, pxhi, pylo, pyhi)
void dbReComputeBboxFunc(); void dbReComputeBboxFunc();
void void
DBReComputeBbox(cellDef) DBReComputeBbox(
CellDef *cellDef; /* Cell def whose bounding box may have changed */ CellDef *cellDef) /* Cell def whose bounding box may have changed */
{ {
extern bool DBBoundPlane(); extern bool DBBoundPlane();
@ -593,8 +599,8 @@ DBReComputeBbox(cellDef)
} }
void void
DBReComputeBboxVert(cellDef) DBReComputeBboxVert(
CellDef *cellDef; /* Cell def whose bounding box may have changed */ CellDef *cellDef) /* Cell def whose bounding box may have changed */
{ {
extern bool DBBoundPlaneVert(); extern bool DBBoundPlaneVert();
@ -602,10 +608,10 @@ DBReComputeBboxVert(cellDef)
} }
void void
dbReComputeBboxFunc(cellDef, boundProc, recurseProc) dbReComputeBboxFunc(
CellDef *cellDef; /* Cell def whose bounding box may have changed */ CellDef *cellDef, /* Cell def whose bounding box may have changed */
bool (*boundProc)(); bool (*boundProc)(),
void (*recurseProc)(); void (*recurseProc)())
{ {
bool degenerate; bool degenerate;
Rect rect, area, extended, *box; Rect rect, area, extended, *box;
@ -797,11 +803,12 @@ dbReComputeBboxFunc(cellDef, boundProc, recurseProc)
*/ */
void void
DBComputeArrayArea(area, cellUse, x, y, prect) DBComputeArrayArea(
Rect *area; /* Area to be transformed. */ Rect *area, /* Area to be transformed. */
CellUse *cellUse; /* Cell use whose bounding box is to be computed */ CellUse *cellUse, /* Cell use whose bounding box is to be computed */
int x, y; /* Indexes of array element whose box is being found */ int x,
Rect *prect; /* Pointer to rectangle to be set to bounding int y,
Rect *prect) /* Pointer to rectangle to be set to bounding
* box of the given array element, in coordinates * box of the given array element, in coordinates
* of the def of cellUse. * of the def of cellUse.
*/ */
@ -848,12 +855,10 @@ DBComputeArrayArea(area, cellUse, x, y, prect)
*/ */
Transform * Transform *
DBGetArrayTransform(use, x, y) DBGetArrayTransform(
CellUse *use; CellUse *use,
int x, y; /* Array indices of the desired element. int x,
* These must fall within the range of int y)
* use's array indices.
*/
{ {
static Transform result; static Transform result;
int xsep, ysep, xbase, ybase; int xsep, ysep, xbase, ybase;

View File

@ -107,12 +107,12 @@ struct copyLabelArg
*/ */
int int
DBPaintPlaneWrapper(def, pNum, type, area, undo) DBPaintPlaneWrapper(
CellDef *def; CellDef *def,
int pNum; int pNum,
TileType type; TileType type,
Rect *area; Rect *area,
PaintUndoInfo *undo; PaintUndoInfo *undo)
{ {
TileType loctype = type & TT_LEFTMASK; TileType loctype = type & TT_LEFTMASK;
Rect expand; Rect expand;
@ -139,12 +139,12 @@ DBPaintPlaneWrapper(def, pNum, type, area, undo)
*/ */
int int
DBPaintPlaneMark(def, pNum, type, area, undo) DBPaintPlaneMark(
CellDef *def; CellDef *def,
int pNum; int pNum,
TileType type; TileType type,
Rect *area; Rect *area,
PaintUndoInfo *undo; PaintUndoInfo *undo)
{ {
TileType loctype = type & TT_LEFTMASK; TileType loctype = type & TT_LEFTMASK;
@ -160,12 +160,12 @@ DBPaintPlaneMark(def, pNum, type, area, undo)
*/ */
int int
DBPaintPlaneXor(def, pNum, type, area, undo) DBPaintPlaneXor(
CellDef *def; CellDef *def,
int pNum; int pNum,
TileType type; TileType type,
Rect *area; Rect *area,
PaintUndoInfo *undo; PaintUndoInfo *undo)
{ {
TileType loctype = type & TT_LEFTMASK; TileType loctype = type & TT_LEFTMASK;
@ -188,12 +188,12 @@ DBPaintPlaneXor(def, pNum, type, area, undo)
*/ */
int int
DBPaintPlaneActive(def, pNum, type, area, undo) DBPaintPlaneActive(
CellDef *def; CellDef *def,
int pNum; int pNum,
TileType type; TileType type,
Rect *area; Rect *area,
PaintUndoInfo *undo; PaintUndoInfo *undo)
{ {
TileType loctype = type & TT_LEFTMASK; TileType loctype = type & TT_LEFTMASK;
TileType t; TileType t;
@ -241,14 +241,14 @@ DBPaintPlaneActive(def, pNum, type, area, undo)
*/ */
void void
DBCellCopyManhattanPaint(scx, mask, xMask, targetUse) DBCellCopyManhattanPaint(
SearchContext *scx; /* Describes root cell to search, area to SearchContext *scx, /* Describes root cell to search, area to
* copy, transform from root cell to coords * copy, transform from root cell to coords
* of targetUse. * of targetUse.
*/ */
TileTypeBitMask *mask; /* Types of tiles to be yanked/stuffed */ TileTypeBitMask *mask, /* Types of tiles to be yanked/stuffed */
int xMask; /* Expansion state mask to be used in search */ int xMask, /* Expansion state mask to be used in search */
CellUse *targetUse; /* Cell into which material is to be stuffed */ CellUse *targetUse) /* Cell into which material is to be stuffed */
{ {
struct copyAllArg arg; struct copyAllArg arg;
int dbCopyManhattanPaint(); int dbCopyManhattanPaint();
@ -281,14 +281,14 @@ DBCellCopyManhattanPaint(scx, mask, xMask, targetUse)
*/ */
void void
DBCellCopyAllPaint(scx, mask, xMask, targetUse) DBCellCopyAllPaint(
SearchContext *scx; /* Describes root cell to search, area to SearchContext *scx, /* Describes root cell to search, area to
* copy, transform from root cell to coords * copy, transform from root cell to coords
* of targetUse. * of targetUse.
*/ */
TileTypeBitMask *mask; /* Types of tiles to be yanked/stuffed */ TileTypeBitMask *mask, /* Types of tiles to be yanked/stuffed */
int xMask; /* Expansion state mask to be used in search */ int xMask, /* Expansion state mask to be used in search */
CellUse *targetUse; /* Cell into which material is to be stuffed */ CellUse *targetUse) /* Cell into which material is to be stuffed */
{ {
TileTypeBitMask locMask; TileTypeBitMask locMask;
struct copyAllArg arg; struct copyAllArg arg;
@ -325,15 +325,15 @@ DBCellCopyAllPaint(scx, mask, xMask, targetUse)
*/ */
void void
DBCellCheckCopyAllPaint(scx, mask, xMask, targetUse, func) DBCellCheckCopyAllPaint(
SearchContext *scx; /* Describes root cell to search, area to SearchContext *scx, /* Describes root cell to search, area to
* copy, transform from root cell to coords * copy, transform from root cell to coords
* of targetUse. * of targetUse.
*/ */
TileTypeBitMask *mask; /* Types of tiles to be yanked/stuffed */ TileTypeBitMask *mask, /* Types of tiles to be yanked/stuffed */
int xMask; /* Expansion state mask to be used in search */ int xMask, /* Expansion state mask to be used in search */
CellUse *targetUse; /* Cell into which material is to be stuffed */ CellUse *targetUse, /* Cell into which material is to be stuffed */
void (*func)(); /* Function to call on tile split error */ void (*func)()) /* Function to call on tile split error */
{ {
TileTypeBitMask locMask; TileTypeBitMask locMask;
struct copyAllArg arg; struct copyAllArg arg;
@ -413,10 +413,10 @@ dbCopyMaskHintPlaneFunc(Tile *tile,
*/ */
int int
dbCopyMaskHintsFunc(key, proprec, puds) dbCopyMaskHintsFunc(
char *key; char *key,
PropertyRecord *proprec; PropertyRecord *proprec,
struct propUseDefStruct *puds; struct propUseDefStruct *puds)
{ {
CellDef *dest = puds->puds_dest; CellDef *dest = puds->puds_dest;
Transform *trans = puds->puds_trans; Transform *trans = puds->puds_trans;
@ -480,10 +480,10 @@ dbCopyMaskHintsFunc(key, proprec, puds)
*----------------------------------------------------------------------------- *-----------------------------------------------------------------------------
*/ */
void void
DBCellCopyMaskHints(child, parent, transform) DBCellCopyMaskHints(
CellUse *child; CellUse *child,
CellDef *parent; CellDef *parent,
Transform *transform; Transform *transform)
{ {
struct propUseDefStruct puds; struct propUseDefStruct puds;
@ -514,9 +514,9 @@ DBCellCopyMaskHints(child, parent, transform)
*----------------------------------------------------------------------------- *-----------------------------------------------------------------------------
*/ */
int int
dbFlatCopyMaskHintsFunc(scx, def) dbFlatCopyMaskHintsFunc(
SearchContext *scx; SearchContext *scx,
CellDef *def; CellDef *def)
{ {
struct propUseDefStruct puds; struct propUseDefStruct puds;
CellUse *use = scx->scx_use; CellUse *use = scx->scx_use;
@ -548,13 +548,13 @@ dbFlatCopyMaskHintsFunc(scx, def)
*----------------------------------------------------------------------------- *-----------------------------------------------------------------------------
*/ */
void void
DBFlatCopyMaskHints(scx, xMask, targetUse) DBFlatCopyMaskHints(
SearchContext *scx; /* Describes root cell to search, area to SearchContext *scx, /* Describes root cell to search, area to
* copy, transform from root cell to coords * copy, transform from root cell to coords
* of targetUse. * of targetUse.
*/ */
int xMask; /* Expansion state mask to be used in search */ int xMask, /* Expansion state mask to be used in search */
CellUse *targetUse; /* Cell into which properties will be added */ CellUse *targetUse) /* Cell into which properties will be added */
{ {
DBTreeSrCells(scx, xMask, dbFlatCopyMaskHintsFunc, (ClientData)targetUse->cu_def); DBTreeSrCells(scx, xMask, dbFlatCopyMaskHintsFunc, (ClientData)targetUse->cu_def);
} }
@ -577,13 +577,13 @@ DBFlatCopyMaskHints(scx, xMask, targetUse)
*/ */
void void
DBFlattenInPlace(use, dest, xMask, dolabels, toplabels, doclear) DBFlattenInPlace(
CellUse *use; /* Cell use to flatten */ CellUse *use, /* Cell use to flatten */
CellUse *dest; /* Cell use to flatten into */ CellUse *dest, /* Cell use to flatten into */
int xMask; /* Search mask for flattening */ int xMask, /* Search mask for flattening */
bool dolabels; /* Option to flatten labels */ bool dolabels, /* Option to flatten labels */
bool toplabels; /* Option to selectively flatten top-level labels */ bool toplabels, /* Option to selectively flatten top-level labels */
bool doclear; /* Delete the original use if TRUE */ bool doclear) /* Delete the original use if TRUE */
{ {
Label *lab; Label *lab;
SearchContext scx; SearchContext scx;
@ -737,12 +737,12 @@ struct dbFlattenAllData {
*/ */
int int
dbCellFlattenCellsFunc(scx, clientData) dbCellFlattenCellsFunc(
SearchContext *scx; /* Pointer to search context containing SearchContext *scx, /* Pointer to search context containing
* ptr to cell use to be copied, * ptr to cell use to be copied,
* and transform to the target def. * and transform to the target def.
*/ */
ClientData clientData; /* Data passed to client function */ ClientData clientData) /* Data passed to client function */
{ {
CellUse *use, *dest; CellUse *use, *dest;
int xMask; int xMask;
@ -778,17 +778,17 @@ dbCellFlattenCellsFunc(scx, clientData)
*/ */
void void
DBCellFlattenAllCells(scx, dest, xMask, dolabels, toplabels) DBCellFlattenAllCells(
SearchContext *scx; /* Describes root cell to search and transform SearchContext *scx, /* Describes root cell to search and transform
* from root cell to coords of targetUse. * from root cell to coords of targetUse.
*/ */
CellUse *dest; /* CellUse to flatten into (usually EditCellUse) */ CellUse *dest, /* CellUse to flatten into (usually EditCellUse) */
int xMask; /* Expansion state mask to be passed to int xMask, /* Expansion state mask to be passed to
* the flattening routine that determines * the flattening routine that determines
* whether to do a shallow or deep flattening. * whether to do a shallow or deep flattening.
*/ */
bool dolabels; /* Option to flatten labels */ bool dolabels, /* Option to flatten labels */
bool toplabels; /* Option to selectively flatten top-level labels */ bool toplabels) /* Option to selectively flatten top-level labels */
{ {
int dbCellFlattenCellsFunc(); int dbCellFlattenCellsFunc();
struct dbFlattenAllData fad; struct dbFlattenAllData fad;
@ -839,12 +839,12 @@ struct dbCopySubData {
*/ */
Plane * Plane *
DBCellGenerateSubstrate(scx, subType, notSubMask, subShieldMask, targetDef) DBCellGenerateSubstrate(
SearchContext *scx; SearchContext *scx,
TileType subType; /* Substrate paint type */ TileType subType, /* Substrate paint type */
TileTypeBitMask *notSubMask; /* Mask of types that are not substrate */ TileTypeBitMask *notSubMask, /* Mask of types that are not substrate */
TileTypeBitMask *subShieldMask; /* Mask of types that shield substrate */ TileTypeBitMask *subShieldMask, /* Mask of types that shield substrate */
CellDef *targetDef; CellDef *targetDef)
{ {
struct dbCopySubData csd; struct dbCopySubData csd;
Plane *tempPlane; Plane *tempPlane;
@ -930,11 +930,11 @@ DBCellGenerateSubstrate(scx, subType, notSubMask, subShieldMask, targetDef)
*/ */
Plane * Plane *
DBCellGenerateSimpleSubstrate(scx, subType, notSubMask, targetDef) DBCellGenerateSimpleSubstrate(
SearchContext *scx; SearchContext *scx,
TileType subType; /* Substrate paint type */ TileType subType, /* Substrate paint type */
TileTypeBitMask *notSubMask; /* Mask of types that are not substrate */ TileTypeBitMask *notSubMask, /* Mask of types that are not substrate */
CellDef *targetDef; CellDef *targetDef)
{ {
struct dbCopySubData csd; struct dbCopySubData csd;
Plane *tempPlane; Plane *tempPlane;
@ -991,10 +991,10 @@ DBCellGenerateSimpleSubstrate(scx, subType, notSubMask, targetDef)
*/ */
int int
dbEraseSubFunc(tile, dinfo, cxp) dbEraseSubFunc(
Tile *tile; /* Pointer to source tile with shield type */ Tile *tile, /* Pointer to source tile with shield type */
TileType dinfo; /* Split tile information */ TileType dinfo, /* Split tile information */
TreeContext *cxp; /* Context from DBTreeSrTiles */ TreeContext *cxp) /* Context from DBTreeSrTiles */
{ {
SearchContext *scx; SearchContext *scx;
Rect sourceRect, targetRect; Rect sourceRect, targetRect;
@ -1037,10 +1037,10 @@ dbEraseSubFunc(tile, dinfo, cxp)
*/ */
int int
dbPaintSubFunc(tile, dinfo, cxp) dbPaintSubFunc(
Tile *tile; /* Pointer to source tile with shield type */ Tile *tile, /* Pointer to source tile with shield type */
TileType dinfo; /* Split tile information */ TileType dinfo, /* Split tile information */
TreeContext *cxp; /* Context from DBTreeSrTiles */ TreeContext *cxp) /* Context from DBTreeSrTiles */
{ {
SearchContext *scx; SearchContext *scx;
Rect sourceRect, targetRect; Rect sourceRect, targetRect;
@ -1084,10 +1084,10 @@ dbPaintSubFunc(tile, dinfo, cxp)
*/ */
int int
dbEraseNonSub(tile, dinfo, cxp) dbEraseNonSub(
Tile *tile; /* Pointer to tile to erase from target */ Tile *tile, /* Pointer to tile to erase from target */
TileType dinfo; /* Split tile information */ TileType dinfo, /* Split tile information */
TreeContext *cxp; /* Context from DBTreeSrTiles */ TreeContext *cxp) /* Context from DBTreeSrTiles */
{ {
SearchContext *scx; SearchContext *scx;
Rect sourceRect, targetRect; Rect sourceRect, targetRect;
@ -1131,10 +1131,10 @@ dbEraseNonSub(tile, dinfo, cxp)
*/ */
int int
dbCopySubFunc(tile, dinfo, csd) dbCopySubFunc(
Tile *tile; /* Pointer to tile to erase from target */ Tile *tile, /* Pointer to tile to erase from target */
TileType dinfo; /* Split tile information */ TileType dinfo, /* Split tile information */
struct dbCopySubData *csd; /* Client data */ struct dbCopySubData *csd) /* Client data */
{ {
Rect rect; Rect rect;
int pNum; int pNum;
@ -1181,15 +1181,15 @@ dbCopySubFunc(tile, dinfo, csd)
*/ */
void void
DBCellCopyAllLabels(scx, mask, xMask, targetUse, pArea) DBCellCopyAllLabels(
SearchContext *scx; /* Describes root cell to search, area to SearchContext *scx, /* Describes root cell to search, area to
* copy, transform from root cell to coords * copy, transform from root cell to coords
* of targetUse. * of targetUse.
*/ */
TileTypeBitMask *mask; /* Only labels of these types are copied */ TileTypeBitMask *mask, /* Only labels of these types are copied */
int xMask; /* Expansion state mask to be used in search */ int xMask, /* Expansion state mask to be used in search */
CellUse *targetUse; /* Cell into which labels are to be stuffed */ CellUse *targetUse, /* Cell into which labels are to be stuffed */
Rect *pArea; /* If non-NULL, points to a box that will be Rect *pArea) /* If non-NULL, points to a box that will be
* filled in with bbox (in targetUse coords) * filled in with bbox (in targetUse coords)
* of all labels copied. Will be degenerate * of all labels copied. Will be degenerate
* if nothing was copied. * if nothing was copied.
@ -1217,11 +1217,11 @@ DBCellCopyAllLabels(scx, mask, xMask, targetUse, pArea)
/*ARGSUSED*/ /*ARGSUSED*/
int int
dbCopyAllLabels(scx, lab, tpath, arg) dbCopyAllLabels(
SearchContext *scx; SearchContext *scx,
Label *lab; Label *lab,
TerminalPath *tpath; TerminalPath *tpath,
struct copyLabelArg *arg; struct copyLabelArg *arg)
{ {
Rect labTargetRect; Rect labTargetRect;
Point labOffset; Point labOffset;
@ -1284,20 +1284,20 @@ dbCopyAllLabels(scx, lab, tpath, arg)
*/ */
void void
DBCellCopyGlobLabels(scx, mask, xMask, targetUse, pArea, globmatch) DBCellCopyGlobLabels(
SearchContext *scx; /* Describes root cell to search, area to SearchContext *scx, /* Describes root cell to search, area to
* copy, transform from root cell to coords * copy, transform from root cell to coords
* of targetUse. * of targetUse.
*/ */
TileTypeBitMask *mask; /* Only labels of these types are copied */ TileTypeBitMask *mask, /* Only labels of these types are copied */
int xMask; /* Expansion state mask to be used in search */ int xMask, /* Expansion state mask to be used in search */
CellUse *targetUse; /* Cell into which labels are to be stuffed */ CellUse *targetUse, /* Cell into which labels are to be stuffed */
Rect *pArea; /* If non-NULL, points to a box that will be Rect *pArea, /* If non-NULL, points to a box that will be
* filled in with bbox (in targetUse coords) * filled in with bbox (in targetUse coords)
* of all labels copied. Will be degenerate * of all labels copied. Will be degenerate
* if nothing was copied. * if nothing was copied.
*/ */
char *globmatch; /* If non-NULL, only labels matching this char *globmatch) /* If non-NULL, only labels matching this
* string by glob-style matching are copied. * string by glob-style matching are copied.
*/ */
{ {
@ -1340,14 +1340,14 @@ DBCellCopyGlobLabels(scx, mask, xMask, targetUse, pArea, globmatch)
*/ */
void void
DBCellCopyPaint(scx, mask, xMask, targetUse) DBCellCopyPaint(
SearchContext *scx; /* Describes cell to search, area to SearchContext *scx, /* Describes cell to search, area to
* copy, transform from cell to coords * copy, transform from cell to coords
* of targetUse. * of targetUse.
*/ */
TileTypeBitMask *mask; /* Types of tiles to be yanked/stuffed */ TileTypeBitMask *mask, /* Types of tiles to be yanked/stuffed */
int xMask; /* Expansion state mask to be used in search */ int xMask, /* Expansion state mask to be used in search */
CellUse *targetUse; /* Cell into which material is to be stuffed */ CellUse *targetUse) /* Cell into which material is to be stuffed */
{ {
int pNum; int pNum;
PlaneMask planeMask; PlaneMask planeMask;
@ -1404,15 +1404,15 @@ DBCellCopyPaint(scx, mask, xMask, targetUse)
*/ */
void void
DBCellCopyLabels(scx, mask, xMask, targetUse, pArea) DBCellCopyLabels(
SearchContext *scx; /* Describes root cell to search, area to SearchContext *scx, /* Describes root cell to search, area to
* copy, transform from root cell to coords * copy, transform from root cell to coords
* of targetUse. * of targetUse.
*/ */
TileTypeBitMask *mask; /* Only labels of these types are copied */ TileTypeBitMask *mask, /* Only labels of these types are copied */
int xMask; /* Expansion state mask to be used in search */ int xMask, /* Expansion state mask to be used in search */
CellUse *targetUse; /* Cell into which labels are to be stuffed */ CellUse *targetUse, /* Cell into which labels are to be stuffed */
Rect *pArea; /* If non-NULL, points to rectangle to be Rect *pArea) /* If non-NULL, points to rectangle to be
* filled in with bbox (in targetUse coords) * filled in with bbox (in targetUse coords)
* of all labels copied. Will be degenerate * of all labels copied. Will be degenerate
* if no labels are copied. * if no labels are copied.
@ -1467,10 +1467,10 @@ DBCellCopyLabels(scx, mask, xMask, targetUse, pArea)
***/ ***/
int int
dbCopyManhattanPaint(tile, dinfo, cxp) dbCopyManhattanPaint(
Tile *tile; /* Pointer to tile to copy */ Tile *tile, /* Pointer to tile to copy */
TileType dinfo; /* Split tile information */ TileType dinfo, /* Split tile information */
TreeContext *cxp; /* Context from DBTreeSrTiles */ TreeContext *cxp) /* Context from DBTreeSrTiles */
{ {
SearchContext *scx = cxp->tc_scx; SearchContext *scx = cxp->tc_scx;
struct copyAllArg *arg; struct copyAllArg *arg;
@ -1515,10 +1515,10 @@ dbCopyManhattanPaint(tile, dinfo, cxp)
***/ ***/
int int
dbCopyAllPaint(tile, dinfo, cxp) dbCopyAllPaint(
Tile *tile; /* Pointer to tile to copy */ Tile *tile, /* Pointer to tile to copy */
TileType dinfo; /* Split tile information */ TileType dinfo, /* Split tile information */
TreeContext *cxp; /* Context from DBTreeSrTiles */ TreeContext *cxp) /* Context from DBTreeSrTiles */
{ {
SearchContext *scx = cxp->tc_scx; SearchContext *scx = cxp->tc_scx;
struct copyAllArg *arg; struct copyAllArg *arg;
@ -1727,19 +1727,19 @@ splitdone:
*/ */
void void
DBCellCopyAllCells(scx, xMask, targetUse, pArea) DBCellCopyAllCells(
SearchContext *scx; /* Describes root cell to search, area to SearchContext *scx, /* Describes root cell to search, area to
* copy, transform from root cell to coords * copy, transform from root cell to coords
* of targetUse. * of targetUse.
*/ */
CellUse *targetUse; /* Cell into which material is to be stuffed */ int xMask, /* Expansion state mask to be used in
int xMask; /* Expansion state mask to be used in
* searching. Cells not expanded according * searching. Cells not expanded according
* to this mask are copied. To copy everything * to this mask are copied. To copy everything
* in the subtree under scx->scx_use without * in the subtree under scx->scx_use without
* regard to expansion, pass a mask of 0. * regard to expansion, pass a mask of 0.
*/ */
Rect *pArea; /* If non-NULL, points to a rectangle to be CellUse *targetUse, /* Cell into which material is to be stuffed */
Rect *pArea) /* If non-NULL, points to a rectangle to be
* filled in with bbox (in targetUse coords) * filled in with bbox (in targetUse coords)
* of all cells copied. Will be degenerate * of all cells copied. Will be degenerate
* if nothing was copied. * if nothing was copied.
@ -1788,13 +1788,13 @@ DBCellCopyAllCells(scx, xMask, targetUse, pArea)
*/ */
void void
DBCellCopyCells(scx, targetUse, pArea) DBCellCopyCells(
SearchContext *scx; /* Describes root cell to search, area to SearchContext *scx, /* Describes root cell to search, area to
* copy, transform from coords of * copy, transform from coords of
* scx->scx_use->cu_def to coords of targetUse. * scx->scx_use->cu_def to coords of targetUse.
*/ */
CellUse *targetUse; /* Cell into which material is to be stuffed */ CellUse *targetUse, /* Cell into which material is to be stuffed */
Rect *pArea; /* If non-NULL, points to rectangle to be Rect *pArea) /* If non-NULL, points to rectangle to be
* filled in with bbox (in targetUse coords) * filled in with bbox (in targetUse coords)
* of all cells copied. Will be degenerate * of all cells copied. Will be degenerate
* if nothing was copied. * if nothing was copied.
@ -1833,12 +1833,12 @@ DBCellCopyCells(scx, targetUse, pArea)
*/ */
int int
dbCellCopyCellsFunc(scx, arg) dbCellCopyCellsFunc(
SearchContext *scx; /* Pointer to search context containing SearchContext *scx, /* Pointer to search context containing
* ptr to cell use to be copied, * ptr to cell use to be copied,
* and transform to the target def. * and transform to the target def.
*/ */
struct copyAllArg *arg; /* Client data from caller */ struct copyAllArg *arg) /* Client data from caller */
{ {
CellUse *use, *newUse; CellUse *use, *newUse;
CellDef *def; CellDef *def;
@ -1957,8 +1957,8 @@ DBNewPaintTable(newTable))[NT][NT]
*/ */
IntProc IntProc
DBNewPaintPlane(newProc) DBNewPaintPlane(
int (*newProc)(); /* Address of new procedure */ int (*newProc)()) /* Address of new procedure */
{ {
int (*oldProc)() = dbCurPaintPlane; int (*oldProc)() = dbCurPaintPlane;
dbCurPaintPlane = newProc; dbCurPaintPlane = newProc;

View File

@ -60,7 +60,7 @@ bool dbWarnUniqueIds;
*/ */
extern CellDef *DBCellDefAlloc(); extern CellDef *DBCellDefAlloc();
extern int dbLinkFunc(); extern int dbLinkFunc();
extern void dbUsePrintInfo(); extern void dbUsePrintInfo(CellUse *StartUse, int who, bool dolist);
extern void DBsetUseIdHash(); extern void DBsetUseIdHash();
extern void DBUnLinkCell(); extern void DBUnLinkCell();
@ -92,10 +92,10 @@ extern void DBSetUseIdHash();
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
bool bool
DBCellRename(cellname, newname, doforce) DBCellRename(
char *cellname; char *cellname,
char *newname; char *newname,
bool doforce; bool doforce)
{ {
HashEntry *entry; HashEntry *entry;
CellDef *celldef; CellDef *celldef;
@ -189,8 +189,8 @@ DBCellRename(cellname, newname, doforce)
*/ */
void void
DBEnumerateTypes(rMask) DBEnumerateTypes(
TileTypeBitMask *rMask; TileTypeBitMask *rMask)
{ {
HashSearch hs; HashSearch hs;
HashEntry *entry; HashEntry *entry;
@ -225,9 +225,9 @@ DBEnumerateTypes(rMask)
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
bool bool
DBCellDelete(cellname, force) DBCellDelete(
char *cellname; char *cellname,
bool force; bool force)
{ {
HashEntry *entry; HashEntry *entry;
CellDef *celldef; CellDef *celldef;
@ -380,8 +380,8 @@ DBCellInit()
*/ */
char * char *
dbGetUseName(celluse) dbGetUseName(
CellUse *celluse; CellUse *celluse)
{ {
char *useID, *newID, xbuf[10], ybuf[10]; char *useID, *newID, xbuf[10], ybuf[10];
int arxl, aryl, arxh, aryh; int arxl, aryl, arxh, aryh;
@ -454,10 +454,10 @@ dbGetUseName(celluse)
*/ */
void void
dbCellPrintInfo(StartDef, who, dolist) dbCellPrintInfo(
CellDef *StartDef; CellDef *StartDef,
int who; int who,
bool dolist; bool dolist)
{ {
HashSearch hs; HashSearch hs;
HashEntry *entry; HashEntry *entry;
@ -639,9 +639,9 @@ dbCellPrintInfo(StartDef, who, dolist)
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
void void
DBTopPrint(mw, dolist) DBTopPrint(
MagWindow *mw; MagWindow *mw,
bool dolist; bool dolist)
{ {
CellDef *celldef; CellDef *celldef;
CellUse *celluse; CellUse *celluse;
@ -719,7 +719,9 @@ int strcmpbynum(const char *s1, const char *s2)
*/ */
int int
qcompare(const void *one, const void *two) qcompare(
const void *one,
const void *two)
{ {
int cval; int cval;
@ -751,10 +753,10 @@ qcompare(const void *one, const void *two)
*/ */
void void
DBCellPrint(CellName, who, dolist) DBCellPrint(
char *CellName; char *CellName,
int who; int who,
bool dolist; bool dolist)
{ {
int found, numcells; int found, numcells;
HashSearch hs; HashSearch hs;
@ -965,10 +967,10 @@ DBCellPrint(CellName, who, dolist)
*/ */
void void
dbUsePrintInfo(StartUse, who, dolist) dbUsePrintInfo(
CellUse *StartUse; CellUse *StartUse,
int who; int who,
bool dolist; bool dolist)
{ {
CellDef *celldef; CellDef *celldef;
CellUse *celluse; CellUse *celluse;
@ -1132,10 +1134,10 @@ dbUsePrintInfo(StartUse, who, dolist)
*/ */
void void
DBUsePrint(CellName, who, dolist) DBUsePrint(
char *CellName; char *CellName,
int who; int who,
bool dolist; bool dolist)
{ {
int found; int found;
HashSearch hs; HashSearch hs;
@ -1230,9 +1232,9 @@ DBUsePrint(CellName, who, dolist)
} }
int int
dbCellUsePrintFunc(cellUse, dolist) dbCellUsePrintFunc(
CellUse *cellUse; CellUse *cellUse,
bool *dolist; bool *dolist)
{ {
char *cu_name; char *cu_name;
@ -1257,11 +1259,11 @@ dbCellUsePrintFunc(cellUse, dolist)
*/ */
int int
dbLockUseFunc(selUse, use, transform, data) dbLockUseFunc(
CellUse *selUse; /* Use from selection cell */ CellUse *selUse, /* Use from selection cell */
CellUse *use; /* Use from layout corresponding to selection */ CellUse *use, /* Use from layout corresponding to selection */
Transform *transform; Transform *transform,
ClientData data; ClientData data)
{ {
bool dolock = *((bool *)data); bool dolock = *((bool *)data);
@ -1309,9 +1311,9 @@ dbLockUseFunc(selUse, use, transform, data)
*/ */
void void
DBLockUse(UseName, bval) DBLockUse(
char *UseName; char *UseName,
bool bval; bool bval)
{ {
int found; int found;
HashSearch hs; HashSearch hs;
@ -1388,9 +1390,9 @@ DBLockUse(UseName, bval)
*/ */
void void
DBOrientUse(UseName, dodef) DBOrientUse(
char *UseName; char *UseName,
bool dodef; bool dodef)
{ {
int found; int found;
HashSearch hs; HashSearch hs;
@ -1453,11 +1455,11 @@ enum def_orient {ORIENT_NORTH, ORIENT_SOUTH, ORIENT_EAST, ORIENT_WEST,
ORIENT_FLIPPED_WEST}; ORIENT_FLIPPED_WEST};
int int
dbOrientUseFunc(selUse, use, transform, data) dbOrientUseFunc(
CellUse *selUse; /* Use from selection cell */ CellUse *selUse, /* Use from selection cell */
CellUse *use; /* Use from layout corresponding to selection */ CellUse *use, /* Use from layout corresponding to selection */
Transform *transform; Transform *transform,
ClientData data; ClientData data)
{ {
bool *dodef = (bool *)data; bool *dodef = (bool *)data;
int orient; int orient;
@ -1554,9 +1556,9 @@ dbOrientUseFunc(selUse, use, transform, data)
*/ */
void void
DBAbutmentUse(UseName, dolist) DBAbutmentUse(
char *UseName; char *UseName,
bool dolist; bool dolist)
{ {
int found; int found;
HashSearch hs; HashSearch hs;
@ -1611,11 +1613,11 @@ DBAbutmentUse(UseName, dolist)
*/ */
int int
dbAbutmentUseFunc(selUse, use, transform, data) dbAbutmentUseFunc(
CellUse *selUse; /* Use from selection cell */ CellUse *selUse, /* Use from selection cell */
CellUse *use; /* Use from layout corresponding to selection */ CellUse *use, /* Use from layout corresponding to selection */
Transform *transform; Transform *transform,
ClientData data; ClientData data)
{ {
Rect bbox, refbox; Rect bbox, refbox;
Transform *trans; Transform *trans;
@ -1704,8 +1706,8 @@ dbAbutmentUseFunc(selUse, use, transform, data)
*/ */
CellDef * CellDef *
DBCellLookDef(cellName) DBCellLookDef(
char *cellName; char *cellName)
{ {
HashEntry *entry; HashEntry *entry;
@ -1744,8 +1746,8 @@ DBCellLookDef(cellName)
*/ */
CellDef * CellDef *
DBCellNewDef(cellName) DBCellNewDef(
char *cellName; /* Name by which the cell is known */ char *cellName) /* Name by which the cell is known */
{ {
CellDef *cellDef; CellDef *cellDef;
HashEntry *entry; HashEntry *entry;
@ -1849,9 +1851,9 @@ DBCellDefAlloc()
*/ */
CellUse * CellUse *
DBCellNewUse(cellDef, useName) DBCellNewUse(
CellDef *cellDef; /* Pointer to definition of the cell */ CellDef *cellDef, /* Pointer to definition of the cell */
char *useName; /* Pointer to use identifier for the cell. This may char *useName) /* Pointer to use identifier for the cell. This may
* be NULL, in which case a unique use identifier is * be NULL, in which case a unique use identifier is
* generated automatically when the cell use is linked * generated automatically when the cell use is linked
* into a parent def. * into a parent def.
@ -1905,9 +1907,9 @@ DBCellNewUse(cellDef, useName)
*/ */
bool bool
DBCellRenameDef(cellDef, newName) DBCellRenameDef(
CellDef *cellDef; /* Pointer to CellDef being renamed */ CellDef *cellDef, /* Pointer to CellDef being renamed */
char *newName; /* Pointer to new name */ char *newName) /* Pointer to new name */
{ {
HashEntry *oldEntry, *newEntry; HashEntry *oldEntry, *newEntry;
CellUse *parent; CellUse *parent;
@ -1951,8 +1953,8 @@ DBCellRenameDef(cellDef, newName)
*/ */
bool bool
DBCellDeleteDef(cellDef) DBCellDeleteDef(
CellDef *cellDef; /* Pointer to CellDef to be deleted */ CellDef *cellDef) /* Pointer to CellDef to be deleted */
{ {
HashEntry *entry; HashEntry *entry;
@ -1995,9 +1997,8 @@ DBCellDeleteDef(cellDef)
*/ */
void void
DBCellDefFree(cellDef) DBCellDefFree(
CellDef *cellDef; CellDef *cellDef)
{ {
int pNum; int pNum;
Label *lab; Label *lab;
@ -2058,8 +2059,8 @@ DBCellDefFree(cellDef)
*/ */
bool bool
DBCellDeleteUse(cellUse) DBCellDeleteUse(
CellUse *cellUse; /* Pointer to CellUse to be deleted */ CellUse *cellUse) /* Pointer to CellUse to be deleted */
{ {
CellDef *cellDef; CellDef *cellDef;
CellUse *useptr; CellUse *useptr;
@ -2120,14 +2121,14 @@ DBCellDeleteUse(cellUse)
*/ */
int int
DBCellSrDefs(pattern, func, cdata) DBCellSrDefs(
int pattern; /* Used for selecting cell definitions. If any int pattern, /* Used for selecting cell definitions. If any
* of the bits in the pattern are in a def->cd_flags, * of the bits in the pattern are in a def->cd_flags,
* or if pattern is 0, the user-supplied function * or if pattern is 0, the user-supplied function
* is invoked. * is invoked.
*/ */
int (*func)(); /* Function to be applied to each matching CellDef */ int (*func)(), /* Function to be applied to each matching CellDef */
ClientData cdata; /* Client data also passed to function */ ClientData cdata) /* Client data also passed to function */
{ {
HashSearch hs; HashSearch hs;
HashEntry *he; HashEntry *he;
@ -2184,9 +2185,9 @@ DBCellSrDefs(pattern, func, cdata)
*/ */
bool bool
DBLinkCell(use, parentDef) DBLinkCell(
CellUse *use; CellUse *use,
CellDef *parentDef; CellDef *parentDef)
{ {
char useId[100], *lastName; char useId[100], *lastName;
HashEntry *he; HashEntry *he;
@ -2248,9 +2249,9 @@ DBLinkCell(use, parentDef)
*/ */
int int
dbLinkFunc(cellUse, defname) dbLinkFunc(
CellUse *cellUse; CellUse *cellUse,
char *defname; char *defname)
{ {
char *usep = cellUse->cu_id; char *usep = cellUse->cu_id;
@ -2294,9 +2295,9 @@ dbLinkFunc(cellUse, defname)
*/ */
bool bool
DBReLinkCell(cellUse, newName) DBReLinkCell(
CellUse *cellUse; CellUse *cellUse,
char *newName; char *newName)
{ {
if (cellUse->cu_id && strcmp(cellUse->cu_id, newName) == 0) if (cellUse->cu_id && strcmp(cellUse->cu_id, newName) == 0)
return (TRUE); return (TRUE);
@ -2337,9 +2338,9 @@ DBReLinkCell(cellUse, newName)
*/ */
CellUse * CellUse *
DBFindUse(id, parentDef) DBFindUse(
char *id; char *id,
CellDef *parentDef; CellDef *parentDef)
{ {
HashEntry *he; HashEntry *he;
char *delimit; char *delimit;
@ -2388,9 +2389,9 @@ DBFindUse(id, parentDef)
*/ */
void void
DBGenerateUniqueIds(def, warn) DBGenerateUniqueIds(
CellDef *def; CellDef *def,
bool warn; /* If TRUE, warn user when we assign new ids */ bool warn) /* If TRUE, warn user when we assign new ids */
{ {
int dbFindNamesFunc(); int dbFindNamesFunc();
int dbGenerateUniqueIdsFunc(); int dbGenerateUniqueIdsFunc();
@ -2431,9 +2432,9 @@ DBGenerateUniqueIds(def, warn)
*/ */
void void
DBSelectionUniqueIds(selDef, rootDef) DBSelectionUniqueIds(
CellDef *selDef; /* Should be Select2Def */ CellDef *selDef, /* Should be Select2Def */
CellDef *rootDef; /* Should be EditRootDef */ CellDef *rootDef) /* Should be EditRootDef */
{ {
int dbFindNamesFunc(); int dbFindNamesFunc();
int dbGenerateUniqueIdsFunc(); int dbGenerateUniqueIdsFunc();
@ -2473,9 +2474,9 @@ DBSelectionUniqueIds(selDef, rootDef)
*/ */
int int
dbFindNamesFunc(use, parentDef) dbFindNamesFunc(
CellUse *use; CellUse *use,
CellDef *parentDef; CellDef *parentDef)
{ {
HashEntry *he; HashEntry *he;
@ -2528,9 +2529,9 @@ dbFindNamesFunc(use, parentDef)
*/ */
int int
dbGenerateUniqueIdsFunc(use, parentDef) dbGenerateUniqueIdsFunc(
CellUse *use; CellUse *use,
CellDef *parentDef; CellDef *parentDef)
{ {
HashEntry *hedef, *hename; HashEntry *hedef, *hename;
int suffix; int suffix;
@ -2577,9 +2578,9 @@ setHash:
*/ */
void void
DBSetUseIdHash(use, parentDef) DBSetUseIdHash(
CellUse *use; CellUse *use,
CellDef *parentDef; CellDef *parentDef)
{ {
HashEntry *he; HashEntry *he;
@ -2605,9 +2606,9 @@ DBSetUseIdHash(use, parentDef)
*/ */
void void
DBUnLinkCell(use, parentDef) DBUnLinkCell(
CellUse *use; CellUse *use,
CellDef *parentDef; CellDef *parentDef)
{ {
HashEntry *he; HashEntry *he;
@ -2636,10 +2637,10 @@ DBUnLinkCell(use, parentDef)
*/ */
void void
DBNewYank(yname, pyuse, pydef) DBNewYank(
char *yname; /* Name of yank buffer */ char *yname, /* Name of yank buffer */
CellUse **pyuse; /* Pointer to new cell use is stored in *pyuse */ CellUse **pyuse, /* Pointer to new cell use is stored in *pyuse */
CellDef **pydef; /* Similarly for def */ CellDef **pydef) /* Similarly for def */
{ {
*pydef = DBCellLookDef(yname); *pydef = DBCellLookDef(yname);
if (*pydef == (CellDef *) NULL) if (*pydef == (CellDef *) NULL)

View File

@ -83,7 +83,11 @@ struct seeTypesArg
*/ */
int int
DBSrCellPlaneArea(BPlane *plane, const Rect *rect, int (*func)(), ClientData arg) DBSrCellPlaneArea(
BPlane *plane,
const Rect *rect,
int (*func)(),
ClientData arg)
{ {
BPEnum sbpe; BPEnum sbpe;
BPEnum *bpe; BPEnum *bpe;
@ -152,22 +156,22 @@ DBSrCellPlaneArea(BPlane *plane, const Rect *rect, int (*func)(), ClientData arg
*/ */
int int
DBTreeSrTiles(scx, mask, xMask, func, cdarg) DBTreeSrTiles(
SearchContext *scx; /* Pointer to search context specifying SearchContext *scx, /* Pointer to search context specifying
* a cell use to search, an area in the * a cell use to search, an area in the
* coordinates of the cell's def, and a * coordinates of the cell's def, and a
* transform back to "root" coordinates. * transform back to "root" coordinates.
*/ */
TileTypeBitMask *mask; /* Only tiles with a type for which TileTypeBitMask *mask, /* Only tiles with a type for which
* a bit in this mask is on are processed. * a bit in this mask is on are processed.
*/ */
int xMask; /* All subcells are visited recursively int xMask, /* All subcells are visited recursively
* until we encounter uses whose flags, * until we encounter uses whose flags,
* when anded with xMask, are not * when anded with xMask, are not
* equal to xMask. * equal to xMask.
*/ */
int (*func)(); /* Function to apply at each qualifying tile */ int (*func)(), /* Function to apply at each qualifying tile */
ClientData cdarg; /* Client data for above function */ ClientData cdarg) /* Client data for above function */
{ {
int dbCellPlaneSrFunc(); int dbCellPlaneSrFunc();
TreeFilter filter; TreeFilter filter;
@ -191,25 +195,25 @@ DBTreeSrTiles(scx, mask, xMask, func, cdarg)
*/ */
int int
DBTreeSrNMTiles(scx, dinfo, mask, xMask, func, cdarg) DBTreeSrNMTiles(
SearchContext *scx; /* Pointer to search context specifying SearchContext *scx, /* Pointer to search context specifying
* a cell use to search, an area in the * a cell use to search, an area in the
* coordinates of the cell's def, and a * coordinates of the cell's def, and a
* transform back to "root" coordinates. * transform back to "root" coordinates.
*/ */
TileType dinfo; /* Type containing information about the TileType dinfo, /* Type containing information about the
* diagonal area to search. * diagonal area to search.
*/ */
TileTypeBitMask *mask; /* Only tiles with a type for which TileTypeBitMask *mask, /* Only tiles with a type for which
* a bit in this mask is on are processed. * a bit in this mask is on are processed.
*/ */
int xMask; /* All subcells are visited recursively int xMask, /* All subcells are visited recursively
* until we encounter uses whose flags, * until we encounter uses whose flags,
* when anded with xMask, are not * when anded with xMask, are not
* equal to xMask. * equal to xMask.
*/ */
int (*func)(); /* Function to apply at each qualifying tile */ int (*func)(), /* Function to apply at each qualifying tile */
ClientData cdarg; /* Client data for above function */ ClientData cdarg) /* Client data for above function */
{ {
int dbCellPlaneSrFunc(); int dbCellPlaneSrFunc();
TreeFilter filter; TreeFilter filter;
@ -233,9 +237,9 @@ DBTreeSrNMTiles(scx, dinfo, mask, xMask, func, cdarg)
*/ */
int int
dbCellPlaneSrFunc(scx, fp) dbCellPlaneSrFunc(
SearchContext *scx; SearchContext *scx,
TreeFilter *fp; TreeFilter *fp)
{ {
TreeContext context; TreeContext context;
CellDef *def = scx->scx_use->cu_def; CellDef *def = scx->scx_use->cu_def;
@ -311,22 +315,22 @@ dbCellPlaneSrFunc(scx, fp)
*/ */
int int
DBTreeSrUniqueTiles(scx, mask, xMask, func, cdarg) DBTreeSrUniqueTiles(
SearchContext *scx; /* Pointer to search context specifying SearchContext *scx, /* Pointer to search context specifying
* a cell use to search, an area in the * a cell use to search, an area in the
* coordinates of the cell's def, and a * coordinates of the cell's def, and a
* transform back to "root" coordinates. * transform back to "root" coordinates.
*/ */
TileTypeBitMask *mask; /* Only tiles with a type for which TileTypeBitMask *mask, /* Only tiles with a type for which
* a bit in this mask is on are processed. * a bit in this mask is on are processed.
*/ */
int xMask; /* All subcells are visited recursively int xMask, /* All subcells are visited recursively
* until we encounter uses whose flags, * until we encounter uses whose flags,
* when anded with xMask, are not * when anded with xMask, are not
* equal to xMask. * equal to xMask.
*/ */
int (*func)(); /* Function to apply at each qualifying tile */ int (*func)(), /* Function to apply at each qualifying tile */
ClientData cdarg; /* Client data for above function */ ClientData cdarg) /* Client data for above function */
{ {
int dbCellPlaneSrFunc(); int dbCellPlaneSrFunc();
TreeFilter filter; TreeFilter filter;
@ -352,9 +356,9 @@ DBTreeSrUniqueTiles(scx, mask, xMask, func, cdarg)
*/ */
int int
dbCellUniqueTileSrFunc(scx, fp) dbCellUniqueTileSrFunc(
SearchContext *scx; SearchContext *scx,
TreeFilter *fp; TreeFilter *fp)
{ {
TreeContext context; TreeContext context;
TileTypeBitMask uMask; TileTypeBitMask uMask;
@ -448,22 +452,22 @@ dbCellUniqueTileSrFunc(scx, fp)
*----------------------------------------------------------------------------- *-----------------------------------------------------------------------------
*/ */
int int
DBNoTreeSrTiles(scx, mask, xMask, func, cdarg) DBNoTreeSrTiles(
SearchContext *scx; /* Pointer to search context specifying SearchContext *scx, /* Pointer to search context specifying
* a cell use to search, an area in the * a cell use to search, an area in the
* coordinates of the cell's def, and a * coordinates of the cell's def, and a
* transform back to "root" coordinates. * transform back to "root" coordinates.
*/ */
TileTypeBitMask *mask; /* Only tiles with a type for which TileTypeBitMask *mask, /* Only tiles with a type for which
* a bit in this mask is on are processed. * a bit in this mask is on are processed.
*/ */
int xMask; /* All subcells are visited recursively int xMask, /* All subcells are visited recursively
* until we encounter uses whose flags, * until we encounter uses whose flags,
* when anded with xMask, are not * when anded with xMask, are not
* equal to xMask. * equal to xMask.
*/ */
int (*func)(); /* Function to apply at each qualifying tile */ int (*func)(), /* Function to apply at each qualifying tile */
ClientData cdarg; /* Client data for above function */ ClientData cdarg) /* Client data for above function */
{ {
TreeContext context; TreeContext context;
TreeFilter filter; TreeFilter filter;
@ -544,34 +548,34 @@ DBNoTreeSrTiles(scx, mask, xMask, func, cdarg)
*/ */
int int
DBTreeSrLabels(scx, mask, xMask, tpath, flags, func, cdarg) DBTreeSrLabels(
SearchContext *scx; /* Pointer to search context specifying SearchContext *scx, /* Pointer to search context specifying
* a cell use to search, an area in the * a cell use to search, an area in the
* coordinates of the cell's def, and a * coordinates of the cell's def, and a
* transform back to "root" coordinates. * transform back to "root" coordinates.
* The area may have zero size. Labels * The area may have zero size. Labels
* need only touch the area. * need only touch the area.
*/ */
TileTypeBitMask * mask; /* Only visit labels attached to these types */ TileTypeBitMask * mask, /* Only visit labels attached to these types */
int xMask; /* All subcells are visited recursively int xMask, /* All subcells are visited recursively
* until we encounter uses whose flags, * until we encounter uses whose flags,
* when anded with xMask, are not * when anded with xMask, are not
* equal to xMask. * equal to xMask.
*/ */
TerminalPath *tpath; /* Pointer to a structure describing a TerminalPath *tpath, /* Pointer to a structure describing a
* partially filled in terminal pathname. * partially filled in terminal pathname.
* If this pointer is NULL, we don't bother * If this pointer is NULL, we don't bother
* filling it in further; otherwise, we add * filling it in further; otherwise, we add
* new pathname components as we encounter * new pathname components as we encounter
* them. * them.
*/ */
unsigned char flags; /* Flags to denote whether labels should be unsigned char flags, /* Flags to denote whether labels should be
* searched according to the area of the * searched according to the area of the
* attachment, the area of the label itself, * attachment, the area of the label itself,
* or both. * or both.
*/ */
int (*func)(); /* Function to apply at each qualifying tile */ int (*func)(), /* Function to apply at each qualifying tile */
ClientData cdarg; /* Client data for above function */ ClientData cdarg) /* Client data for above function */
{ {
SearchContext scx2; SearchContext scx2;
Label *lab; Label *lab;
@ -696,9 +700,9 @@ DBTreeSrLabels(scx, mask, xMask, tpath, flags, func, cdarg)
*/ */
int int
dbCellLabelSrFunc(scx, fp) dbCellLabelSrFunc(
SearchContext *scx; SearchContext *scx,
TreeFilter *fp; TreeFilter *fp)
{ {
Label *lab; Label *lab;
Rect *r = &scx->scx_area; Rect *r = &scx->scx_area;
@ -822,20 +826,20 @@ cleanup:
*/ */
int int
DBTreeSrCells(scx, xMask, func, cdarg) DBTreeSrCells(
SearchContext *scx; /* Pointer to search context specifying a cell use to SearchContext *scx, /* Pointer to search context specifying a cell use to
* search, an area in the coordinates of the cell's * search, an area in the coordinates of the cell's
* def, and a transform back to "root" coordinates. * def, and a transform back to "root" coordinates.
*/ */
int xMask; /* All subcells are visited recursively until we int xMask, /* All subcells are visited recursively until we
* encounter uses whose flags, when anded with * encounter uses whose flags, when anded with
* xMask, are not equal to xMask. Func is called * xMask, are not equal to xMask. Func is called
* for these cells. A zero mask means all cells in * for these cells. A zero mask means all cells in
* the root use are considered not to be expanded, * the root use are considered not to be expanded,
* and hence are passed to func. * and hence are passed to func.
*/ */
int (*func)(); /* Function to apply to each qualifying cell */ int (*func)(), /* Function to apply to each qualifying cell */
ClientData cdarg; /* Client data for above function */ ClientData cdarg) /* Client data for above function */
{ {
int dbTreeCellSrFunc(); int dbTreeCellSrFunc();
CellUse *cellUse = scx->scx_use; CellUse *cellUse = scx->scx_use;
@ -868,13 +872,13 @@ DBTreeSrCells(scx, xMask, func, cdarg)
/*ARGSUSED*/ /*ARGSUSED*/
int int
dbTreeCellSrFunc(scx, fp) dbTreeCellSrFunc(
SearchContext *scx; /* Pointer to context containing a SearchContext *scx, /* Pointer to context containing a
* CellUse and a transform from coord- * CellUse and a transform from coord-
* inates of the def of the use to the * inates of the def of the use to the
* "root" of the search. * "root" of the search.
*/ */
TreeFilter *fp; TreeFilter *fp)
{ {
CellUse *use = scx->scx_use; CellUse *use = scx->scx_use;
int result; int result;
@ -924,11 +928,11 @@ dbTreeCellSrFunc(scx, fp)
*/ */
void void
DBSeeTypesAll(rootUse, rootRect, xMask, mask) DBSeeTypesAll(
CellUse *rootUse; /* CellUse from which to begin search */ CellUse *rootUse, /* CellUse from which to begin search */
Rect *rootRect; /* Clipping rectangle in coordinates of CellUse's def */ Rect *rootRect, /* Clipping rectangle in coordinates of CellUse's def */
int xMask; /* Expansion mask for DBTreeSrTiles() */ int xMask, /* Expansion mask for DBTreeSrTiles() */
TileTypeBitMask *mask; /* Mask to set */ TileTypeBitMask *mask) /* Mask to set */
{ {
int dbSeeTypesAllSrFunc(); int dbSeeTypesAllSrFunc();
SearchContext scontext; SearchContext scontext;
@ -949,10 +953,10 @@ DBSeeTypesAll(rootUse, rootRect, xMask, mask)
*/ */
int int
dbSeeTypesAllSrFunc(tile, dinfo, cxp) dbSeeTypesAllSrFunc(
Tile *tile; Tile *tile,
TileType dinfo; TileType dinfo,
TreeContext *cxp; TreeContext *cxp)
{ {
Rect tileRect; Rect tileRect;
TileTypeBitMask *mask = (TileTypeBitMask *) cxp->tc_filter->tf_arg; TileTypeBitMask *mask = (TileTypeBitMask *) cxp->tc_filter->tf_arg;
@ -1002,15 +1006,15 @@ dbSeeTypesAllSrFunc(tile, dinfo, cxp)
*/ */
int int
DBSrRoots(baseDef, transform, func, cdarg) DBSrRoots(
CellDef *baseDef; /* Base CellDef, all of whose ancestors are CellDef *baseDef, /* Base CellDef, all of whose ancestors are
* searched for. * searched for.
*/ */
Transform *transform; /* Transform from original baseDef to current Transform *transform, /* Transform from original baseDef to current
* baseDef. * baseDef.
*/ */
int (*func)(); /* Function to apply at each root cellUse */ int (*func)(), /* Function to apply at each root cellUse */
ClientData cdarg; /* Client data for above function */ ClientData cdarg) /* Client data for above function */
{ {
CellUse *parentUse; CellUse *parentUse;
int xoff, yoff, x, y; int xoff, yoff, x, y;
@ -1065,9 +1069,9 @@ DBSrRoots(baseDef, transform, func, cdarg)
*/ */
bool bool
DBIsAncestor(cellDef1, cellDef2) DBIsAncestor(
CellDef *cellDef1; /* Potential ancestor */ CellDef *cellDef1, /* Potential ancestor */
CellDef *cellDef2; /* Potential descendant -- this is where we CellDef *cellDef2) /* Potential descendant -- this is where we
* start the search. * start the search.
*/ */
{ {
@ -1128,15 +1132,15 @@ DBIsAncestor(cellDef1, cellDef2)
*/ */
int int
DBCellSrArea(scx, func, cdarg) DBCellSrArea(
SearchContext *scx; SearchContext *scx,
/* Pointer to search context specifying a cell use to /* Pointer to search context specifying a cell use to
* search, an area in the coordinates of the cell's * search, an area in the coordinates of the cell's
* def, and a transform back to "root" coordinates. * def, and a transform back to "root" coordinates.
* The area may have zero size. * The area may have zero size.
*/ */
int (*func)(); /* Function to apply at every tile found */ int (*func)(), /* Function to apply at every tile found */
ClientData cdarg; /* Argument to pass to function */ ClientData cdarg) /* Argument to pass to function */
{ {
TreeFilter filter; TreeFilter filter;
TreeContext context; TreeContext context;
@ -1176,9 +1180,9 @@ DBCellSrArea(scx, func, cdarg)
*/ */
int int
dbCellSrFunc(use, cxp) dbCellSrFunc(
CellUse *use; CellUse *use,
TreeContext *cxp; TreeContext *cxp)
{ {
TreeFilter *fp = cxp->tc_filter; TreeFilter *fp = cxp->tc_filter;
SearchContext *scx = cxp->tc_scx; SearchContext *scx = cxp->tc_scx;
@ -1260,10 +1264,10 @@ dbCellSrFunc(use, cxp)
*/ */
int int
DBCellEnum(cellDef, func, cdarg) DBCellEnum(
CellDef *cellDef; /* Def whose subcell plane is to be searched */ CellDef *cellDef, /* Def whose subcell plane is to be searched */
int (*func)(); /* Function to apply at every tile found */ int (*func)(), /* Function to apply at every tile found */
ClientData cdarg; /* Argument to pass to function */ ClientData cdarg) /* Argument to pass to function */
{ {
TreeFilter filter; TreeFilter filter;
int dbEnumFunc(); int dbEnumFunc();
@ -1299,9 +1303,9 @@ DBCellEnum(cellDef, func, cdarg)
*/ */
int int
dbEnumFunc(use, fp) dbEnumFunc(
CellUse *use; CellUse *use,
TreeFilter *fp; TreeFilter *fp)
{ {
Rect *bbox; Rect *bbox;
@ -1345,17 +1349,17 @@ dbEnumFunc(use, fp)
*/ */
int int
DBArraySr(use, searchArea, func, cdarg) DBArraySr(
CellUse *use; /* CellUse of array to be searched. */ CellUse *use, /* CellUse of array to be searched. */
Rect *searchArea; /* Area of interest, given in the Rect *searchArea, /* Area of interest, given in the
* coordinates of the parent (i.e. the * coordinates of the parent (i.e. the
* cell use, not def). Must overlap * cell use, not def). Must overlap
* the array bounding box. * the array bounding box.
*/ */
int (*func)(); /* Function to apply for each overlapping int (*func)(), /* Function to apply for each overlapping
* array element. * array element.
*/ */
ClientData cdarg; /* Client-specific info to give to func. */ ClientData cdarg) /* Client-specific info to give to func. */
{ {
int xlo, xhi, ylo, yhi, x, y; int xlo, xhi, ylo, yhi, x, y;
int xsep, ysep, xbase, ybase; int xsep, ysep, xbase, ybase;
@ -1416,9 +1420,10 @@ typedef struct LCU1 /* A linked celluse record */
*/ */
bool bool
DBMovePoint(p, origx, origy) DBMovePoint(
Point *p; Point *p,
int origx, origy; int origx,
int origy)
{ {
int result = FALSE; int result = FALSE;
if ((p->p_x < (INFINITY - 2)) && (p->p_x > (MINFINITY + 2))) if ((p->p_x < (INFINITY - 2)) && (p->p_x > (MINFINITY + 2)))
@ -1454,8 +1459,10 @@ DBMovePoint(p, origx, origy)
*/ */
bool bool
DBScaleValue(v, n, d) DBScaleValue(
int *v, n, d; int *v,
int n,
int d)
{ {
dlong llv = (dlong)(*v); dlong llv = (dlong)(*v);
@ -1498,9 +1505,10 @@ DBScaleValue(v, n, d)
*/ */
bool bool
DBScalePoint(p, n, d) DBScalePoint(
Point *p; Point *p,
int n, d; int n,
int d)
{ {
bool result; bool result;
result = DBScaleValue(&p->p_x, n, d); result = DBScaleValue(&p->p_x, n, d);
@ -1529,8 +1537,9 @@ DBScalePoint(p, n, d)
*/ */
void void
DBScaleEverything(scalen, scaled) DBScaleEverything(
int scalen, scaled; int scalen,
int scaled)
{ {
void ToolScaleBox(); void ToolScaleBox();
@ -1609,11 +1618,13 @@ struct moveArg {
*/ */
bool bool
dbScalePlane(oldplane, newplane, pnum, scalen, scaled, doCIF) dbScalePlane(
Plane *oldplane, *newplane; Plane *oldplane,
int pnum; Plane *newplane,
int scalen, scaled; int pnum,
bool doCIF; int scalen,
int scaled,
bool doCIF)
{ {
int dbTileScaleFunc(); /* forward declaration */ int dbTileScaleFunc(); /* forward declaration */
struct scaleArg arg; struct scaleArg arg;
@ -1643,10 +1654,10 @@ dbScalePlane(oldplane, newplane, pnum, scalen, scaled, doCIF)
*/ */
int int
dbTileScaleFunc(tile, dinfo, scvals) dbTileScaleFunc(
Tile *tile; Tile *tile,
TileType dinfo; TileType dinfo,
struct scaleArg *scvals; struct scaleArg *scvals)
{ {
TileType type; TileType type;
Rect targetRect; Rect targetRect;
@ -1694,10 +1705,12 @@ dbTileScaleFunc(tile, dinfo, scvals)
*/ */
bool bool
dbMovePlane(oldplane, newplane, pnum, origx, origy) dbMovePlane(
Plane *oldplane, *newplane; Plane *oldplane,
int pnum; Plane *newplane,
int origx, origy; int pnum,
int origx,
int origy)
{ {
int dbTileMoveFunc(); /* forward declaration */ int dbTileMoveFunc(); /* forward declaration */
struct moveArg arg; struct moveArg arg;
@ -1726,10 +1739,10 @@ dbMovePlane(oldplane, newplane, pnum, origx, origy)
*/ */
int int
dbTileMoveFunc(tile, dinfo, mvvals) dbTileMoveFunc(
Tile *tile; Tile *tile,
TileType dinfo; TileType dinfo,
struct moveArg *mvvals; struct moveArg *mvvals)
{ {
TileType type; TileType type;
Rect targetRect; Rect targetRect;
@ -1774,10 +1787,10 @@ dbTileMoveFunc(tile, dinfo, mvvals)
*/ */
int int
DBSrCellUses(cellDef, func, arg) DBSrCellUses(
CellDef *cellDef; /* Pointer to CellDef to search for uses. */ CellDef *cellDef, /* Pointer to CellDef to search for uses. */
int (*func)(); /* Function to apply for each cell use. */ int (*func)(), /* Function to apply for each cell use. */
ClientData arg; /* data to be passed to function func(). */ ClientData arg) /* data to be passed to function func(). */
{ {
int dbCellUseEnumFunc(); int dbCellUseEnumFunc();
int retval; int retval;
@ -1952,11 +1965,12 @@ int dbMoveProp(name, proprec, cps)
*/ */
int int
dbScaleCell(cellDef, scalen, scaled) dbScaleCell(
CellDef *cellDef; /* Pointer to CellDef to be saved. This def might CellDef *cellDef, /* Pointer to CellDef to be saved. This def might
* be an internal buffer; if so, we ignore it. * be an internal buffer; if so, we ignore it.
*/ */
int scalen, scaled; /* scale numerator and denominator. */ int scalen,
int scaled)
{ {
int dbCellScaleFunc(), dbCellUseEnumFunc(); int dbCellScaleFunc(), dbCellUseEnumFunc();
Label *lab; Label *lab;
@ -2110,9 +2124,9 @@ donecell:
*/ */
int int
dbCellDefEnumFunc(cellDef, arg) dbCellDefEnumFunc(
CellDef *cellDef; CellDef *cellDef,
LinkedCellDef **arg; LinkedCellDef **arg)
{ {
LinkedCellDef *lcd; LinkedCellDef *lcd;
@ -2137,9 +2151,9 @@ dbCellDefEnumFunc(cellDef, arg)
*/ */
int int
dbCellUseEnumFunc(cellUse, arg) dbCellUseEnumFunc(
CellUse *cellUse; CellUse *cellUse,
LinkedCellUse **arg; LinkedCellUse **arg)
{ {
LinkedCellUse *lcu; LinkedCellUse *lcu;
@ -2169,11 +2183,12 @@ dbCellUseEnumFunc(cellUse, arg)
*/ */
int int
DBMoveCell(cellDef, origx, origy) DBMoveCell(
CellDef *cellDef; /* Pointer to CellDef to be saved. This def might CellDef *cellDef, /* Pointer to CellDef to be saved. This def might
* be an internal buffer; if so, we ignore it. * be an internal buffer; if so, we ignore it.
*/ */
int origx, origy; /* Internal unit coordinates which will become the new origin */ int origx,
int origy)
{ {
int dbCellTileEnumFunc(), dbCellUseEnumFunc(); int dbCellTileEnumFunc(), dbCellUseEnumFunc();
Label *lab; Label *lab;

View File

@ -60,9 +60,9 @@ extern void dbSetPlaneTile();
*/ */
bool bool
DBDescendSubcell(use, xMask) DBDescendSubcell(
CellUse *use; CellUse *use,
unsigned int xMask; unsigned int xMask)
{ {
bool propfound; bool propfound;
@ -125,9 +125,9 @@ DBDescendSubcell(use, xMask)
*/ */
void void
DBCellCopyDefBody(sourceDef, destDef) DBCellCopyDefBody(
CellDef *sourceDef; /* Pointer to CellDef copied from */ CellDef *sourceDef, /* Pointer to CellDef copied from */
CellDef *destDef; /* Pointer to CellDef copied to */ CellDef *destDef) /* Pointer to CellDef copied to */
{ {
int i; int i;
int dbCopyDefFunc(); int dbCopyDefFunc();
@ -153,9 +153,9 @@ DBCellCopyDefBody(sourceDef, destDef)
} }
int int
dbCopyDefFunc(use, def) dbCopyDefFunc(
CellUse *use; /* Subcell use. */ CellUse *use, /* Subcell use. */
CellDef *def; /* Set parent pointer in each use to this. */ CellDef *def) /* Set parent pointer in each use to this. */
{ {
use->cu_parent = def; use->cu_parent = def;
return 0; return 0;
@ -182,8 +182,8 @@ dbCopyDefFunc(use, def)
*/ */
void void
DBCellClearDef(cellDef) DBCellClearDef(
CellDef *cellDef; /* Pointer to CellDef to be deleted */ CellDef *cellDef) /* Pointer to CellDef to be deleted */
{ {
int pNum; int pNum;
Plane *plane; Plane *plane;
@ -254,8 +254,8 @@ DBCellClearDef(cellDef)
*/ */
void void
DBClearPaintPlane(plane) DBClearPaintPlane(
Plane *plane; Plane *plane)
{ {
Tile *newCenterTile; Tile *newCenterTile;
@ -286,9 +286,9 @@ DBClearPaintPlane(plane)
*/ */
void void
dbSetPlaneTile(plane, newCenterTile) dbSetPlaneTile(
Plane *plane; Plane *plane,
Tile *newCenterTile; Tile *newCenterTile)
{ {
/* /*
* Set the stitches of the newly created center tile * Set the stitches of the newly created center tile
@ -333,8 +333,8 @@ dbSetPlaneTile(plane, newCenterTile)
*/ */
Plane * Plane *
DBNewPlane(body) DBNewPlane(
ClientData body; /* Body of initial, central tile */ ClientData body) /* Body of initial, central tile */
{ {
Tile *newtile; Tile *newtile;

View File

@ -70,9 +70,9 @@ Stack *dbConnectStack = (Stack *)NULL;
*/ */
TileType TileType
DBTransformDiagonal(oldtype, trans) DBTransformDiagonal(
TileType oldtype; TileType oldtype,
Transform *trans; Transform *trans)
{ {
TileType dinfo; TileType dinfo;
int o1, o2, o3, dir, side; int o1, o2, o3, dir, side;
@ -105,9 +105,9 @@ DBTransformDiagonal(oldtype, trans)
*/ */
TileType TileType
DBInvTransformDiagonal(oldtype, trans) DBInvTransformDiagonal(
TileType oldtype; TileType oldtype,
Transform *trans; Transform *trans)
{ {
TileType dinfo; TileType dinfo;
int o1, o2, o3; int o1, o2, o3;
@ -168,32 +168,31 @@ DBInvTransformDiagonal(oldtype, trans)
*/ */
int int
DBSrConnect(def, startArea, mask, connect, bounds, func, clientData) DBSrConnect(
CellDef *def; /* Cell definition in which to carry out CellDef *def, /* Cell definition in which to carry out
* the connectivity search. Only paint * the connectivity search. Only paint
* in this definition is considered. * in this definition is considered.
*/ */
Rect *startArea; /* Area to search for an initial tile. Only Rect *startArea, /* Area to search for an initial tile. Only
* tiles OVERLAPPING the area are considered. * tiles OVERLAPPING the area are considered.
* This area should have positive x and y * This area should have positive x and y
* dimensions. * dimensions.
*/ */
TileTypeBitMask *mask; /* Only tiles of one of these types are used TileTypeBitMask *mask, /* Only tiles of one of these types are used
* as initial tiles. * as initial tiles.
*/ */
TileTypeBitMask *connect; /* Pointer to a table indicating what tile TileTypeBitMask *connect, /* Pointer to a table indicating what tile
* types connect to what other tile types. * types connect to what other tile types.
* Each entry gives a mask of types that * Each entry gives a mask of types that
* connect to tiles of a given type. * connect to tiles of a given type.
*/ */
Rect *bounds; /* Area, in coords of scx->scx_use->cu_def, Rect *bounds, /* Area, in coords of scx->scx_use->cu_def,
* that limits the search: only tiles * that limits the search: only tiles
* overalapping this area will be returned. * overalapping this area will be returned.
* Use TiPlaneRect to search everywhere. * Use TiPlaneRect to search everywhere.
*/ */
int (*func)(); /* Function to apply at each connected tile. */ int (*func)(), /* Function to apply at each connected tile. */
ClientData clientData; /* Client data for above function. */ ClientData clientData) /* Client data for above function. */
{ {
struct conSrArg csa; struct conSrArg csa;
int startPlane, result; int startPlane, result;
@ -262,32 +261,31 @@ dbSrConnectStartFunc(
/* caller. */ /* caller. */
int int
DBSrConnectOnePass(def, startArea, mask, connect, bounds, func, clientData) DBSrConnectOnePass(
CellDef *def; /* Cell definition in which to carry out CellDef *def, /* Cell definition in which to carry out
* the connectivity search. Only paint * the connectivity search. Only paint
* in this definition is considered. * in this definition is considered.
*/ */
Rect *startArea; /* Area to search for an initial tile. Only Rect *startArea, /* Area to search for an initial tile. Only
* tiles OVERLAPPING the area are considered. * tiles OVERLAPPING the area are considered.
* This area should have positive x and y * This area should have positive x and y
* dimensions. * dimensions.
*/ */
TileTypeBitMask *mask; /* Only tiles of one of these types are used TileTypeBitMask *mask, /* Only tiles of one of these types are used
* as initial tiles. * as initial tiles.
*/ */
TileTypeBitMask *connect; /* Pointer to a table indicating what tile TileTypeBitMask *connect, /* Pointer to a table indicating what tile
* types connect to what other tile types. * types connect to what other tile types.
* Each entry gives a mask of types that * Each entry gives a mask of types that
* connect to tiles of a given type. * connect to tiles of a given type.
*/ */
Rect *bounds; /* Area, in coords of scx->scx_use->cu_def, Rect *bounds, /* Area, in coords of scx->scx_use->cu_def,
* that limits the search: only tiles * that limits the search: only tiles
* overalapping this area will be returned. * overalapping this area will be returned.
* Use TiPlaneRect to search everywhere. * Use TiPlaneRect to search everywhere.
*/ */
int (*func)(); /* Function to apply at each connected tile. */ int (*func)(), /* Function to apply at each connected tile. */
ClientData clientData; /* Client data for above function. */ ClientData clientData) /* Client data for above function. */
{ {
struct conSrArg csa; struct conSrArg csa;
int startPlane, result; int startPlane, result;
@ -345,10 +343,10 @@ DBSrConnectOnePass(def, startArea, mask, connect, bounds, func, clientData)
*/ */
int int
dbcFindTileFunc(tile, dinfo, arg) dbcFindTileFunc(
Tile *tile; Tile *tile,
TileType dinfo; TileType dinfo,
ClientData arg; ClientData arg)
{ {
TileAndDinfo *tad = (TileAndDinfo *)arg; TileAndDinfo *tad = (TileAndDinfo *)arg;
@ -673,11 +671,10 @@ donesides:
/** @typedef cb_database_srpaintnmarea_t */ /** @typedef cb_database_srpaintnmarea_t */
/** @typedef cb_database_srpaintarea_t */ /** @typedef cb_database_srpaintarea_t */
int int
dbcUnconnectFunc(tile, dinfo, clientData) dbcUnconnectFunc(
Tile *tile; /* Current tile */ Tile *tile, /* Current tile */
TileType dinfo; /* Split tile information, unused */ TileType dinfo, /* Split tile information, unused */
ClientData clientData; /* Unused. */ ClientData clientData) /* Unused. */
{ {
return 1; return 1;
} }
@ -707,11 +704,11 @@ dbcUnconnectFunc(tile, dinfo, clientData)
*/ */
int int
dbcConnectLabelFunc(scx, lab, tpath, csa2) dbcConnectLabelFunc(
SearchContext *scx; SearchContext *scx,
Label *lab; Label *lab,
TerminalPath *tpath; TerminalPath *tpath,
struct conSrArg2 *csa2; struct conSrArg2 *csa2)
{ {
CellDef *def = csa2->csa2_use->cu_def; CellDef *def = csa2->csa2_use->cu_def;
Rect r; Rect r;
@ -889,10 +886,10 @@ dbcConnectLabelFunc(scx, lab, tpath, csa2)
*/ */
int int
dbcConnectFunc(tile, dinfo, cx) dbcConnectFunc(
Tile *tile; /* Tile found. */ Tile *tile, /* Tile found. */
TileType dinfo; /* Split tile information */ TileType dinfo, /* Split tile information */
TreeContext *cx; /* Describes context of search. The client TreeContext *cx) /* Describes context of search. The client
* data is a pointer to a conSrArg2 record * data is a pointer to a conSrArg2 record
* containing various required information. * containing various required information.
*/ */
@ -1087,8 +1084,8 @@ dbcConnectFunc(tile, dinfo, cx)
*/ */
void void
DBTreeCopyConnect(scx, mask, xMask, connect, area, doLabels, destUse) DBTreeCopyConnect(
SearchContext *scx; /* Describes starting area. The SearchContext *scx, /* Describes starting area. The
* scx_use field gives the root of * scx_use field gives the root of
* the hierarchy to search, and the * the hierarchy to search, and the
* scx_area field gives the starting * scx_area field gives the starting
@ -1096,27 +1093,27 @@ DBTreeCopyConnect(scx, mask, xMask, connect, area, doLabels, destUse)
* this area. The transform is from * this area. The transform is from
* coords of scx_use to destUse. * coords of scx_use to destUse.
*/ */
TileTypeBitMask *mask; /* Tile types to start from in area. */ TileTypeBitMask *mask, /* Tile types to start from in area. */
int xMask; /* Information must be expanded in all int xMask, /* Information must be expanded in all
* of the windows indicated by this * of the windows indicated by this
* mask. Use 0 to consider all info * mask. Use 0 to consider all info
* regardless of expansion. * regardless of expansion.
*/ */
TileTypeBitMask *connect; /* Points to table that defines what TileTypeBitMask *connect, /* Points to table that defines what
* each tile type is considered to * each tile type is considered to
* connect to. Use DBConnectTbl as * connect to. Use DBConnectTbl as
* a default. * a default.
*/ */
Rect *area; /* The resulting information is Rect *area, /* The resulting information is
* clipped to this area. Pass * clipped to this area. Pass
* TiPlaneRect to get everything. * TiPlaneRect to get everything.
*/ */
unsigned char doLabels; /* If SEL_DO_LABELS, copy connected labels unsigned char doLabels, /* If SEL_DO_LABELS, copy connected labels
* and paint. If SEL_NO_LABELS, copy only * and paint. If SEL_NO_LABELS, copy only
* connected paint. If SEL_SIMPLE_LABELS, * connected paint. If SEL_SIMPLE_LABELS,
* copy only root of labels in subcircuits. * copy only root of labels in subcircuits.
*/ */
CellUse *destUse; /* Result use in which to place CellUse *destUse) /* Result use in which to place
* anything connected to material of * anything connected to material of
* type mask in area of rootUse. * type mask in area of rootUse.
*/ */

View File

@ -109,12 +109,12 @@ struct countArg
}; };
void void
DBTreeCountPaint(def, count, hiercount, cleanup, cdata) DBTreeCountPaint(
CellDef *def; CellDef *def,
int (*count)(); int (*count)(),
void (*hiercount)(); void (*hiercount)(),
int (*cleanup)(); int (*cleanup)(),
ClientData cdata; ClientData cdata)
{ {
struct countArg ca; struct countArg ca;
int dbCountFunc(), dbCountHierFunc(); int dbCountFunc(), dbCountHierFunc();
@ -137,9 +137,9 @@ DBTreeCountPaint(def, count, hiercount, cleanup, cdata)
} }
int int
dbCountFunc(use, ca) dbCountFunc(
CellUse *use; CellUse *use,
struct countArg *ca; struct countArg *ca)
{ {
if ((*ca->ca_count)(use->cu_def, ca->ca_cdata) == 0) if ((*ca->ca_count)(use->cu_def, ca->ca_cdata) == 0)
(void) DBCellEnum(use->cu_def, dbCountFunc, (ClientData) ca); (void) DBCellEnum(use->cu_def, dbCountFunc, (ClientData) ca);
@ -147,9 +147,9 @@ dbCountFunc(use, ca)
} }
int int
dbCountHierFunc(use, ca) dbCountHierFunc(
CellUse *use; CellUse *use,
struct countArg *ca; struct countArg *ca)
{ {
int nx, ny; int nx, ny;

View File

@ -68,10 +68,10 @@ struct expandArg
*/ */
void void
DBExpand(cellUse, expandMask, expandType) DBExpand(
CellUse *cellUse; CellUse *cellUse,
int expandMask; int expandMask,
int expandType; int expandType)
{ {
CellDef *def; CellDef *def;
bool expandFlag, expandTest; bool expandFlag, expandTest;
@ -138,15 +138,15 @@ DBExpand(cellUse, expandMask, expandType)
*/ */
void void
DBExpandAll(rootUse, rootRect, expandMask, expandType, func, cdarg) DBExpandAll(
CellUse *rootUse; /* Root cell use from which search begins */ CellUse *rootUse, /* Root cell use from which search begins */
Rect *rootRect; /* Area to be expanded, in root coordinates */ Rect *rootRect, /* Area to be expanded, in root coordinates */
int expandMask; /* Window mask in which cell is to be expanded */ int expandMask, /* Window mask in which cell is to be expanded */
int expandType; /* DB_EXPAND, DB_UNEXPAND, DB_EXPAND_TOGGLE */ int expandType, /* DB_EXPAND, DB_UNEXPAND, DB_EXPAND_TOGGLE */
int (*func)(); /* Function to call for each cell whose expansion int (*func)(), /* Function to call for each cell whose expansion
* status is modified. NULL means don't call anyone. * status is modified. NULL means don't call anyone.
*/ */
ClientData cdarg; /* Argument to pass to func. */ ClientData cdarg) /* Argument to pass to func. */
{ {
int dbExpandFunc(); int dbExpandFunc();
SearchContext scontext; SearchContext scontext;
@ -179,13 +179,13 @@ DBExpandAll(rootUse, rootRect, expandMask, expandType, func, cdarg)
*/ */
int int
dbExpandFunc(scx, arg) dbExpandFunc(
SearchContext *scx; /* Pointer to search context containing SearchContext *scx, /* Pointer to search context containing
* child use, search area in coor- * child use, search area in coor-
* dinates of the child use, and * dinates of the child use, and
* transform back to "root". * transform back to "root".
*/ */
struct expandArg *arg; /* Client data from caller */ struct expandArg *arg) /* Client data from caller */
{ {
CellUse *childUse = scx->scx_use; CellUse *childUse = scx->scx_use;
int n = DBLambda[1]; int n = DBLambda[1];
@ -273,10 +273,10 @@ dbExpandFunc(scx, arg)
*/ */
CellDef * CellDef *
DBCellReadArea(rootUse, rootRect, halt_on_error) DBCellReadArea(
CellUse *rootUse; /* Root cell use from which search begins */ CellUse *rootUse, /* Root cell use from which search begins */
Rect *rootRect; /* Area to be read, in root coordinates */ Rect *rootRect, /* Area to be read, in root coordinates */
bool halt_on_error; /* If TRUE, failure to find a cell causes a halt */ bool halt_on_error) /* If TRUE, failure to find a cell causes a halt */
{ {
int dbReadAreaFunc(); int dbReadAreaFunc();
SearchContext scontext; SearchContext scontext;
@ -292,13 +292,13 @@ DBCellReadArea(rootUse, rootRect, halt_on_error)
} }
int int
dbReadAreaFunc(scx, err_ptr) dbReadAreaFunc(
SearchContext *scx; /* Pointer to context specifying SearchContext *scx, /* Pointer to context specifying
* the cell use to be read in, and * the cell use to be read in, and
* an area to be recursively read in * an area to be recursively read in
* coordinates of the cell use's def. * coordinates of the cell use's def.
*/ */
CellDef **err_ptr; /* If non-NULL, failure to find a cell causes a halt CellDef **err_ptr) /* If non-NULL, failure to find a cell causes a halt
* and the CellDef in error is returned in err_def. * and the CellDef in error is returned in err_def.
* If NULL, failure to find a cell still causes a * If NULL, failure to find a cell still causes a
* halt but no information is passed back to the * halt but no information is passed back to the

View File

@ -112,12 +112,12 @@ static char *DBbackupFile = (char *)NULL;
/* Forward declarations */ /* Forward declarations */
char *dbFgets(); char *dbFgets();
FILETYPE dbReadOpen(); FILETYPE dbReadOpen(CellDef *cellDef, bool setFileName, bool dereference, int *errptr);
int DBFileOffset; int DBFileOffset;
bool dbReadLabels(); bool dbReadLabels();
bool dbReadElements(); bool dbReadElements();
bool dbReadProperties(); bool dbReadProperties();
bool dbReadUse(); bool dbReadUse(CellDef *cellDef, char *line, int len, FILETYPE f, int scalen, int scaled, bool dereference, HashTable *dbUseTable);
#ifdef MAGIC_WRAPPER #ifdef MAGIC_WRAPPER
/* Used to make a tag callback after loading a techfile */ /* Used to make a tag callback after loading a techfile */
@ -136,8 +136,8 @@ extern int TagCallback();
*/ */
static int static int
file_is_not_writeable(name) file_is_not_writeable(
char *name; char *name)
{ {
struct stat sbuf; struct stat sbuf;
@ -170,7 +170,9 @@ file_is_not_writeable(name)
} }
static int static int
path_is_dir(const char *dirname, const char *filename) path_is_dir(
const char *dirname,
const char *filename)
{ {
struct stat statbuf; struct stat statbuf;
char path[PATH_MAX]; char path[PATH_MAX];
@ -221,11 +223,11 @@ typedef struct _linkedDirent {
*/ */
char * char *
DBSearchForTech(techname, techroot, pathroot, level) DBSearchForTech(
char *techname; char *techname,
char *techroot; /* techname without the ".tech" suffix */ char *techroot, /* techname without the ".tech" suffix */
char *pathroot; char *pathroot,
int level; int level)
{ {
char *newpath, *found, *dptr; char *newpath, *found, *dptr;
struct dirent *tdent; struct dirent *tdent;
@ -338,9 +340,9 @@ DBSearchForTech(techname, techroot, pathroot, level)
*/ */
int int
DBAddStandardCellPaths(pathptr, level) DBAddStandardCellPaths(
char *pathptr; char *pathptr,
int level; int level)
{ {
int paths = 0; int paths = 0;
struct dirent *tdent; struct dirent *tdent;
@ -520,10 +522,10 @@ DBAddStandardCellPaths(pathptr, level)
*/ */
bool bool
dbCellReadDef(f, cellDef, ignoreTech, dereference) dbCellReadDef(
FILETYPE f; /* The file, already opened by the caller */ FILETYPE f, /* The file, already opened by the caller */
CellDef *cellDef; /* Pointer to definition of cell to be read in */ CellDef *cellDef, /* Pointer to definition of cell to be read in */
bool ignoreTech; /* If FALSE then the technology of the file MUST bool ignoreTech, /* If FALSE then the technology of the file MUST
* match the current technology, or else the * match the current technology, or else the
* subroutine will return an error condition * subroutine will return an error condition
* without reading anything. If TRUE, a * without reading anything. If TRUE, a
@ -531,7 +533,7 @@ dbCellReadDef(f, cellDef, ignoreTech, dereference)
* names do not match, but an attempt will be * names do not match, but an attempt will be
* made to read the file anyway. * made to read the file anyway.
*/ */
bool dereference; /* If TRUE, ignore path references in the input */ bool dereference) /* If TRUE, ignore path references in the input */
{ {
int cellStamp = 0, rectCount = 0, rectReport = 10000; int cellStamp = 0, rectCount = 0, rectReport = 10000;
char line[2048], tech[50], layername[50]; char line[2048], tech[50], layername[50];
@ -1111,8 +1113,8 @@ DBRemoveBackup()
*/ */
void void
DBFileRecovery(filename) DBFileRecovery(
char *filename; char *filename)
{ {
DIR *cwd; DIR *cwd;
struct direct *dp; struct direct *dp;
@ -1232,10 +1234,10 @@ DBFileRecovery(filename)
*/ */
bool bool
DBReadBackup(name, archive, usederef) DBReadBackup(
char *name; /* Name of the backup file */ char *name, /* Name of the backup file */
bool archive; /* TRUE if this is an archive file */ bool archive, /* TRUE if this is an archive file */
bool usederef; /* If TRUE, then dereference all cells */ bool usederef) /* If TRUE, then dereference all cells */
{ {
FILETYPE f; FILETYPE f;
static const char *filetypes[] = {"archive", "backup", 0}; static const char *filetypes[] = {"archive", "backup", 0};
@ -1358,9 +1360,9 @@ DBReadBackup(name, archive, usederef)
*/ */
bool bool
DBCellRead(cellDef, ignoreTech, dereference, errptr) DBCellRead(
CellDef *cellDef; /* Pointer to definition of cell to be read in */ CellDef *cellDef, /* Pointer to definition of cell to be read in */
bool ignoreTech; /* If FALSE then the technology of the file MUST bool ignoreTech, /* If FALSE then the technology of the file MUST
* match the current technology, or else the * match the current technology, or else the
* subroutine will return an error condition * subroutine will return an error condition
* without reading anything. If TRUE, a * without reading anything. If TRUE, a
@ -1368,8 +1370,8 @@ DBCellRead(cellDef, ignoreTech, dereference, errptr)
* names do not match, but an attempt will be * names do not match, but an attempt will be
* made to read the file anyway. * made to read the file anyway.
*/ */
bool dereference; /* If TRUE then ignore path argument to cellDef */ bool dereference, /* If TRUE then ignore path argument to cellDef */
int *errptr; /* Copy of errno set by file reading routine int *errptr) /* Copy of errno set by file reading routine
* is placed here, unless NULL. * is placed here, unless NULL.
*/ */
{ {
@ -1444,16 +1446,16 @@ DBCellRead(cellDef, ignoreTech, dereference, errptr)
*/ */
FILETYPE FILETYPE
dbReadOpen(cellDef, setFileName, dereference, errptr) dbReadOpen(
CellDef *cellDef; /* Def being read */ CellDef *cellDef, /* Def being read */
bool setFileName; /* If TRUE then cellDef->cd_file should be updated bool setFileName, /* If TRUE then cellDef->cd_file should be updated
* to point to the name of the file from which the * to point to the name of the file from which the
* cell was loaded. * cell was loaded.
*/ */
bool dereference; /* If dereferencing, try search paths first, and bool dereference, /* If dereferencing, try search paths first, and
* only if that fails, try the value in cd_file. * only if that fails, try the value in cd_file.
*/ */
int *errptr; /* Pointer to int to hold error value */ int *errptr) /* Pointer to int to hold error value */
{ {
FILETYPE f = NULL; FILETYPE f = NULL;
int fd; int fd;
@ -1678,14 +1680,14 @@ dbReadOpen(cellDef, setFileName, dereference, errptr)
*/ */
void void
DBOpenOnly(cellDef, name, setFileName, errptr) DBOpenOnly(
CellDef *cellDef; /* Def being read */ CellDef *cellDef, /* Def being read */
char *name; /* Name if specified, or NULL */ char *name, /* Name if specified, or NULL */
bool setFileName; /* If TRUE then cellDef->cd_file should be updated bool setFileName, /* If TRUE then cellDef->cd_file should be updated
* to point to the name of the file from which the * to point to the name of the file from which the
* cell was loaded. * cell was loaded.
*/ */
int *errptr; /* Pointer to int to hold error value */ int *errptr) /* Pointer to int to hold error value */
{ {
dbReadOpen(cellDef, setFileName, FALSE, errptr); dbReadOpen(cellDef, setFileName, FALSE, errptr);
} }
@ -1707,9 +1709,9 @@ DBOpenOnly(cellDef, name, setFileName, errptr)
*/ */
bool bool
DBTestOpen(name, fullPath) DBTestOpen(
char *name; char *name,
char **fullPath; char **fullPath)
{ {
FILETYPE f; FILETYPE f;
@ -1747,15 +1749,15 @@ DBTestOpen(name, fullPath)
*/ */
bool bool
dbReadUse(cellDef, line, len, f, scalen, scaled, dereference, dbUseTable) dbReadUse(
CellDef *cellDef; /* Cell whose cells are being read */ CellDef *cellDef, /* Cell whose cells are being read */
char *line; /* Line containing "use ..." */ char *line, /* Line containing "use ..." */
int len; /* Size of buffer pointed to by line */ int len, /* Size of buffer pointed to by line */
FILETYPE f; /* Input file */ FILETYPE f, /* Input file */
int scalen; /* Multiply values in file by this */ int scalen, /* Multiply values in file by this */
int scaled; /* Divide values in file by this */ int scaled, /* Divide values in file by this */
bool dereference; /* If TRUE, ignore path references */ bool dereference, /* If TRUE, ignore path references */
HashTable *dbUseTable; /* Hash table of instances seen in this file */ HashTable *dbUseTable) /* Hash table of instances seen in this file */
{ {
int xlo, xhi, ylo, yhi, xsep, ysep, childStamp; int xlo, xhi, ylo, yhi, xsep, ysep, childStamp;
int absa, absb, absd, abse, nconv; int absa, absb, absd, abse, nconv;
@ -2396,13 +2398,13 @@ nextLine:
*/ */
bool bool
dbReadProperties(cellDef, line, len, f, scalen, scaled) dbReadProperties(
CellDef *cellDef; /* Cell whose properties are being read */ CellDef *cellDef, /* Cell whose properties are being read */
char *line; /* Line containing << properties >> */ char *line, /* Line containing << properties >> */
int len; /* Size of buffer pointed to by line */ int len, /* Size of buffer pointed to by line */
FILETYPE f; /* Input file */ FILETYPE f, /* Input file */
int scalen; /* Scale up by this factor */ int scalen, /* Scale up by this factor */
int scaled; /* Scale down by this factor */ int scaled) /* Scale down by this factor */
{ {
char propertytype[32], propertyname[128], propertyvalue[2049]; char propertytype[32], propertyname[128], propertyvalue[2049];
PropertyRecord *proprec; PropertyRecord *proprec;
@ -2892,13 +2894,13 @@ nextproperty:
*/ */
bool bool
dbReadElements(cellDef, line, len, f, scalen, scaled) dbReadElements(
CellDef *cellDef; /* Cell whose elements are being read */ CellDef *cellDef, /* Cell whose elements are being read */
char *line; /* Line containing << elements >> */ char *line, /* Line containing << elements >> */
int len; /* Size of buffer pointed to by line */ int len, /* Size of buffer pointed to by line */
FILETYPE f; /* Input file */ FILETYPE f, /* Input file */
int scalen; /* Scale up by this factor */ int scalen, /* Scale up by this factor */
int scaled; /* Scale down by this factor */ int scaled) /* Scale down by this factor */
{ {
char elementname[128], styles[1024], *text, flags[100]; char elementname[128], styles[1024], *text, flags[100];
int istyle, ntok; int istyle, ntok;
@ -3066,13 +3068,13 @@ nextelement:
*/ */
bool bool
dbReadLabels(cellDef, line, len, f, scalen, scaled) dbReadLabels(
CellDef *cellDef; /* Cell whose labels are being read */ CellDef *cellDef, /* Cell whose labels are being read */
char *line; /* Line containing << labels >> */ char *line, /* Line containing << labels >> */
int len; /* Size of buffer pointed to by line */ int len, /* Size of buffer pointed to by line */
FILETYPE f; /* Input file */ FILETYPE f, /* Input file */
int scalen; /* Scale up by this factor */ int scalen, /* Scale up by this factor */
int scaled; /* Scale down by this factor */ int scaled) /* Scale down by this factor */
{ {
char layername[50], text[1024], port_use[50], port_class[50], port_shape[50]; char layername[50], text[1024], port_use[50], port_class[50], port_shape[50];
TileType type; TileType type;
@ -3385,10 +3387,10 @@ nextlabel:
*/ */
char * char *
dbFgets(line, len, f) dbFgets(
char *line; char *line,
int len; int len,
FILETYPE f; FILETYPE f)
{ {
char *cs; char *cs;
int l; int l;
@ -3430,8 +3432,8 @@ dbFgets(line, len, f)
*/ */
int int
DBCellFindScale(cellDef) DBCellFindScale(
CellDef *cellDef; CellDef *cellDef)
{ {
int dbFindGCFFunc(), dbFindCellGCFFunc(), dbFindPropGCFFunc(); int dbFindGCFFunc(), dbFindCellGCFFunc(), dbFindPropGCFFunc();
TileType type; TileType type;
@ -3508,10 +3510,10 @@ DBCellFindScale(cellDef)
*/ */
int int
dbFindGCFFunc(tile, dinfo, ggcf) dbFindGCFFunc(
Tile *tile; Tile *tile,
TileType dinfo; /* (unused) */ TileType dinfo, /* (unused) */
int *ggcf; int *ggcf)
{ {
Rect r; Rect r;
@ -3548,9 +3550,9 @@ dbFindGCFFunc(tile, dinfo, ggcf)
*/ */
int int
dbFindCellGCFFunc(cellUse, ggcf) dbFindCellGCFFunc(
CellUse *cellUse; /* Cell use whose "call" is to be written to a file */ CellUse *cellUse, /* Cell use whose "call" is to be written to a file */
int *ggcf; /* Greatest common denominator for all geometry */ int *ggcf) /* Greatest common denominator for all geometry */
{ {
Transform *t; Transform *t;
Rect *b; Rect *b;
@ -3605,10 +3607,10 @@ dbFindCellGCFFunc(cellUse, ggcf)
*/ */
int int
dbFindPropGCFFunc(key, proprec, ggcf) dbFindPropGCFFunc(
char *key; char *key,
PropertyRecord *proprec; PropertyRecord *proprec,
int *ggcf; /* Client data */ int *ggcf) /* Client data */
{ {
int value, n; int value, n;
@ -3652,7 +3654,9 @@ dbFindPropGCFFunc(key, proprec, ggcf)
*/ */
int int
cucompare(const void *one, const void *two) cucompare(
const void *one,
const void *two)
{ {
CellUse *use1, *use2; CellUse *use1, *use2;
char *s1, *s2; char *s1, *s2;
@ -3692,9 +3696,9 @@ struct cellUseList {
*/ */
int int
dbGetUseFunc(cellUse, useRec) dbGetUseFunc(
CellUse *cellUse; /* Cell use whose "call" is to be written to a file */ CellUse *cellUse, /* Cell use whose "call" is to be written to a file */
struct cellUseList *useRec; struct cellUseList *useRec)
{ {
useRec->useList[useRec->idx] = cellUse; useRec->useList[useRec->idx] = cellUse;
useRec->idx++; useRec->idx++;
@ -3720,9 +3724,9 @@ dbGetUseFunc(cellUse, useRec)
*/ */
int int
dbCountUseFunc(cellUse, count) dbCountUseFunc(
CellUse *cellUse; /* Cell use whose "call" is to be written to a file */ CellUse *cellUse, /* Cell use whose "call" is to be written to a file */
int *count; int *count)
{ {
(*count)++; (*count)++;
return 0; return 0;
@ -3754,7 +3758,9 @@ struct keyValuePair {
*/ */
int int
keycompare(const void *one, const void *two) keycompare(
const void *one,
const void *two)
{ {
int cval; int cval;
struct keyValuePair *kv1 = *((struct keyValuePair **)one); struct keyValuePair *kv1 = *((struct keyValuePair **)one);
@ -3792,10 +3798,10 @@ struct cellPropList {
*/ */
int int
dbGetPropFunc(key, proprec, propRec) dbGetPropFunc(
char *key; char *key,
PropertyRecord *proprec; PropertyRecord *proprec,
struct cellPropList *propRec; struct cellPropList *propRec)
{ {
propRec->keyValueList[propRec->idx] = propRec->keyValueList[propRec->idx] =
(struct keyValuePair *)mallocMagic(sizeof(struct keyValuePair)); (struct keyValuePair *)mallocMagic(sizeof(struct keyValuePair));
@ -3824,10 +3830,10 @@ dbGetPropFunc(key, proprec, propRec)
*/ */
int int
dbCountPropFunc(key, proprec, count) dbCountPropFunc(
char *key; char *key,
PropertyRecord *proprec; PropertyRecord *proprec,
int *count; /* Client data */ int *count) /* Client data */
{ {
(*count)++; (*count)++;
return 0; return 0;
@ -3875,9 +3881,9 @@ typedef struct _pwfrec {
*/ */
bool bool
DBCellWriteFile(cellDef, f) DBCellWriteFile(
CellDef *cellDef; /* Pointer to definition of cell to be written out */ CellDef *cellDef, /* Pointer to definition of cell to be written out */
FILE *f; /* The FILE to write to */ FILE *f) /* The FILE to write to */
{ {
int dbWritePaintFunc(), dbWriteCellFunc(), dbWritePropFunc(); int dbWritePaintFunc(), dbWriteCellFunc(), dbWritePropFunc();
int dbClearCellFunc(); int dbClearCellFunc();
@ -4220,10 +4226,10 @@ dbWritePropPaintFunc(Tile *tile,
*/ */
int int
dbWritePropFunc(key, proprec, cdata) dbWritePropFunc(
char *key; char *key,
PropertyRecord *proprec; PropertyRecord *proprec,
ClientData cdata; ClientData cdata)
{ {
pwfrec *pwf = (pwfrec *)cdata; pwfrec *pwf = (pwfrec *)cdata;
FILE *f = pwf->pwf_file; FILE *f = pwf->pwf_file;
@ -4329,9 +4335,9 @@ dbWritePropFunc(key, proprec, cdata)
*/ */
bool bool
DBCellWriteCommandFile(cellDef, f) DBCellWriteCommandFile(
CellDef *cellDef; /* Pointer to definition of cell to be written out */ CellDef *cellDef, /* Pointer to definition of cell to be written out */
FILE *f; /* The FILE to write to */ FILE *f) /* The FILE to write to */
{ {
int dbWritePaintCommandsFunc(); int dbWritePaintCommandsFunc();
int dbWriteUseCommandsFunc(); int dbWriteUseCommandsFunc();
@ -4552,10 +4558,10 @@ ioerror:
*/ */
int int
dbWritePaintCommandsFunc(tile, dinfo, cdarg) dbWritePaintCommandsFunc(
Tile *tile; Tile *tile,
TileType dinfo; TileType dinfo,
ClientData cdarg; ClientData cdarg)
{ {
char pstring[256]; char pstring[256];
struct writeArg *arg = (struct writeArg *) cdarg; struct writeArg *arg = (struct writeArg *) cdarg;
@ -4623,9 +4629,9 @@ dbWritePaintCommandsFunc(tile, dinfo, cdarg)
*/ */
int int
dbWriteUseCommandsFunc(cellUse, cdarg) dbWriteUseCommandsFunc(
CellUse *cellUse; CellUse *cellUse,
ClientData cdarg; ClientData cdarg)
{ {
struct writeArg *arg = (struct writeArg *) cdarg; struct writeArg *arg = (struct writeArg *) cdarg;
FILE *f = arg->wa_file; FILE *f = arg->wa_file;
@ -4695,10 +4701,10 @@ dbWritePropCommandPaintFunc(Tile *tile,
*/ */
int int
dbWritePropCommandsFunc(key, proprec, cdarg) dbWritePropCommandsFunc(
char *key; char *key,
PropertyRecord *proprec; PropertyRecord *proprec,
ClientData cdarg; ClientData cdarg)
{ {
struct writeArg *arg = (struct writeArg *) cdarg; struct writeArg *arg = (struct writeArg *) cdarg;
char *escstr, *p, *v, *value; char *escstr, *p, *v, *value;
@ -4807,9 +4813,9 @@ dbWritePropCommandsFunc(key, proprec, cdarg)
*/ */
bool bool
DBCellWrite(cellDef, fileName) DBCellWrite(
CellDef *cellDef; /* Pointer to definition of cell to be written out */ CellDef *cellDef, /* Pointer to definition of cell to be written out */
char *fileName; /* If not NULL, name of file to write. If NULL, char *fileName) /* If not NULL, name of file to write. If NULL,
* the name associated with the CellDef is used * the name associated with the CellDef is used
*/ */
{ {
@ -5137,10 +5143,10 @@ cleanup:
*/ */
int int
dbWritePaintFunc(tile, dinfo, cdarg) dbWritePaintFunc(
Tile *tile; Tile *tile,
TileType dinfo; /* (unused) */ TileType dinfo, /* (unused) */
ClientData cdarg; ClientData cdarg)
{ {
char pstring[256]; char pstring[256];
struct writeArg *arg = (struct writeArg *) cdarg; struct writeArg *arg = (struct writeArg *) cdarg;
@ -5222,9 +5228,9 @@ dbWritePaintFunc(tile, dinfo, cdarg)
*/ */
int int
dbClearCellFunc(cellUse, cdarg) dbClearCellFunc(
CellUse *cellUse; /* Cell use */ CellUse *cellUse, /* Cell use */
ClientData cdarg; /* Not used */ ClientData cdarg) /* Not used */
{ {
cellUse->cu_def->cd_flags &= ~CDVISITED; cellUse->cu_def->cd_flags &= ~CDVISITED;
return 0; return 0;
@ -5255,10 +5261,10 @@ dbClearCellFunc(cellUse, cdarg)
*/ */
void void
DBPathSubstitute(pathstart, cstring, cellDef) DBPathSubstitute(
char *pathstart; char *pathstart,
char *cstring; char *cstring,
CellDef *cellDef; CellDef *cellDef)
{ {
bool subbed = FALSE; bool subbed = FALSE;
#ifdef MAGIC_WRAPPER #ifdef MAGIC_WRAPPER
@ -5347,9 +5353,9 @@ DBPathSubstitute(pathstart, cstring, cellDef)
*/ */
int int
dbWriteCellFunc(cellUse, cdarg) dbWriteCellFunc(
CellUse *cellUse; /* Cell use whose "call" is to be written to a file */ CellUse *cellUse, /* Cell use whose "call" is to be written to a file */
ClientData cdarg; ClientData cdarg)
{ {
struct writeArg *arg = (struct writeArg *) cdarg; struct writeArg *arg = (struct writeArg *) cdarg;
Transform *t; Transform *t;
@ -5461,8 +5467,8 @@ dbWriteCellFunc(cellUse, cdarg)
*/ */
char * char *
DBGetTech(cellName) DBGetTech(
char *cellName; /* Name of cell whose technology char *cellName) /* Name of cell whose technology
* is desired. * is desired.
*/ */
{ {
@ -5491,7 +5497,7 @@ ret:
} }
/* File and flags record used to hold information for dbWriteBackupFunc() /* File and flags record used to hold information for dbWriteBackupFunc()
* in DBWriteBackup() * in DBWriteBackup().
*/ */
typedef struct _fileAndFlags { typedef struct _fileAndFlags {
@ -5532,10 +5538,10 @@ typedef struct _fileAndFlags {
*/ */
bool bool
DBWriteBackup(filename, archive, doforall) DBWriteBackup(
char *filename; char *filename,
bool archive; bool archive,
bool doforall; bool doforall)
{ {
FILE *f; FILE *f;
int fd, pid; int fd, pid;
@ -5657,9 +5663,9 @@ DBWriteBackup(filename, archive, doforall)
*/ */
int int
dbWriteBackupFunc(def, clientData) dbWriteBackupFunc(
CellDef *def; /* Pointer to CellDef to be saved */ CellDef *def, /* Pointer to CellDef to be saved */
ClientData clientData; ClientData clientData)
{ {
char *name = def->cd_file; char *name = def->cd_file;
int result, save_flags; int result, save_flags;
@ -5693,9 +5699,9 @@ dbWriteBackupFunc(def, clientData)
*/ */
int int
dbCheckModifiedCellsFunc(def, cdata) dbCheckModifiedCellsFunc(
CellDef *def; /* Pointer to CellDef to be saved */ CellDef *def, /* Pointer to CellDef to be saved */
ClientData cdata; /* Unused */ ClientData cdata) /* Unused */
{ {
if (def->cd_flags & (CDINTERNAL | CDNOEDIT | CDNOTFOUND)) return 0; if (def->cd_flags & (CDINTERNAL | CDNOEDIT | CDNOTFOUND)) return 0;
else if (!(def->cd_flags & CDAVAILABLE)) return 0; else if (!(def->cd_flags & CDAVAILABLE)) return 0;

View File

@ -43,7 +43,7 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
#include "commands/commands.h" #include "commands/commands.h"
#include "textio/textio.h" #include "textio/textio.h"
static TileType DBPickLabelLayer(/* CellDef *def, Label *lab, bool doCalma */); static TileType DBPickLabelLayer(CellDef *def, Label *lab, bool doCalma);
/* Globally-accessible font information */ /* Globally-accessible font information */
@ -68,8 +68,8 @@ int DBNumFonts = 0;
*/ */
bool bool
DBIsSubcircuit(cellDef) DBIsSubcircuit(
CellDef *cellDef; CellDef *cellDef)
{ {
Label *lab; Label *lab;
@ -94,14 +94,14 @@ DBIsSubcircuit(cellDef)
*/ */
Label * Label *
DBPutLabel(cellDef, rect, align, text, type, flags, port) DBPutLabel(
CellDef *cellDef; CellDef *cellDef,
Rect *rect; Rect *rect,
int align; int align,
char *text; char *text,
TileType type; TileType type,
unsigned short flags; unsigned short flags,
unsigned int port; unsigned int port)
{ {
/* Draw text in a standard X11 font */ /* Draw text in a standard X11 font */
return DBPutFontLabel(cellDef, rect, -1, 0, 0, &GeoOrigin, return DBPutFontLabel(cellDef, rect, -1, 0, 0, &GeoOrigin,
@ -132,21 +132,21 @@ DBPutLabel(cellDef, rect, align, text, type, flags, port)
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
Label * Label *
DBPutFontLabel(cellDef, rect, font, size, rot, offset, align, text, type, flags, port) DBPutFontLabel(
CellDef *cellDef; /* Cell in which label is placed */ CellDef *cellDef, /* Cell in which label is placed */
Rect *rect; /* Location of label; see above for description */ Rect *rect, /* Location of label; see above for description */
int font; /* A vector outline font to use, or -1 for X11 font */ int font, /* A vector outline font to use, or -1 for X11 font */
int size; /* Scale of vector font relative to the database (x8) */ int size, /* Scale of vector font relative to the database (x8) */
int rot; /* Rotate of the vector font in degrees */ int rot, /* Rotate of the vector font in degrees */
Point *offset; /* Offset of the font from the point of origin */ Point *offset, /* Offset of the font from the point of origin */
int align; /* Orientation/alignment of text. If this is < 0, int align, /* Orientation/alignment of text. If this is < 0,
* an orientation will be picked to keep the text * an orientation will be picked to keep the text
* inside the cell boundary. * inside the cell boundary.
*/ */
char *text; /* Pointer to actual text of label */ char *text, /* Pointer to actual text of label */
TileType type; /* Type of tile to be labelled */ TileType type, /* Type of tile to be labelled */
unsigned short flags; /* Label flags */ unsigned short flags, /* Label flags */
unsigned int port; /* Port index (if label is a port, per the flags) */ unsigned int port) /* Port index (if label is a port, per the flags) */
{ {
Label *lab; Label *lab;
int len, x1, x2, y1, y2, tmp, labx, laby; int len, x1, x2, y1, y2, tmp, labx, laby;
@ -262,17 +262,17 @@ DBPutFontLabel(cellDef, rect, font, size, rot, offset, align, text, type, flags,
*/ */
bool bool
DBEraseGlobLabel(cellDef, area, mask, areaReturn, globmatch) DBEraseGlobLabel(
CellDef *cellDef; /* Cell being modified */ CellDef *cellDef, /* Cell being modified */
Rect *area; /* Area from which labels are to be erased. Rect *area, /* Area from which labels are to be erased.
* This may be a point; any labels touching * This may be a point; any labels touching
* or overlapping it are erased. * or overlapping it are erased.
*/ */
TileTypeBitMask *mask; /* Mask of types from which labels are to TileTypeBitMask *mask, /* Mask of types from which labels are to
* be erased. * be erased.
*/ */
Rect *areaReturn; /* Expand this with label bounding box */ Rect *areaReturn, /* Expand this with label bounding box */
char *globmatch; /* If non-NULL, do glob-style matching of char *globmatch) /* If non-NULL, do glob-style matching of
* any label against this string. * any label against this string.
*/ */
{ {
@ -353,16 +353,16 @@ DBEraseGlobLabel(cellDef, area, mask, areaReturn, globmatch)
*/ */
bool bool
DBEraseLabel(cellDef, area, mask, areaReturn) DBEraseLabel(
CellDef *cellDef; /* Cell being modified */ CellDef *cellDef, /* Cell being modified */
Rect *area; /* Area from which labels are to be erased. Rect *area, /* Area from which labels are to be erased.
* This may be a point; any labels touching * This may be a point; any labels touching
* or overlapping it are erased. * or overlapping it are erased.
*/ */
TileTypeBitMask *mask; /* Mask of types from which labels are to TileTypeBitMask *mask, /* Mask of types from which labels are to
* be erased. * be erased.
*/ */
Rect *areaReturn; /* Expand this with label bounding box */ Rect *areaReturn) /* Expand this with label bounding box */
{ {
return DBEraseGlobLabel(cellDef, area, mask, areaReturn, NULL); return DBEraseGlobLabel(cellDef, area, mask, areaReturn, NULL);
} }
@ -385,15 +385,15 @@ DBEraseLabel(cellDef, area, mask, areaReturn)
*/ */
Label * Label *
DBCheckLabelsByContent(def, rect, type, text) DBCheckLabelsByContent(
CellDef *def; /* Where to look for label to delete. */ CellDef *def, /* Where to look for label to delete. */
Rect *rect; /* Coordinates of label. If NULL, then Rect *rect, /* Coordinates of label. If NULL, then
* labels are searched regardless of coords. * labels are searched regardless of coords.
*/ */
TileType type; /* Layer label is attached to. If < 0, then TileType type, /* Layer label is attached to. If < 0, then
* labels are searched regardless of type. * labels are searched regardless of type.
*/ */
char *text; /* Text associated with label. If NULL, then char *text) /* Text associated with label. If NULL, then
* labels are searched regardless of text. * labels are searched regardless of text.
*/ */
{ {
@ -430,15 +430,15 @@ DBCheckLabelsByContent(def, rect, type, text)
*/ */
void void
DBEraseLabelsByContent(def, rect, type, text) DBEraseLabelsByContent(
CellDef *def; /* Where to look for label to delete. */ CellDef *def, /* Where to look for label to delete. */
Rect *rect; /* Coordinates of label. If NULL, then Rect *rect, /* Coordinates of label. If NULL, then
* labels are deleted regardless of coords. * labels are deleted regardless of coords.
*/ */
TileType type; /* Layer label is attached to. If < 0, then TileType type, /* Layer label is attached to. If < 0, then
* labels are deleted regardless of type. * labels are deleted regardless of type.
*/ */
char *text; /* Text associated with label. If NULL, then char *text) /* Text associated with label. If NULL, then
* labels are deleted regardless of text. * labels are deleted regardless of text.
*/ */
{ {
@ -493,9 +493,9 @@ DBEraseLabelsByContent(def, rect, type, text)
*/ */
void void
DBRemoveLabel(def, refLab) DBRemoveLabel(
CellDef *def; /* Where to look for label to delete. */ CellDef *def, /* Where to look for label to delete. */
Label *refLab; Label *refLab)
{ {
Label *lab, *labPrev; Label *lab, *labPrev;
@ -544,12 +544,12 @@ DBRemoveLabel(def, refLab)
*/ */
void void
DBReOrientLabel(cellDef, area, newPos) DBReOrientLabel(
CellDef *cellDef; /* Cell whose labels are to be modified. */ CellDef *cellDef, /* Cell whose labels are to be modified. */
Rect *area; /* All labels touching this area have their Rect *area, /* All labels touching this area have their
* text positions changed. * text positions changed.
*/ */
int newPos; /* New text positions for all labels in int newPos) /* New text positions for all labels in
* the area, for example, GEO_NORTH. * the area, for example, GEO_NORTH.
*/ */
{ {
@ -584,10 +584,10 @@ DBReOrientLabel(cellDef, area, newPos)
*/ */
int int
dbGetLabelArea(tile, dinfo, area) dbGetLabelArea(
Tile *tile; /* Tile found. */ Tile *tile, /* Tile found. */
TileType dinfo; /* Split tile information (unused) */ TileType dinfo, /* Split tile information (unused) */
Rect *area; /* Area to be modified. */ Rect *area) /* Area to be modified. */
{ {
Rect r; Rect r;
@ -617,10 +617,10 @@ dbGetLabelArea(tile, dinfo, area)
*/ */
int int
dbLabelNotEmpty(tile, dinfo, clientData) dbLabelNotEmpty(
Tile *tile; /* Tile found. */ Tile *tile, /* Tile found. */
TileType dinfo; /* Split tile information (unused) */ TileType dinfo, /* Split tile information (unused) */
ClientData clientData; /* (unused) */ ClientData clientData) /* (unused) */
{ {
return 1; return 1;
} }
@ -648,9 +648,9 @@ dbLabelNotEmpty(tile, dinfo, clientData)
*/ */
void void
DBAdjustLabels(def, area) DBAdjustLabels(
CellDef *def; /* Cell whose paint was changed. */ CellDef *def, /* Cell whose paint was changed. */
Rect *area; /* Area where paint was modified. */ Rect *area) /* Area where paint was modified. */
{ {
Label *lab; Label *lab;
TileType newType; TileType newType;
@ -759,9 +759,9 @@ DBAdjustLabels(def, area)
*/ */
void void
DBAdjustLabelsNew(def, area) DBAdjustLabelsNew(
CellDef *def; /* Cell whose paint was changed. */ CellDef *def, /* Cell whose paint was changed. */
Rect *area; /* Area where paint was modified. */ Rect *area) /* Area where paint was modified. */
{ {
Label *lab, *labPrev; Label *lab, *labPrev;
TileType newType; TileType newType;
@ -863,10 +863,10 @@ TileTypeBitMask *dbAdjustPlaneTypes; /* Mask of all types in current
* plane being searched. * plane being searched.
*/ */
TileType TileType
DBPickLabelLayer(def, lab, doCalma) DBPickLabelLayer(
CellDef *def; /* Cell definition containing label. */ CellDef *def, /* Cell definition containing label. */
Label *lab; /* Label for which a home must be found. */ Label *lab, /* Label for which a home must be found. */
bool doCalma; /* if TRUE, use rules for GDS and LEF */ bool doCalma) /* if TRUE, use rules for GDS and LEF */
{ {
TileTypeBitMask types[3], types2[3]; TileTypeBitMask types[3], types2[3];
Rect check1, check2; Rect check1, check2;
@ -1116,10 +1116,10 @@ DBPickLabelLayer(def, lab, doCalma)
*/ */
int int
dbPickFunc1(tile, dinfo, mask) dbPickFunc1(
Tile *tile; /* Tile found. */ Tile *tile, /* Tile found. */
TileType dinfo; /* Split tile information */ TileType dinfo, /* Split tile information */
TileTypeBitMask *mask; /* Mask to be modified. */ TileTypeBitMask *mask) /* Mask to be modified. */
{ {
TileType type; TileType type;
@ -1143,10 +1143,10 @@ dbPickFunc1(tile, dinfo, mask)
*/ */
int int
dbPickFunc2(tile, dinfo, mask) dbPickFunc2(
Tile *tile; /* Tile found. */ Tile *tile, /* Tile found. */
TileType dinfo; /* Split tile information */ TileType dinfo, /* Split tile information */
TileTypeBitMask *mask; /* Mask to be modified. */ TileTypeBitMask *mask) /* Mask to be modified. */
{ {
TileType type; TileType type;
TileTypeBitMask tmp, *rMask; TileTypeBitMask tmp, *rMask;
@ -1230,9 +1230,9 @@ DBFontInitCurves()
*/ */
void void
CalcBezierPoints(fp, bp) CalcBezierPoints(
FontPath *fp; /* Pointer to last point of closed path */ FontPath *fp, /* Pointer to last point of closed path */
FontPath *bp; /* Pointer to 1st of 3 bezier control points */ FontPath *bp) /* Pointer to 1st of 3 bezier control points */
{ {
FontPath *newPath, *curPath; FontPath *newPath, *curPath;
Point *beginPath, *ctrl1, *ctrl2, *endPath; Point *beginPath, *ctrl1, *ctrl2, *endPath;
@ -1286,8 +1286,8 @@ CalcBezierPoints(fp, bp)
*/ */
char * char *
dbGetToken(ff) dbGetToken(
FILE *ff; FILE *ff)
{ {
static char line[512]; static char line[512];
static char *lineptr = NULL; static char *lineptr = NULL;
@ -1351,8 +1351,8 @@ dbGetToken(ff)
*/ */
void void
DBFontLabelSetBBox(label) DBFontLabelSetBBox(
Label *label; Label *label)
{ {
char *tptr; char *tptr;
Point *coffset, rcenter; Point *coffset, rcenter;
@ -1511,12 +1511,12 @@ DBFontLabelSetBBox(label)
*/ */
int int
DBFontChar(font, ccode, clist, coffset, cbbox) DBFontChar(
int font; /* Index of font */ int font, /* Index of font */
char ccode; /* ASCII character code */ char ccode, /* ASCII character code */
FontChar **clist; /* Return vector list here */ FontChar **clist, /* Return vector list here */
Point **coffset; /* Return position offset here */ Point **coffset, /* Return position offset here */
Rect **cbbox; /* Return bounding box here */ Rect **cbbox) /* Return bounding box here */
{ {
if (font < 0 || font >= DBNumFonts) return - 1; if (font < 0 || font >= DBNumFonts) return - 1;
@ -1548,8 +1548,8 @@ DBFontChar(font, ccode, clist, coffset, cbbox)
*/ */
int int
DBNameToFont(name) DBNameToFont(
char *name; char *name)
{ {
int i; int i;
for (i = 0; i < DBNumFonts; i++) for (i = 0; i < DBNumFonts; i++)
@ -1585,9 +1585,9 @@ DBNameToFont(name)
#define NUMBUF 16 #define NUMBUF 16
int int
DBLoadFont(fontfile, scale) DBLoadFont(
char *fontfile; char *fontfile,
float scale; float scale)
{ {
FILE *ff; FILE *ff;
const char * const ascii_names[] = { const char * const ascii_names[] = {

View File

@ -106,20 +106,20 @@ bool dbParseArray();
*/ */
int int
DBSearchLabel(scx, mask, xMask, pattern, func, cdarg) DBSearchLabel(
SearchContext *scx; /* Search context: specifies CellUse, SearchContext *scx, /* Search context: specifies CellUse,
* transform to "root" coordinates, and * transform to "root" coordinates, and
* an area to search. * an area to search.
*/ */
TileTypeBitMask *mask; /* Only search for labels on these layers */ TileTypeBitMask *mask, /* Only search for labels on these layers */
int xMask; /* Expansion state mask for searching. Cell int xMask, /* Expansion state mask for searching. Cell
* uses are only considered to be expanded * uses are only considered to be expanded
* when their expand masks have all the bits * when their expand masks have all the bits
* of xMask set. * of xMask set.
*/ */
char *pattern; /* Pattern for which to search */ char *pattern, /* Pattern for which to search */
int (*func)(); /* Function to apply to each match */ int (*func)(), /* Function to apply to each match */
ClientData cdarg; /* Argument to pass to function */ ClientData cdarg) /* Argument to pass to function */
{ {
TerminalPath tpath; TerminalPath tpath;
int dbSrLabelFunc(); int dbSrLabelFunc();
@ -160,14 +160,14 @@ DBSearchLabel(scx, mask, xMask, pattern, func, cdarg)
*/ */
int int
dbSrLabelFunc(scx, label, tpath, labsr) dbSrLabelFunc(
SearchContext *scx; /* Contains pointer to use in which label SearchContext *scx, /* Contains pointer to use in which label
* occurred, and transform back to root * occurred, and transform back to root
* coordinates. * coordinates.
*/ */
Label *label; /* Label itself */ Label *label, /* Label itself */
TerminalPath *tpath; /* Full pathname of the terminal */ TerminalPath *tpath, /* Full pathname of the terminal */
labSrStruct *labsr; /* Information passed to this routine */ labSrStruct *labsr) /* Information passed to this routine */
{ {
if (Match(labsr->labSrPattern, label->lab_text)) if (Match(labsr->labSrPattern, label->lab_text))
if ((*labsr->labSrFunc)(scx, label, tpath, labsr->labSrArg)) if ((*labsr->labSrFunc)(scx, label, tpath, labsr->labSrArg))
@ -209,14 +209,14 @@ dbSrLabelFunc(scx, label, tpath, labsr)
*/ */
int int
DBSrLabelLoc(rootUse, name, func, cdarg) DBSrLabelLoc(
CellUse *rootUse; /* Cell in which to search. */ CellUse *rootUse, /* Cell in which to search. */
char *name; /* A hierarchical label name consisting of zero or more char *name, /* A hierarchical label name consisting of zero or more
* use-ids followed by a label name (fields separated * use-ids followed by a label name (fields separated
* with slashes). * with slashes).
*/ */
int (*func)(); /* Applied to each instance of the label name */ int (*func)(), /* Applied to each instance of the label name */
ClientData cdarg; /* Data to pass through to (*func)() */ ClientData cdarg) /* Data to pass through to (*func)() */
{ {
CellDef *def; CellDef *def;
SearchContext scx; SearchContext scx;
@ -273,10 +273,10 @@ DBSrLabelLoc(rootUse, name, func, cdarg)
*/ */
void void
DBTreeFindUse(name, use, scx) DBTreeFindUse(
char *name; char *name,
CellUse *use; CellUse *use,
SearchContext *scx; SearchContext *scx)
{ {
char *cp; char *cp;
HashEntry *he; HashEntry *he;
@ -369,10 +369,10 @@ DBTreeFindUse(name, use, scx)
*/ */
bool bool
dbParseArray(cp, use, scx) dbParseArray(
char *cp; char *cp,
CellUse *use; CellUse *use,
SearchContext *scx; SearchContext *scx)
{ {
int xdelta, ydelta, i1, i2, indexCount; int xdelta, ydelta, i1, i2, indexCount;
Transform trans, trans2; Transform trans, trans2;
@ -491,22 +491,22 @@ dbParseArray(cp, use, scx)
*/ */
bool bool
DBNearestLabel(cellUse, area, point, xMask, labelArea, labelName, length) DBNearestLabel(
CellUse *cellUse; /* Start search at this cell. */ CellUse *cellUse, /* Start search at this cell. */
Rect *area; /* Search this area of cellUse. */ Rect *area, /* Search this area of cellUse. */
Point *point; /* Find nearest label to this point. */ Point *point, /* Find nearest label to this point. */
int xMask; /* Recursively search subcells as long int xMask, /* Recursively search subcells as long
* as their expand masks, when anded with * as their expand masks, when anded with
* xMask, are equal to xMask. 0 means search * xMask, are equal to xMask. 0 means search
* all the way down through the hierarchy. * all the way down through the hierarchy.
*/ */
Rect *labelArea; /* To be filled in with area of closest Rect *labelArea, /* To be filled in with area of closest
* label. NULL means ignore. * label. NULL means ignore.
*/ */
char *labelName; /* Fill this in with name of label, unless char *labelName, /* Fill this in with name of label, unless
* NULL. * NULL.
*/ */
int length; /* This gives the maximum number of chars int length) /* This gives the maximum number of chars
* that may be used in labelName, including * that may be used in labelName, including
* the NULL character to terminate. * the NULL character to terminate.
*/ */
@ -567,11 +567,11 @@ DBNearestLabel(cellUse, area, point, xMask, labelArea, labelName, length)
*/ */
int int
dbNearestLabelFunc(scx, label, tpath, funcData) dbNearestLabelFunc(
SearchContext *scx; /* Describes state of search. */ SearchContext *scx, /* Describes state of search. */
Label *label; /* Label found. */ Label *label, /* Label found. */
TerminalPath *tpath; /* Name of label. */ TerminalPath *tpath, /* Name of label. */
struct nldata *funcData; /* Parameters to DBNearestLabel (passed as struct nldata *funcData) /* Parameters to DBNearestLabel (passed as
* ClientData). * ClientData).
*/ */
{ {

View File

@ -49,7 +49,7 @@ extern UndoType dbUndoIDPaint, dbUndoIDSplit, dbUndoIDJoin;
/* ----------------------- Forward declarations ----------------------- */ /* ----------------------- Forward declarations ----------------------- */
Tile *dbPaintMerge(); Tile *dbPaintMerge(Tile *tile, TileType newType, Rect *area, Plane *plane, int mergeFlags, PaintUndoInfo *undo, bool mark);
Tile *dbMergeType(); Tile *dbMergeType();
Tile *dbPaintMergeVert(); Tile *dbPaintMergeVert();
@ -162,10 +162,10 @@ int dbPaintDebug = 0;
*/ */
void void
dbSplitUndo(tile, splitx, undo) dbSplitUndo(
Tile *tile; Tile *tile,
int splitx; int splitx,
PaintUndoInfo *undo; PaintUndoInfo *undo)
{ {
splitUE *xxsup; splitUE *xxsup;
@ -181,10 +181,10 @@ dbSplitUndo(tile, splitx, undo)
} }
void void
dbJoinUndo(tile, splitx, undo) dbJoinUndo(
Tile *tile; Tile *tile,
int splitx; int splitx,
PaintUndoInfo *undo; PaintUndoInfo *undo)
{ {
splitUE *xxsup; splitUE *xxsup;
@ -239,19 +239,19 @@ dbJoinUndo(tile, splitx, undo)
*/ */
int int
DBPaintPlane0(plane, area, resultTbl, undo, method) DBPaintPlane0(
Plane *plane; /* Plane whose paint is to be modified */ Plane *plane, /* Plane whose paint is to be modified */
Rect *area; /* Area to be changed */ Rect *area, /* Area to be changed */
const PaintResultType *resultTbl; /* Table, indexed by the type of tile already const PaintResultType *resultTbl, /* Table, indexed by the type of tile already
* present in the plane, giving the type to * present in the plane, giving the type to
* which the existing tile must change as a * which the existing tile must change as a
* result of this paint operation. * result of this paint operation.
*/ */
PaintUndoInfo *undo; /* Record containing everything needed to PaintUndoInfo *undo, /* Record containing everything needed to
* save undo entries for this operation. * save undo entries for this operation.
* If NULL, the undo package is not used. * If NULL, the undo package is not used.
*/ */
unsigned char method; /* If PAINT_MARK, the routine marks tiles as it unsigned char method) /* If PAINT_MARK, the routine marks tiles as it
* goes to avoid processing tiles twice. * goes to avoid processing tiles twice.
*/ */
{ {
@ -735,10 +735,10 @@ done2:
*/ */
void void
DBSplitTile(plane, point, splitx) DBSplitTile(
Plane *plane; Plane *plane,
Point *point; Point *point,
int splitx; int splitx)
{ {
Tile *tile, *newtile, *tp; Tile *tile, *newtile, *tp;
tile = PlaneGetHint(plane); tile = PlaneGetHint(plane);
@ -785,13 +785,13 @@ DBSplitTile(plane, point, splitx)
*/ */
void void
DBFracturePlane(plane, area, resultTbl, undo) DBFracturePlane(
Plane *plane; /* Plane whose paint is to be modified */ Plane *plane, /* Plane whose paint is to be modified */
Rect *area; /* Area to be changed */ Rect *area, /* Area to be changed */
const PaintResultType *resultTbl; /* Paint table, to pinpoint those tiles const PaintResultType *resultTbl, /* Paint table, to pinpoint those tiles
* that interact with the paint type. * that interact with the paint type.
*/ */
PaintUndoInfo *undo; /* Record containing everything needed to PaintUndoInfo *undo) /* Record containing everything needed to
* save undo entries for this operation. * save undo entries for this operation.
* If NULL, the undo package is not used. * If NULL, the undo package is not used.
*/ */
@ -1044,11 +1044,11 @@ done:
*/ */
int int
DBMergeNMTiles0(plane, area, undo, mergeOnce) DBMergeNMTiles0(
Plane *plane; Plane *plane,
Rect *area; Rect *area,
PaintUndoInfo *undo; PaintUndoInfo *undo,
bool mergeOnce; bool mergeOnce)
{ {
Point start; Point start;
int clipTop; int clipTop;
@ -1357,9 +1357,9 @@ nmdone:
*/ */
int int
DBDiagonalProc(oldtype, dinfo) DBDiagonalProc(
TileType oldtype; TileType oldtype,
DiagInfo *dinfo; DiagInfo *dinfo)
{ {
TileType old_n, old_s, old_e, old_w; TileType old_n, old_s, old_e, old_w;
TileType new_n, new_s, new_e, new_w; TileType new_n, new_s, new_e, new_w;
@ -1816,10 +1816,10 @@ nextrect:
*/ */
int int
dbNMEnumFunc(tile, dinfo, arg) dbNMEnumFunc(
Tile *tile; Tile *tile,
TileType dinfo; TileType dinfo,
LinkedRect **arg; LinkedRect **arg)
{ {
LinkedRect *lr; LinkedRect *lr;
@ -1849,9 +1849,9 @@ dbNMEnumFunc(tile, dinfo, arg)
*/ */
void void
dbMarkClient(tile, clip) dbMarkClient(
Tile *tile; Tile *tile,
Rect *clip; Rect *clip)
{ {
if (LEFT(tile) < clip->r_xtop && if (LEFT(tile) < clip->r_xtop &&
RIGHT(tile) > clip->r_xbot && RIGHT(tile) > clip->r_xbot &&
@ -1899,14 +1899,14 @@ dbMarkClient(tile, clip)
*/ */
Tile * Tile *
dbPaintMerge(tile, newType, area, plane, mergeFlags, undo, mark) dbPaintMerge(
Tile *tile; /* Tile to be merged with its neighbors */ Tile *tile, /* Tile to be merged with its neighbors */
TileType newType; /* Type to which we will change 'tile' */ TileType newType, /* Type to which we will change 'tile' */
Rect *area; /* Original area painted, needed for marking */ Rect *area, /* Original area painted, needed for marking */
Plane *plane; /* Plane on which this resides */ Plane *plane, /* Plane on which this resides */
int mergeFlags; /* Specify which directions to merge */ int mergeFlags, /* Specify which directions to merge */
PaintUndoInfo *undo; /* See DBPaintPlane() above */ PaintUndoInfo *undo, /* See DBPaintPlane() above */
bool mark; /* Mark tiles that were processed */ bool mark) /* Mark tiles that were processed */
{ {
Tile *delayed = NULL; /* delayed free to extend lifetime */ Tile *delayed = NULL; /* delayed free to extend lifetime */
Tile *tp, *tpLast; Tile *tp, *tpLast;
@ -2086,20 +2086,20 @@ dbPaintMerge(tile, newType, area, plane, mergeFlags, undo, mark)
*/ */
void void
DBPaintType(plane, area, resultTbl, client, undo, tileMask) DBPaintType(
Plane *plane; /* Plane whose paint is to be modified */ Plane *plane, /* Plane whose paint is to be modified */
Rect *area; /* Area to be changed */ Rect *area, /* Area to be changed */
const PaintResultType *resultTbl; /* Table, indexed by the type of tile already const PaintResultType *resultTbl, /* Table, indexed by the type of tile already
* present in the plane, giving the type to * present in the plane, giving the type to
* which the existing tile must change as a * which the existing tile must change as a
* result of this paint operation. * result of this paint operation.
*/ */
ClientData client; /* ClientData for tile */ ClientData client, /* ClientData for tile */
PaintUndoInfo *undo; /* Record containing everything needed to PaintUndoInfo *undo, /* Record containing everything needed to
* save undo entries for this operation. * save undo entries for this operation.
* If NULL, the undo package is not used. * If NULL, the undo package is not used.
*/ */
TileTypeBitMask *tileMask; /* Mask of un-mergable tile types */ TileTypeBitMask *tileMask) /* Mask of un-mergable tile types */
{ {
Point start; Point start;
int clipTop, mergeFlags; int clipTop, mergeFlags;
@ -2399,13 +2399,13 @@ done:
*/ */
Tile * Tile *
dbMergeType(tile, newType, plane, mergeFlags, undo, client) dbMergeType(
Tile *tile; /* Tile to be merged with its neighbors */ Tile *tile, /* Tile to be merged with its neighbors */
TileType newType; /* Type to which we will change 'tile' */ TileType newType, /* Type to which we will change 'tile' */
Plane *plane; /* Plane on which this resides */ Plane *plane, /* Plane on which this resides */
int mergeFlags; /* Specify which directions to merge */ int mergeFlags, /* Specify which directions to merge */
PaintUndoInfo *undo; /* See DBPaintPlane() above */ PaintUndoInfo *undo, /* See DBPaintPlane() above */
ClientData client; ClientData client)
{ {
Tile *delayed = NULL; /* delayed free to extend lifetime */ Tile *delayed = NULL; /* delayed free to extend lifetime */
Tile *tp, *tpLast; Tile *tp, *tpLast;
@ -2581,15 +2581,15 @@ dbMergeType(tile, newType, plane, mergeFlags, undo, client)
*/ */
int int
DBPaintPlaneVert(plane, area, resultTbl, undo) DBPaintPlaneVert(
Plane *plane; /* Plane whose paint is to be modified */ Plane *plane, /* Plane whose paint is to be modified */
Rect *area; /* Area to be changed */ Rect *area, /* Area to be changed */
const PaintResultType *resultTbl; /* Table, indexed by the type of tile already const PaintResultType *resultTbl, /* Table, indexed by the type of tile already
* present in the plane, giving the type to * present in the plane, giving the type to
* which the existing tile must change as a * which the existing tile must change as a
* result of this paint operation. * result of this paint operation.
*/ */
PaintUndoInfo *undo; /* Record containing everything needed to PaintUndoInfo *undo) /* Record containing everything needed to
* save undo entries for this operation. * save undo entries for this operation.
* If NULL, the undo package is not used. * If NULL, the undo package is not used.
*/ */
@ -2873,12 +2873,12 @@ done:
*/ */
Tile * Tile *
dbPaintMergeVert(tile, newType, plane, mergeFlags, undo) dbPaintMergeVert(
Tile *tile; /* Tile to be merged with its neighbors */ Tile *tile, /* Tile to be merged with its neighbors */
TileType newType; /* Type to which we will change 'tile' */ TileType newType, /* Type to which we will change 'tile' */
Plane *plane; /* Plane on which this resides */ Plane *plane, /* Plane on which this resides */
int mergeFlags; /* Specify which directions to merge */ int mergeFlags, /* Specify which directions to merge */
PaintUndoInfo *undo; /* See DBPaintPlane() above */ PaintUndoInfo *undo) /* See DBPaintPlane() above */
{ {
Tile *delayed = NULL; /* delayed free to extend lifetime */ Tile *delayed = NULL; /* delayed free to extend lifetime */
Tile *tp, *tpLast; Tile *tp, *tpLast;
@ -3040,10 +3040,10 @@ dbPaintMergeVert(tile, newType, plane, mergeFlags, undo)
#include "utils/styles.h" #include "utils/styles.h"
void void
dbPaintShowTile(tile, undo, str) dbPaintShowTile(
Tile *tile; /* Tile to be highlighted */ Tile *tile, /* Tile to be highlighted */
PaintUndoInfo *undo; /* Cell to which tile belongs is undo->pu_def */ PaintUndoInfo *undo, /* Cell to which tile belongs is undo->pu_def */
char *str; /* Message to be displayed */ char *str) /* Message to be displayed */
{ {
char answer[100]; char answer[100];
Rect r; Rect r;
@ -3099,12 +3099,12 @@ dbPaintShowTile(tile, undo, str)
*/ */
bool bool
TiNMSplitY(oldtile, newtile, y, dir, undo) TiNMSplitY(
Tile **oldtile; /* Tile to be split */ Tile **oldtile, /* Tile to be split */
Tile **newtile; /* Tile to be generated */ Tile **newtile, /* Tile to be generated */
int y; /* Y coordinate of split */ int y, /* Y coordinate of split */
int dir; /* 1: new tile on top, 0: new tile on bottom */ int dir, /* 1: new tile on top, 0: new tile on bottom */
PaintUndoInfo *undo; /* Undo record */ PaintUndoInfo *undo) /* Undo record */
{ {
long tmpdx; long tmpdx;
int x, delx, height; int x, delx, height;
@ -3228,12 +3228,12 @@ TiNMSplitY(oldtile, newtile, y, dir, undo)
*/ */
bool bool
TiNMSplitX(oldtile, newtile, x, dir, undo) TiNMSplitX(
Tile **oldtile; /* Tile to be split */ Tile **oldtile, /* Tile to be split */
Tile **newtile; /* Tile to be generated */ Tile **newtile, /* Tile to be generated */
int x; /* X coordinate of split */ int x, /* X coordinate of split */
int dir; /* 1: new tile on right, 0: new tile on left */ int dir, /* 1: new tile on right, 0: new tile on left */
PaintUndoInfo *undo; /* Undo record */ PaintUndoInfo *undo) /* Undo record */
{ {
long tmpdy; long tmpdy;
int y, dely, width; int y, dely, width;
@ -3355,9 +3355,9 @@ TiNMSplitX(oldtile, newtile, x, dir, undo)
*/ */
Tile * Tile *
TiNMMergeRight(tile, plane) TiNMMergeRight(
Tile *tile; Tile *tile,
Plane *plane; Plane *plane)
{ {
Tile *delayed = NULL; /* delayed free to extend lifetime */ Tile *delayed = NULL; /* delayed free to extend lifetime */
TileType ttype = TiGetTypeExact(tile); TileType ttype = TiGetTypeExact(tile);
@ -3438,9 +3438,9 @@ TiNMMergeRight(tile, plane)
*/ */
Tile * Tile *
TiNMMergeLeft(tile, plane) TiNMMergeLeft(
Tile *tile; Tile *tile,
Plane *plane; Plane *plane)
{ {
Tile *delayed = NULL; /* delayed free to extend lifetime */ Tile *delayed = NULL; /* delayed free to extend lifetime */
TileType ttype = TiGetTypeExact(tile); TileType ttype = TiGetTypeExact(tile);

View File

@ -46,10 +46,10 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
*/ */
void void
DBPaint (cellDef, rect, type) DBPaint(
CellDef * cellDef; /* CellDef to modify */ CellDef * cellDef, /* CellDef to modify */
Rect * rect; /* Area to paint */ Rect * rect, /* Area to paint */
TileType type; /* Type of tile to be painted */ TileType type) /* Type of tile to be painted */
{ {
int pNum; int pNum;
PaintUndoInfo ui; PaintUndoInfo ui;
@ -119,10 +119,10 @@ DBPaint (cellDef, rect, type)
*/ */
int int
dbResolveImages(tile, dinfo, cellDef) dbResolveImages(
Tile *tile; Tile *tile,
TileType dinfo; TileType dinfo,
CellDef *cellDef; CellDef *cellDef)
{ {
Rect rect; Rect rect;
@ -153,10 +153,10 @@ dbResolveImages(tile, dinfo, cellDef)
*/ */
void void
DBErase (cellDef, rect, type) DBErase(
CellDef * cellDef; /* Cell to modify */ CellDef * cellDef, /* Cell to modify */
Rect * rect; /* Area to paint */ Rect * rect, /* Area to paint */
TileType type; /* Type of tile to be painted */ TileType type) /* Type of tile to be painted */
{ {
int pNum; int pNum;
PaintUndoInfo ui; PaintUndoInfo ui;
@ -225,10 +225,10 @@ DBErase (cellDef, rect, type)
*/ */
void void
DBPaintMask(cellDef, rect, mask) DBPaintMask(
CellDef *cellDef; /* CellDef to modify */ CellDef *cellDef, /* CellDef to modify */
Rect *rect; /* Area to paint */ Rect *rect, /* Area to paint */
TileTypeBitMask *mask; /* Mask of types to be erased */ TileTypeBitMask *mask) /* Mask of types to be erased */
{ {
TileType t; TileType t;
@ -253,11 +253,11 @@ DBPaintMask(cellDef, rect, mask)
*/ */
void void
DBPaintValid(cellDef, rect, mask, dinfo) DBPaintValid(
CellDef *cellDef; /* CellDef to modify */ CellDef *cellDef, /* CellDef to modify */
Rect *rect; /* Area to paint */ Rect *rect, /* Area to paint */
TileTypeBitMask *mask; /* Mask of types to be erased */ TileTypeBitMask *mask, /* Mask of types to be erased */
TileType dinfo; /* If non-zero, then rect is a triangle and TileType dinfo) /* If non-zero, then rect is a triangle and
* dinfo contains side and direction information * dinfo contains side and direction information
*/ */
{ {
@ -331,10 +331,10 @@ DBPaintValid(cellDef, rect, mask, dinfo)
*/ */
void void
DBEraseMask(cellDef, rect, mask) DBEraseMask(
CellDef *cellDef; /* CellDef to modify */ CellDef *cellDef, /* CellDef to modify */
Rect *rect; /* Area to erase */ Rect *rect, /* Area to erase */
TileTypeBitMask *mask; /* Mask of types to be erased */ TileTypeBitMask *mask) /* Mask of types to be erased */
{ {
TileType t; TileType t;
@ -363,11 +363,11 @@ DBEraseMask(cellDef, rect, mask)
*/ */
void void
DBEraseValid(cellDef, rect, mask, dinfo) DBEraseValid(
CellDef *cellDef; /* CellDef to modify */ CellDef *cellDef, /* CellDef to modify */
Rect *rect; /* Area to erase */ Rect *rect, /* Area to erase */
TileTypeBitMask *mask; /* Mask of types to be erased */ TileTypeBitMask *mask, /* Mask of types to be erased */
TileType dinfo; /* w/Non-Manhattan geometry, "rect" is a TileType dinfo) /* w/Non-Manhattan geometry, "rect" is a
* triangle and dinfo holds side & direction * triangle and dinfo holds side & direction
*/ */
{ {

View File

@ -59,7 +59,7 @@ LayerInfo *dbContactInfo[NT];
int dbNumContacts; int dbNumContacts;
/* Forward declaration */ /* Forward declaration */
void dbTechMatchResidues(); void dbTechMatchResidues(TileTypeBitMask *inMask, TileTypeBitMask *outMask, bool contactsOnly);
void dbTechAddStackedContacts(); void dbTechAddStackedContacts();
int dbTechAddOneStackedContact(); int dbTechAddOneStackedContact();
@ -166,10 +166,10 @@ DBTechInitContact()
*/ */
bool bool
DBTechAddContact(sectionName, argc, argv) DBTechAddContact(
char *sectionName; char *sectionName,
int argc; int argc,
char *argv[]; char *argv[])
{ {
TileType contactType; TileType contactType;
int nresidues; int nresidues;
@ -335,8 +335,9 @@ dbTechAddStackedContacts()
*/ */
int int
dbTechAddOneStackedContact(type1, type2) dbTechAddOneStackedContact(
TileType type1, type2; TileType type1,
TileType type2)
{ {
LayerInfo *lim, *lin, *lp; LayerInfo *lim, *lin, *lp;
TileTypeBitMask ttshared, ttall, mmask; TileTypeBitMask ttshared, ttall, mmask;
@ -438,9 +439,9 @@ dbTechAddOneStackedContact(type1, type2)
*/ */
TileType TileType
DBPlaneToResidue(type, plane) DBPlaneToResidue(
TileType type; TileType type,
int plane; int plane)
{ {
TileType rt, rt2; TileType rt, rt2;
LayerInfo *lp = &dbLayerInfo[type], *lr; LayerInfo *lp = &dbLayerInfo[type], *lr;
@ -475,8 +476,8 @@ DBPlaneToResidue(type, plane)
*/ */
void void
DBMaskAddStacking(mask) DBMaskAddStacking(
TileTypeBitMask *mask; TileTypeBitMask *mask)
{ {
TileType ttype; TileType ttype;
TileTypeBitMask *rMask; TileTypeBitMask *rMask;
@ -511,10 +512,10 @@ DBMaskAddStacking(mask)
*/ */
int int
dbTechContactResidues(argc, argv, contactType) dbTechContactResidues(
int argc; int argc,
char **argv; char **argv,
TileType contactType; TileType contactType)
{ {
int homePlane, residuePlane, nresidues; int homePlane, residuePlane, nresidues;
PlaneMask pMask; PlaneMask pMask;
@ -653,9 +654,10 @@ dbTechContactResidues(argc, argv, contactType)
*/ */
void void
dbTechMatchResidues(inMask, outMask, contactsOnly) dbTechMatchResidues(
TileTypeBitMask *inMask, *outMask; TileTypeBitMask *inMask,
bool contactsOnly; TileTypeBitMask *outMask,
bool contactsOnly)
{ {
TileType type; TileType type;
LayerInfo *li; LayerInfo *li;
@ -691,8 +693,9 @@ dbTechMatchResidues(inMask, outMask, contactsOnly)
*/ */
TileType TileType
DBTechFindStacking(type1, type2) DBTechFindStacking(
TileType type1, type2; TileType type1,
TileType type2)
{ {
TileType rtype, rtype1, rtype2, stackType; TileType rtype, rtype1, rtype2, stackType;
LayerInfo *li; LayerInfo *li;
@ -821,9 +824,9 @@ DBTechFinalContact()
*/ */
bool bool
DBTechTypesOnPlane(src, plane) DBTechTypesOnPlane(
TileTypeBitMask *src; TileTypeBitMask *src,
int plane; int plane)
{ {
int i; int i;
PlaneMask pmask; PlaneMask pmask;
@ -856,8 +859,9 @@ DBTechTypesOnPlane(src, plane)
*/ */
TileType TileType
DBTechGetContact(type1, type2) DBTechGetContact(
TileType type1, type2; TileType type1,
TileType type2)
{ {
int pmask; int pmask;
LayerInfo *lp; LayerInfo *lp;
@ -888,8 +892,8 @@ DBTechGetContact(type1, type2)
*/ */
bool bool
DBIsContact(type) DBIsContact(
TileType type; TileType type)
{ {
if (IsContact(type)) return TRUE; if (IsContact(type)) return TRUE;
return FALSE; return FALSE;
@ -907,8 +911,8 @@ DBIsContact(type)
*/ */
PlaneMask PlaneMask
DBLayerPlanes(type) DBLayerPlanes(
TileType type; TileType type)
{ {
return LayerPlaneMask(type); return LayerPlaneMask(type);
} }
@ -924,8 +928,8 @@ DBLayerPlanes(type)
*/ */
TileTypeBitMask * TileTypeBitMask *
DBResidueMask(type) DBResidueMask(
TileType type; TileType type)
{ {
LayerInfo *li = &dbLayerInfo[type]; LayerInfo *li = &dbLayerInfo[type];
return (&li->l_residues); return (&li->l_residues);
@ -949,9 +953,9 @@ DBResidueMask(type)
*/ */
void void
DBFullResidueMask(type, rmask) DBFullResidueMask(
TileType type; TileType type,
TileTypeBitMask *rmask; TileTypeBitMask *rmask)
{ {
TileType t; TileType t;
TileTypeBitMask *lmask; TileTypeBitMask *lmask;

View File

@ -101,10 +101,10 @@ DBTechInit()
/*ARGSUSED*/ /*ARGSUSED*/
bool bool
DBTechSetTech(sectionName, argc, argv) DBTechSetTech(
char *sectionName; char *sectionName,
int argc; int argc,
char *argv[]; char *argv[])
{ {
if (argc != 1) if (argc != 1)
{ {
@ -169,10 +169,10 @@ DBTechInitVersion()
/*ARGSUSED*/ /*ARGSUSED*/
bool bool
DBTechSetVersion(sectionName, argc, argv) DBTechSetVersion(
char *sectionName; char *sectionName,
int argc; int argc,
char *argv[]; char *argv[])
{ {
char *contline; char *contline;
int n, slen; int n, slen;
@ -307,10 +307,10 @@ DBTechInitConnect()
/*ARGSUSED*/ /*ARGSUSED*/
bool bool
DBTechAddConnect(sectionName, argc, argv) DBTechAddConnect(
char *sectionName; char *sectionName,
int argc; int argc,
char *argv[]; char *argv[])
{ {
TileTypeBitMask types1, types2; TileTypeBitMask types1, types2;
TileType t1, t2; TileType t1, t2;

View File

@ -61,8 +61,8 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
*/ */
TileType TileType
DBTechNameType(typename) DBTechNameType(
char *typename; /* The name of the type */ char *typename) /* The name of the type */
{ {
char *slash; char *slash;
TileType type; TileType type;
@ -121,8 +121,8 @@ DBTechNameType(typename)
} }
TileType TileType
DBTechNameTypeExact(typename) DBTechNameTypeExact(
char *typename; /* The name of the type */ char *typename) /* The name of the type */
{ {
char *slash; char *slash;
ClientData result; ClientData result;
@ -148,9 +148,9 @@ DBTechNameTypeExact(typename)
*/ */
TileType TileType
DBTechNameTypes(typename, bitmask) DBTechNameTypes(
char *typename; /* The name of the type */ char *typename, /* The name of the type */
TileTypeBitMask *bitmask; TileTypeBitMask *bitmask)
{ {
char *slash; char *slash;
TileType type; TileType type;
@ -223,8 +223,8 @@ DBTechNameTypes(typename, bitmask)
*/ */
TileType TileType
DBTechNoisyNameType(typename) DBTechNoisyNameType(
char *typename; /* The name of the type */ char *typename) /* The name of the type */
{ {
TileType type; TileType type;
@ -262,8 +262,8 @@ DBTechNoisyNameType(typename)
*/ */
int int
DBTechNamePlane(planename) DBTechNamePlane(
char *planename; /* The name of the plane */ char *planename) /* The name of the plane */
{ {
return ((spointertype) dbTechNameLookup(planename, &dbPlaneNameLists)); return ((spointertype) dbTechNameLookup(planename, &dbPlaneNameLists));
} }
@ -287,8 +287,8 @@ DBTechNamePlane(planename)
*/ */
int int
DBTechNoisyNamePlane(planename) DBTechNoisyNamePlane(
char *planename; /* The name of the plane */ char *planename) /* The name of the plane */
{ {
int pNum; int pNum;
@ -387,8 +387,8 @@ DBPlaneShortName(
*/ */
PlaneMask PlaneMask
DBTechTypesToPlanes(mask) DBTechTypesToPlanes(
TileTypeBitMask *mask; TileTypeBitMask *mask)
{ {
TileType t; TileType t;
PlaneMask planeMask, noCellMask, retMask; PlaneMask planeMask, noCellMask, retMask;
@ -430,9 +430,9 @@ DBTechTypesToPlanes(mask)
*/ */
void void
DBTechPrintTypes(mask, dolist) DBTechPrintTypes(
TileTypeBitMask *mask; /* Print layers defined by this mask. */ TileTypeBitMask *mask, /* Print layers defined by this mask. */
bool dolist; /* return as a list and don't print aliases */ bool dolist) /* return as a list and don't print aliases */
{ {
TileType i; TileType i;
NameList *p; NameList *p;
@ -595,10 +595,10 @@ DBTechPrintTypes(mask, dolist)
*/ */
PlaneMask PlaneMask
DBTechNameMask0(layers, mask, noisy) DBTechNameMask0(
char *layers; /* String to be parsed. */ char *layers, /* String to be parsed. */
TileTypeBitMask *mask; /* Where to store the layer mask. */ TileTypeBitMask *mask, /* Where to store the layer mask. */
bool noisy; /* Whether or not to output errors */ bool noisy) /* Whether or not to output errors */
{ {
char *p, *p2, c; char *p, *p2, c;
TileTypeBitMask m2; /* Each time around the loop, we will TileTypeBitMask m2; /* Each time around the loop, we will
@ -788,17 +788,17 @@ DBTechNameMask0(layers, mask, noisy)
/* Wrappers for DBTechNameMask0() */ /* Wrappers for DBTechNameMask0() */
PlaneMask PlaneMask
DBTechNoisyNameMask(layers, mask) DBTechNoisyNameMask(
char *layers; /* String to be parsed. */ char *layers, /* String to be parsed. */
TileTypeBitMask *mask; /* Where to store the layer mask. */ TileTypeBitMask *mask) /* Where to store the layer mask. */
{ {
return DBTechNameMask0(layers, mask, TRUE); return DBTechNameMask0(layers, mask, TRUE);
} }
PlaneMask PlaneMask
DBTechNameMask(layers, mask) DBTechNameMask(
char *layers; /* String to be parsed. */ char *layers, /* String to be parsed. */
TileTypeBitMask *mask; /* Where to store the layer mask. */ TileTypeBitMask *mask) /* Where to store the layer mask. */
{ {
return DBTechNameMask0(layers, mask, FALSE); return DBTechNameMask0(layers, mask, FALSE);
} }

View File

@ -96,7 +96,7 @@ DefaultType dbTechDefaultTypes[] =
/* Forward declarations */ /* Forward declarations */
char *dbTechNameAdd(); char *dbTechNameAdd();
NameList *dbTechNameAddOne(); NameList *dbTechNameAddOne(char *name, ClientData cdata, bool isPrimary, bool isAlias, NameList *ptable);
/* /*
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
@ -312,10 +312,10 @@ DBTechAddPlane(
*/ */
void void
DBTechAddNameToType(newname, ttype, canonical) DBTechAddNameToType(
char *newname; char *newname,
TileType ttype; TileType ttype,
bool canonical; bool canonical)
{ {
char *cp; char *cp;
@ -343,10 +343,10 @@ DBTechAddNameToType(newname, ttype, canonical)
*/ */
bool bool
DBTechAddAlias(sectionName, argc, argv) DBTechAddAlias(
char *sectionName; char *sectionName,
int argc; int argc,
char *argv[]; char *argv[])
{ {
char *cp; char *cp;
int pNum; int pNum;
@ -419,10 +419,10 @@ DBTechAddAlias(sectionName, argc, argv)
/*ARGSUSED*/ /*ARGSUSED*/
bool bool
DBTechAddType(sectionName, argc, argv) DBTechAddType(
char *sectionName; char *sectionName,
int argc; int argc,
char *argv[]; char *argv[])
{ {
char *cp; char *cp;
int pNum; int pNum;
@ -504,8 +504,9 @@ DBTechAddType(sectionName, argc, argv)
*/ */
TileType TileType
dbTechNewStackedType(type1, type2) dbTechNewStackedType(
TileType type1, type2; TileType type1,
TileType type2)
{ {
char buf[1024], *cp; char buf[1024], *cp;
@ -615,9 +616,9 @@ DBTechFinalType()
*/ */
ClientData ClientData
dbTechNameLookupExact(str, table) dbTechNameLookupExact(
char *str; /* The name to be looked up */ char *str, /* The name to be looked up */
NameList *table; /* Table of names to search */ NameList *table) /* Table of names to search */
{ {
NameList *top; NameList *top;
@ -650,9 +651,9 @@ dbTechNameLookupExact(str, table)
*/ */
ClientData ClientData
dbTechNameLookup(str, table) dbTechNameLookup(
char *str; /* The name to be looked up */ char *str, /* The name to be looked up */
NameList *table; /* Table of names to search */ NameList *table) /* Table of names to search */
{ {
/* /*
* The search is carried out by using two pointers, one which moves * The search is carried out by using two pointers, one which moves
@ -734,11 +735,11 @@ dbTechNameLookup(str, table)
*/ */
char * char *
dbTechNameAdd(name, cdata, ptable, alias) dbTechNameAdd(
char *name; /* Comma-separated list of names to be added */ char *name, /* Comma-separated list of names to be added */
ClientData cdata; /* Value to be stored with each name above */ ClientData cdata, /* Value to be stored with each name above */
NameList *ptable; /* Table to which we will add names */ NameList *ptable, /* Table to which we will add names */
int alias; /* 1 if this is an alias (never make primary) */ int alias) /* 1 if this is an alias (never make primary) */
{ {
char *cp; char *cp;
char onename[BUFSIZ]; char onename[BUFSIZ];
@ -797,12 +798,12 @@ dbTechNameAdd(name, cdata, ptable, alias)
*/ */
NameList * NameList *
dbTechNameAddOne(name, cdata, isPrimary, isAlias, ptable) dbTechNameAddOne(
char *name; /* Name to be added */ char *name, /* Name to be added */
ClientData cdata; /* Client value associated with this name */ ClientData cdata, /* Client value associated with this name */
bool isPrimary; /* TRUE if this is the primary abbreviation */ bool isPrimary, /* TRUE if this is the primary abbreviation */
bool isAlias; /* TRUE if this name is an alias */ bool isAlias, /* TRUE if this name is an alias */
NameList *ptable; /* Table of names to which we're adding this */ NameList *ptable) /* Table of names to which we're adding this */
{ {
int cmp; int cmp;
NameList *tbl, *new; NameList *tbl, *new;

View File

@ -374,28 +374,28 @@ DBTestNMInteract(Rect *rect1,
#define IGNORE_RIGHT 2 #define IGNORE_RIGHT 2
int int
DBSrPaintNMArea(hintTile, plane, ttype, rect, mask, func, arg) DBSrPaintNMArea(
Tile *hintTile; /* Tile at which to begin search, if not NULL. Tile *hintTile, /* Tile at which to begin search, if not NULL.
* If this is NULL, use the hint tile supplied * If this is NULL, use the hint tile supplied
* with plane. * with plane.
*/ */
Plane *plane; /* Plane in which tiles lie. This is used to Plane *plane, /* Plane in which tiles lie. This is used to
* provide a hint tile in case hintTile == NULL. * provide a hint tile in case hintTile == NULL.
* The hint tile in the plane is updated to be * The hint tile in the plane is updated to be
* the last tile visited in the area * the last tile visited in the area
* enumeration, if plane is non-NULL. * enumeration, if plane is non-NULL.
*/ */
TileType ttype; /* Information about the non-manhattan area to TileType ttype, /* Information about the non-manhattan area to
* search; zero if area is manhattan. * search; zero if area is manhattan.
*/ */
Rect *rect; /* Area to search. This area should not be Rect *rect, /* Area to search. This area should not be
* degenerate. Tiles must OVERLAP the area. * degenerate. Tiles must OVERLAP the area.
*/ */
TileTypeBitMask *mask; /* Mask of those paint tiles to be passed to TileTypeBitMask *mask, /* Mask of those paint tiles to be passed to
* func. * func.
*/ */
int (*func)(); /* Function to apply at each tile */ int (*func)(), /* Function to apply at each tile */
ClientData arg; /* Additional argument to pass to (*func)() */ ClientData arg) /* Additional argument to pass to (*func)() */
{ {
Point start; Point start;
Tile *tp, *tpnew; Tile *tp, *tpnew;
@ -518,25 +518,25 @@ enum_next:
*/ */
int int
DBSrPaintArea(hintTile, plane, rect, mask, func, arg) DBSrPaintArea(
Tile *hintTile; /* Tile at which to begin search, if not NULL. Tile *hintTile, /* Tile at which to begin search, if not NULL.
* If this is NULL, use the hint tile supplied * If this is NULL, use the hint tile supplied
* with plane. * with plane.
*/ */
Plane *plane; /* Plane in which tiles lie. This is used to Plane *plane, /* Plane in which tiles lie. This is used to
* provide a hint tile in case hintTile == NULL. * provide a hint tile in case hintTile == NULL.
* The hint tile in the plane is updated to be * The hint tile in the plane is updated to be
* the last tile visited in the area * the last tile visited in the area
* enumeration. * enumeration.
*/ */
Rect *rect; /* Area to search. This area should not be Rect *rect, /* Area to search. This area should not be
* degenerate. Tiles must OVERLAP the area. * degenerate. Tiles must OVERLAP the area.
*/ */
TileTypeBitMask *mask; /* Mask of those paint tiles to be passed to TileTypeBitMask *mask, /* Mask of those paint tiles to be passed to
* func. * func.
*/ */
int (*func)(); /* Function to apply at each tile */ int (*func)(), /* Function to apply at each tile */
ClientData arg; /* Additional argument to pass to (*func)() */ ClientData arg) /* Additional argument to pass to (*func)() */
{ {
Point start; Point start;
Tile *tp, *tpnew; Tile *tp, *tpnew;
@ -672,28 +672,28 @@ enumerate:
*/ */
int int
DBSrPaintClient(hintTile, plane, rect, mask, client, func, arg) DBSrPaintClient(
Tile *hintTile; /* Tile at which to begin search, if not NULL. Tile *hintTile, /* Tile at which to begin search, if not NULL.
* If this is NULL, use the hint tile supplied * If this is NULL, use the hint tile supplied
* with plane. * with plane.
*/ */
Plane *plane; /* Plane in which tiles lie. This is used to Plane *plane, /* Plane in which tiles lie. This is used to
* provide a hint tile in case hintTile == NULL. * provide a hint tile in case hintTile == NULL.
* The hint tile in the plane is updated to be * The hint tile in the plane is updated to be
* the last tile visited in the area * the last tile visited in the area
* enumeration. * enumeration.
*/ */
Rect *rect; /* Area to search. This area should not be Rect *rect, /* Area to search. This area should not be
* degenerate. Tiles must OVERLAP the area. * degenerate. Tiles must OVERLAP the area.
*/ */
TileTypeBitMask *mask; /* Mask of those paint tiles to be passed to TileTypeBitMask *mask, /* Mask of those paint tiles to be passed to
* func. * func.
*/ */
ClientData client; /* The ti_client field of each tile must ClientData client, /* The ti_client field of each tile must
* match this. * match this.
*/ */
int (*func)(); /* Function to apply at each tile */ int (*func)(), /* Function to apply at each tile */
ClientData arg; /* Additional argument to pass to (*func)() */ ClientData arg) /* Additional argument to pass to (*func)() */
{ {
Point start; Point start;
Tile *tp, *tpnew; Tile *tp, *tpnew;
@ -817,9 +817,9 @@ enumerate:
*/ */
void void
DBResetTilePlane(plane, cdata) DBResetTilePlane(
Plane *plane; /* Plane whose tiles are to be reset */ Plane *plane, /* Plane whose tiles are to be reset */
ClientData cdata; ClientData cdata)
{ {
Tile *tp, *tpnew; Tile *tp, *tpnew;
const Rect *rect = &TiPlaneRect; const Rect *rect = &TiPlaneRect;
@ -890,9 +890,9 @@ enumerate:
*/ */
void void
DBResetTilePlaneSpecial(plane, cdata) DBResetTilePlaneSpecial(
Plane *plane; /* Plane whose tiles are to be reset */ Plane *plane, /* Plane whose tiles are to be reset */
ClientData cdata; ClientData cdata)
{ {
Tile *tp, *tpnew; Tile *tp, *tpnew;
const Rect *rect = &TiPlaneRect; const Rect *rect = &TiPlaneRect;
@ -976,8 +976,8 @@ enumerate:
*/ */
void void
DBFreePaintPlane(plane) DBFreePaintPlane(
Plane *plane; /* Plane whose storage is to be freed */ Plane *plane) /* Plane whose storage is to be freed */
{ {
Tile *tp, *tpnew; Tile *tp, *tpnew;
const Rect *rect = &TiPlaneRect; const Rect *rect = &TiPlaneRect;
@ -1046,8 +1046,8 @@ enumerate:
*/ */
void void
DBClearCellPlane(def) DBClearCellPlane(
CellDef *def; CellDef *def)
{ {
int dbDeleteCellUse(); /* Forward reference */ int dbDeleteCellUse(); /* Forward reference */
@ -1142,11 +1142,11 @@ int dbDeleteCellUse(CellUse *use, ClientData arg)
*/ */
int int
DBCheckMaxHStrips(plane, area, proc, cdata) DBCheckMaxHStrips(
Plane *plane; /* Search this plane */ Plane *plane, /* Search this plane */
Rect *area; /* Process all tiles in this area */ Rect *area, /* Process all tiles in this area */
int (*proc)(); /* Filter procedure: see above */ int (*proc)(), /* Filter procedure: see above */
ClientData cdata; /* Passed to (*proc)() */ ClientData cdata) /* Passed to (*proc)() */
{ {
struct dbCheck dbc; struct dbCheck dbc;
@ -1165,10 +1165,10 @@ DBCheckMaxHStrips(plane, area, proc, cdata)
*/ */
int int
dbCheckMaxHFunc(tile, dinfo, dbc) dbCheckMaxHFunc(
Tile *tile; Tile *tile,
TileType dinfo; /* (unused) */ TileType dinfo, /* (unused) */
struct dbCheck *dbc; struct dbCheck *dbc)
{ {
Tile *tp; Tile *tp;
@ -1235,11 +1235,11 @@ dbCheckMaxHFunc(tile, dinfo, dbc)
*/ */
int int
DBCheckMaxVStrips(plane, area, proc, cdata) DBCheckMaxVStrips(
Plane *plane; /* Search this plane */ Plane *plane, /* Search this plane */
Rect *area; /* Process all tiles in this area */ Rect *area, /* Process all tiles in this area */
int (*proc)(); /* Filter procedure: see above */ int (*proc)(), /* Filter procedure: see above */
ClientData cdata; /* Passed to (*proc)() */ ClientData cdata) /* Passed to (*proc)() */
{ {
struct dbCheck dbc; struct dbCheck dbc;
@ -1258,10 +1258,10 @@ DBCheckMaxVStrips(plane, area, proc, cdata)
*/ */
int int
dbCheckMaxVFunc(tile, dinfo, dbc) dbCheckMaxVFunc(
Tile *tile; Tile *tile,
TileType dinfo; /* (unused) */ TileType dinfo, /* (unused) */
struct dbCheck *dbc; struct dbCheck *dbc)
{ {
Tile *tp; Tile *tp;

View File

@ -217,8 +217,8 @@ DBFixMismatch()
*/ */
void void
DBUpdateStamps(def) DBUpdateStamps(
CellDef *def; CellDef *def)
{ {
extern int dbStampFunc(); extern int dbStampFunc();
extern time_t time(); extern time_t time();
@ -240,9 +240,9 @@ DBUpdateStamps(def)
/*ARGSUSED*/ /*ARGSUSED*/
int int
dbStampFunc(cellDef, cdata) dbStampFunc(
CellDef *cellDef; CellDef *cellDef,
ClientData cdata; /* UNUSED */ ClientData cdata) /* UNUSED */
{ {
CellUse *cu; CellUse *cu;
CellDef *cd; CellDef *cd;
@ -291,7 +291,7 @@ dbStampFunc(cellDef, cdata)
cd = cu->cu_parent; cd = cu->cu_parent;
if (cd == NULL) continue; if (cd == NULL) continue;
cd->cd_flags |= CDSTAMPSCHANGED; cd->cd_flags |= CDSTAMPSCHANGED;
(void) dbStampFunc(cd); (void) dbStampFunc(cd, (ClientData) NULL);
} }
return 0; return 0;
} }
@ -328,9 +328,9 @@ dbStampFunc(cellDef, cdata)
*/ */
void void
DBStampMismatch(cellDef, wrongArea) DBStampMismatch(
CellDef *cellDef; CellDef *cellDef,
Rect *wrongArea; /* Guess of cell's bounding box that Rect *wrongArea) /* Guess of cell's bounding box that
* was wrong. * was wrong.
*/ */
{ {
@ -349,8 +349,8 @@ DBStampMismatch(cellDef, wrongArea)
*/ */
void void
DBFlagMismatches(checkDef) DBFlagMismatches(
CellDef *checkDef; CellDef *checkDef)
{ {
CellUse *parentUse; CellUse *parentUse;

View File

@ -60,7 +60,7 @@ Rule dbSavedRules[NT];
/* Forward declarations */ /* Forward declarations */
extern void dbTechBitTypeInit(); extern void dbTechBitTypeInit(TileType *bitToType, int n, int pNum, bool composeFlag);
bool dbTechAddPaintErase(); bool dbTechAddPaintErase();
bool dbTechSaveCompose(); bool dbTechSaveCompose();
@ -279,10 +279,11 @@ DBTechInitCompose()
*/ */
void void
dbTechBitTypeInit(bitToType, n, pNum, composeFlag) dbTechBitTypeInit(
TileType *bitToType; TileType *bitToType,
int n, pNum; int n,
bool composeFlag; int pNum,
bool composeFlag)
{ {
int i, j; int i, j;
TileType have, type; TileType have, type;
@ -305,8 +306,8 @@ dbTechBitTypeInit(bitToType, n, pNum, composeFlag)
/* Returns nonzero if exactly one bit set */ /* Returns nonzero if exactly one bit set */
int int
dbIsPrimary(n) dbIsPrimary(
int n; int n)
{ {
int bitCount; int bitCount;
@ -349,10 +350,10 @@ dbIsPrimary(n)
/*ARGSUSED*/ /*ARGSUSED*/
bool bool
DBTechAddCompose(sectionName, argc, argv) DBTechAddCompose(
char *sectionName; char *sectionName,
int argc; int argc,
char *argv[]; char *argv[])
{ {
TileType type, r, s; TileType type, r, s;
int pNum, ruleType, i; int pNum, ruleType, i;
@ -459,11 +460,11 @@ DBTechAddCompose(sectionName, argc, argv)
*/ */
bool bool
dbTechSaveCompose(ruleType, t, argc, argv) dbTechSaveCompose(
int ruleType; int ruleType,
TileType t; TileType t,
int argc; int argc,
char *argv[]; char *argv[])
{ {
TileType r, s; TileType r, s;
Rule *rp; Rule *rp;
@ -545,10 +546,10 @@ dbTechSaveCompose(ruleType, t, argc, argv)
*/ */
bool bool
dbTechCheckImages(t, r, s) dbTechCheckImages(
TileType t; /* Type that is composed */ TileType t, /* Type that is composed */
TileType r; /* First constituent */ TileType r, /* First constituent */
TileType s; /* Second constituent */ TileType s) /* Second constituent */
{ {
int pNum; int pNum;
PlaneMask pMask; PlaneMask pMask;
@ -591,11 +592,11 @@ dbTechCheckImages(t, r, s)
*/ */
bool bool
dbTechAddPaintErase(type, sectionName, argc, argv) dbTechAddPaintErase(
int type; int type,
char *sectionName; char *sectionName,
int argc; int argc,
char *argv[]; char *argv[])
{ {
int pNum; int pNum;
PlaneMask pMask, rMask; PlaneMask pMask, rMask;
@ -711,8 +712,8 @@ dbTechAddPaintErase(type, sectionName, argc, argv)
*/ */
void void
dbTechCheckPaint(where) dbTechCheckPaint(
char *where; /* If non-null, print this as header */ char *where) /* If non-null, print this as header */
{ {
TileType have, t, result; TileType have, t, result;
bool printedHeader = FALSE; bool printedHeader = FALSE;
@ -764,10 +765,10 @@ dbTechCheckPaint(where)
*/ */
void void
dbTechPrintPaint(where, doPaint, contactsOnly) dbTechPrintPaint(
char *where; /* If non-null, print this as header */ char *where, /* If non-null, print this as header */
bool doPaint; /* TRUE -> print paint tables, FALSE -> print erase */ bool doPaint, /* TRUE -> print paint tables, FALSE -> print erase */
bool contactsOnly; bool contactsOnly)
{ {
TileType have, paint, erase, result; TileType have, paint, erase, result;
int plane; int plane;

View File

@ -351,8 +351,9 @@ dbComposeContacts()
*/ */
void void
dbComposePaintContact(lpImage, lpPaint) dbComposePaintContact(
LayerInfo *lpImage, *lpPaint; LayerInfo *lpImage,
LayerInfo *lpPaint)
{ {
int pNum; int pNum;
PlaneMask pmask, pshared; PlaneMask pmask, pshared;
@ -550,9 +551,10 @@ dbComposePaintContact(lpImage, lpPaint)
*/ */
bool bool
dbComposeSubsetResidues(lpImage, lpErase, outMask) dbComposeSubsetResidues(
LayerInfo *lpImage, *lpErase; LayerInfo *lpImage,
TileTypeBitMask *outMask; LayerInfo *lpErase,
TileTypeBitMask *outMask)
{ {
TileTypeBitMask ires; TileTypeBitMask ires;
TileTypeBitMask smask, overlapmask; TileTypeBitMask smask, overlapmask;
@ -623,8 +625,9 @@ dbComposeSubsetResidues(lpImage, lpErase, outMask)
*/ */
void void
dbComposeEraseContact(lpImage, lpErase) dbComposeEraseContact(
LayerInfo *lpImage, *lpErase; LayerInfo *lpImage,
LayerInfo *lpErase)
{ {
int pNum; int pNum;
PlaneMask pmask; PlaneMask pmask;
@ -731,8 +734,8 @@ dbComposeEraseContact(lpImage, lpErase)
*/ */
void void
DBLockContact(ctype) DBLockContact(
TileType ctype; TileType ctype)
{ {
LayerInfo *lpImage, *lpPaint; LayerInfo *lpImage, *lpPaint;
TileType c, n, itype, eresult; TileType c, n, itype, eresult;
@ -774,8 +777,8 @@ DBLockContact(ctype)
*/ */
void void
DBUnlockContact(ctype) DBUnlockContact(
TileType ctype; TileType ctype)
{ {
LayerInfo *lpImage, *lpPaint; LayerInfo *lpImage, *lpPaint;
TileType n, itype, eresult; TileType n, itype, eresult;
@ -863,10 +866,10 @@ dbComposeSavedRules()
*/ */
void void
dbComposeDecompose(imageType, componentType, remainingType) dbComposeDecompose(
TileType imageType; TileType imageType,
TileType componentType; TileType componentType,
TileType remainingType; TileType remainingType)
{ {
int pNum = DBPlane(imageType); int pNum = DBPlane(imageType);
TileType resultType; TileType resultType;
@ -904,10 +907,10 @@ dbComposeDecompose(imageType, componentType, remainingType)
*/ */
void void
dbComposeCompose(imageType, existingType, paintType) dbComposeCompose(
TileType imageType; TileType imageType,
TileType existingType; TileType existingType,
TileType paintType; TileType paintType)
{ {
int pNum = DBPlane(imageType); int pNum = DBPlane(imageType);

View File

@ -69,7 +69,6 @@ void dbUndoCellForw(), dbUndoCellBack();
*** of an undo/redo command. *** of an undo/redo command.
***/ ***/
void dbUndoInit(); void dbUndoInit();
CellUse *findUse();
/*** /***
*** The following points to the CellDef specified in the most *** The following points to the CellDef specified in the most
@ -194,8 +193,8 @@ DBUndoInit()
*/ */
void void
DBUndoReset(celldef) DBUndoReset(
CellDef *celldef; CellDef *celldef)
{ {
if (celldef == dbUndoLastCell) if (celldef == dbUndoLastCell)
{ {
@ -255,8 +254,8 @@ dbUndoInit()
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
void void
dbUndoSplitForw(us) dbUndoSplitForw(
splitUE *us; splitUE *us)
{ {
/* Create internal fracture */ /* Create internal fracture */
if (dbUndoLastCell == NULL) return; if (dbUndoLastCell == NULL) return;
@ -265,8 +264,8 @@ dbUndoSplitForw(us)
} }
void void
dbUndoSplitBack(us) dbUndoSplitBack(
splitUE *us; splitUE *us)
{ {
Rect srect; Rect srect;
if (dbUndoLastCell == NULL) return; if (dbUndoLastCell == NULL) return;
@ -303,8 +302,8 @@ dbUndoSplitBack(us)
*/ */
void void
dbUndoPaintForw(up) dbUndoPaintForw(
paintUE *up; paintUE *up)
{ {
TileType loctype, dinfo; TileType loctype, dinfo;
if (dbUndoLastCell == NULL) return; if (dbUndoLastCell == NULL) return;
@ -357,8 +356,8 @@ endPaintFor:
} }
void void
dbUndoPaintBack(up) dbUndoPaintBack(
paintUE *up; paintUE *up)
{ {
TileType loctype, dinfo; TileType loctype, dinfo;
if (dbUndoLastCell == NULL) return; if (dbUndoLastCell == NULL) return;
@ -461,9 +460,9 @@ typedef Label labelUE;
*/ */
void void
DBUndoPutLabel(cellDef, lab) DBUndoPutLabel(
CellDef *cellDef; /* CellDef being modified */ CellDef *cellDef, /* CellDef being modified */
Label *lab; /* Label being modified */ Label *lab) /* Label being modified */
{ {
labelUE *lup; labelUE *lup;
@ -505,9 +504,9 @@ DBUndoPutLabel(cellDef, lab)
*/ */
void void
DBUndoEraseLabel(cellDef, lab) DBUndoEraseLabel(
CellDef *cellDef; /* Cell being modified */ CellDef *cellDef, /* Cell being modified */
Label *lab; /* Label being modified */ Label *lab) /* Label being modified */
{ {
labelUE *lup; labelUE *lup;
@ -550,8 +549,8 @@ DBUndoEraseLabel(cellDef, lab)
*/ */
void void
dbUndoLabelForw(up) dbUndoLabelForw(
labelUE *up; labelUE *up)
{ {
Label *lab; Label *lab;
@ -574,8 +573,8 @@ dbUndoLabelForw(up)
} }
void void
dbUndoLabelBack(up) dbUndoLabelBack(
labelUE *up; labelUE *up)
{ {
if (dbUndoLastCell == NULL) return; if (dbUndoLastCell == NULL) return;
(void) DBEraseLabelsByContent(dbUndoLastCell, &up->lue_rect, (void) DBEraseLabelsByContent(dbUndoLastCell, &up->lue_rect,
@ -617,6 +616,9 @@ dbUndoLabelBack(up)
char cue_id[4]; char cue_id[4];
} cellUE; } cellUE;
/* Forward declaration (cellUE must be defined first) */
extern CellUse *findUse(cellUE *up, bool matchName);
/* /*
* Compute the size of a cellUE, with sufficient space * Compute the size of a cellUE, with sufficient space
* at the end to store the use id. * at the end to store the use id.
@ -651,9 +653,9 @@ dbUndoLabelBack(up)
*/ */
void void
DBUndoCellUse(use, action) DBUndoCellUse(
CellUse *use; CellUse *use,
int action; int action)
{ {
cellUE *up; cellUE *up;
@ -692,8 +694,8 @@ DBUndoCellUse(use, action)
*/ */
void void
dbUndoCellForw(up) dbUndoCellForw(
cellUE *up; cellUE *up)
{ {
CellUse *use; CellUse *use;
@ -740,7 +742,7 @@ dbUndoCellForw(up)
/* /*
* The following is a hack. * The following is a hack.
* We clear out the use id of the cell so that * We clear out the use id of the cell so that
* findUse() will find it on the next time around, * findUse(cellUE *up, bool matchName) will find it on the next time around,
* which should be when we process a UNDO_CELL_SETID * which should be when we process a UNDO_CELL_SETID
* event. * event.
*/ */
@ -761,8 +763,8 @@ dbUndoCellForw(up)
} }
void void
dbUndoCellBack(up) dbUndoCellBack(
cellUE *up; cellUE *up)
{ {
CellUse *use; CellUse *use;
@ -815,7 +817,7 @@ dbUndoCellBack(up)
/* /*
* The following is a hack. * The following is a hack.
* We clear out the use id of the cell so that * We clear out the use id of the cell so that
* findUse() will find it on the next time around, * findUse(cellUE *up, bool matchName) will find it on the next time around,
* which should be when we process a UNDO_CELL_SETID * which should be when we process a UNDO_CELL_SETID
* event. * event.
*/ */
@ -861,9 +863,9 @@ dbUndoCellBack(up)
*/ */
CellUse * CellUse *
findUse(up, matchName) findUse(
cellUE *up; cellUE *up,
bool matchName; bool matchName)
{ {
CellUse *use; CellUse *use;
@ -923,8 +925,8 @@ findUse(up, matchName)
*/ */
void void
dbUndoEdit(new) dbUndoEdit(
CellDef *new; CellDef *new)
{ {
editUE *up; editUE *up;
CellDef *old = dbUndoLastCell; CellDef *old = dbUndoLastCell;
@ -970,8 +972,8 @@ dbUndoEdit(new)
*/ */
void void
dbUndoOpenCell(eup) dbUndoOpenCell(
editUE *eup; editUE *eup)
{ {
CellDef *newDef; CellDef *newDef;

View File

@ -25,6 +25,15 @@
#ifndef _MAGIC__DATABASE__DATABASE_H #ifndef _MAGIC__DATABASE__DATABASE_H
#define _MAGIC__DATABASE__DATABASE_H #define _MAGIC__DATABASE__DATABASE_H
/* Forward declaration to avoid circular include with windows/windows.h */
struct WIND_S1;
typedef struct WIND_S1 MagWindow;
/* Forward declaration so prototypes can refer to FontChar without pulling
* in database/fonts.h (which depends on this header). */
struct fontchar;
typedef struct fontchar FontChar;
#ifndef _MAGIC__TILES__TILE_H #ifndef _MAGIC__TILES__TILE_H
#include "tiles/tile.h" #include "tiles/tile.h"
#endif #endif
@ -784,7 +793,7 @@ typedef struct
extern void DBPaint(); extern void DBPaint();
extern void DBErase(); extern void DBErase();
extern int DBSrPaintArea(); extern int DBSrPaintArea();
extern int DBPaintPlane0(); extern int DBPaintPlane0(Plane *plane, Rect *area, const PaintResultType *resultTbl, PaintUndoInfo *undo, unsigned char method);
extern int DBPaintPlaneActive(); extern int DBPaintPlaneActive();
extern int DBPaintPlaneWrapper(); extern int DBPaintPlaneWrapper();
extern int DBPaintPlaneMark(); extern int DBPaintPlaneMark();
@ -804,20 +813,20 @@ extern int DBNMPaintPlane0();
#define DBNMPaintPlane(a, b, c, d, e) DBNMPaintPlane0(a, b, c, d, e, PAINT_NORMAL) #define DBNMPaintPlane(a, b, c, d, e) DBNMPaintPlane0(a, b, c, d, e, PAINT_NORMAL)
/* I/O */ /* I/O */
extern bool DBCellRead(); extern bool DBCellRead(CellDef *cellDef, bool ignoreTech, bool dereference, int *errptr);
extern bool DBTestOpen(); extern bool DBTestOpen();
extern char *DBGetTech(); extern char *DBGetTech();
extern bool DBCellWrite(); extern bool DBCellWrite();
extern CellDef *DBCellReadArea(); extern CellDef *DBCellReadArea(CellUse *rootUse, Rect *rootRect, bool halt_on_error);
extern void DBFileRecovery(); extern void DBFileRecovery();
extern bool DBWriteBackup(); extern bool DBWriteBackup(char *filename, bool archive, bool doforall);
extern bool DBReadBackup(); extern bool DBReadBackup(char *name, bool archive, bool usederef);
extern void DBRemoveBackup(); extern void DBRemoveBackup();
extern void DBPathSubstitute(); extern void DBPathSubstitute();
/* Labels */ /* Labels */
extern Label *DBPutLabel(); extern Label *DBPutLabel(CellDef *cellDef, Rect *rect, int align, char *text, TileType type, unsigned short flags, unsigned int port);
extern Label *DBPutFontLabel(); extern Label *DBPutFontLabel(CellDef *cellDef, Rect *rect, int font, int size, int rot, Point *offset, int align, char *text, TileType type, unsigned short flags, unsigned int port);
extern void DBFontLabelSetBBox(); extern void DBFontLabelSetBBox();
extern bool DBEraseGlobLabel(); extern bool DBEraseGlobLabel();
extern bool DBEraseLabel(); extern bool DBEraseLabel();
@ -856,9 +865,9 @@ extern void DBTechInitConnect();
/* Cell symbol table */ /* Cell symbol table */
extern void DBCellInit(); extern void DBCellInit();
extern void DBCellPrint(); extern void DBCellPrint(char *CellName, int who, bool dolist);
extern void DBUsePrint(); extern void DBUsePrint(char *CellName, int who, bool dolist);
extern void DBTopPrint(); extern void DBTopPrint(MagWindow *mw, bool dolist);
extern CellDef *DBCellLookDef(); extern CellDef *DBCellLookDef();
extern CellDef *DBCellNewDef(); extern CellDef *DBCellNewDef();
extern CellDef *DBCellDefAlloc(); extern CellDef *DBCellDefAlloc();
@ -869,10 +878,10 @@ extern int DBCellSrDefs();
extern CellUse *DBCellNewUse(); extern CellUse *DBCellNewUse();
extern bool DBCellDeleteUse(); extern bool DBCellDeleteUse();
extern CellUse *DBCellFindDup(); extern CellUse *DBCellFindDup();
extern void DBLockUse(); extern void DBLockUse(char *UseName, bool bval);
extern void DBUnlockUse(); extern void DBUnlockUse();
extern void DBOrientUse(); extern void DBOrientUse(char *UseName, bool dodef);
extern void DBAbutmentUse(); extern void DBAbutmentUse(char *UseName, bool dolist);
/* Cell selection */ /* Cell selection */
extern CellUse *DBSelectCell(); extern CellUse *DBSelectCell();
@ -935,24 +944,24 @@ extern bool DBIsAncestor();
extern void DBCellSetAvail(); extern void DBCellSetAvail();
extern void DBCellClearAvail(); extern void DBCellClearAvail();
extern bool DBCellGetModified(); extern bool DBCellGetModified();
extern void DBCellSetModified(); extern void DBCellSetModified(CellDef *cellDef, bool ismod);
extern void DBFixMismatch(); extern void DBFixMismatch();
extern void DBTreeCopyConnect(); extern void DBTreeCopyConnect(SearchContext *scx, TileTypeBitMask *mask, int xMask, TileTypeBitMask *connect, Rect *area, unsigned char doLabels, CellUse *destUse);
extern void DBSeeTypesAll(); extern void DBSeeTypesAll();
extern void DBUpdateStamps(); extern void DBUpdateStamps();
extern void DBEnumerateTypes(); extern void DBEnumerateTypes();
extern Plane *DBNewPlane(); extern Plane *DBNewPlane();
extern bool DBDescendSubcell(); extern bool DBDescendSubcell();
extern void DBCellCopyMaskHints(); extern void DBCellCopyMaskHints();
extern void DBFlattenInPlace(); extern void DBFlattenInPlace(CellUse *use, CellUse *dest, int xMask, bool dolabels, bool toplabels, bool doclear);
extern void DBCellFlattenAllCells(); extern void DBCellFlattenAllCells(SearchContext *scx, CellUse *dest, int xMask, bool dolabels, bool toplabels);
extern PaintResultType (*DBNewPaintTable())[TT_MAXTYPES][TT_MAXTYPES]; extern PaintResultType (*DBNewPaintTable())[TT_MAXTYPES][TT_MAXTYPES];
typedef int (*IntProc)(); typedef int (*IntProc)();
IntProc DBNewPaintPlane(); IntProc DBNewPaintPlane();
/* Diagnostic */ /* Diagnostic */
extern void DBTechPrintTypes(); extern void DBTechPrintTypes(TileTypeBitMask *mask, bool dolist);
extern void DBTechPrintCanonicalType(); extern void DBTechPrintCanonicalType();
/* Deallocation */ /* Deallocation */
@ -973,7 +982,7 @@ extern void DBPropClearAll();
extern int DBTreeSrTiles(); extern int DBTreeSrTiles();
extern int DBTreeSrUniqueTiles(); extern int DBTreeSrUniqueTiles();
extern int DBNoTreeSrTiles(); extern int DBNoTreeSrTiles();
extern int DBTreeSrLabels(); extern int DBTreeSrLabels(SearchContext *scx, TileTypeBitMask * mask, int xMask, TerminalPath *tpath, unsigned char flags, int (*func)(), ClientData cdarg);
extern int DBTreeSrCells(); extern int DBTreeSrCells();
extern int DBSrRoots(); extern int DBSrRoots();
extern int DBCellEnum(); extern int DBCellEnum();
@ -990,15 +999,15 @@ extern int dbSrConnectStartFunc(Tile *tile, TileType dinfo, ClientData clientDat
extern void DBEraseValid(); extern void DBEraseValid();
extern void DBPaintValid(); extern void DBPaintValid();
extern void DBTreeCountPaint(); extern void DBTreeCountPaint();
extern void DBOpenOnly(); extern void DBOpenOnly(CellDef *cellDef, char *name, bool setFileName, int *errptr);
extern int DBLoadFont(); extern int DBLoadFont(char *fontfile, float scale);
extern int DBNameToFont(); extern int DBNameToFont();
extern int DBFontChar(); extern int DBFontChar(int font, char ccode, FontChar **clist, Point **coffset, Rect **cbbox);
extern void DBFontInitCurves(); extern void DBFontInitCurves();
extern void DBUndoEraseLabel(); extern void DBUndoEraseLabel();
extern void DBUndoPutLabel(); extern void DBUndoPutLabel();
extern bool DBCellRename(); extern bool DBCellRename(char *cellname, char *newname, bool doforce);
extern bool DBCellDelete(); extern bool DBCellDelete(char *cellname, bool force);
extern int DBCellSrArea(); extern int DBCellSrArea();
extern int DBSrCellPlaneArea(BPlane *plane, const Rect *rect, int (*func)(), ClientData arg); extern int DBSrCellPlaneArea(BPlane *plane, const Rect *rect, int (*func)(), ClientData arg);
extern int DBMoveCell(); extern int DBMoveCell();
@ -1012,7 +1021,7 @@ extern bool DBScalePoint();
extern int DBScaleCell(); extern int DBScaleCell();
extern TileType DBTechNameTypes(); extern TileType DBTechNameTypes();
extern void DBTreeFindUse(); extern void DBTreeFindUse();
extern void DBGenerateUniqueIds(); extern void DBGenerateUniqueIds(CellDef *def, bool warn);
extern void DBSelectionUniqueIds(); extern void DBSelectionUniqueIds();
extern TileType DBInvTransformDiagonal(); extern TileType DBInvTransformDiagonal();
extern bool DBIsSubcircuit(); extern bool DBIsSubcircuit();
@ -1028,7 +1037,7 @@ extern int DBSrCellUses();
extern TileType DBTechNameTypeExact(); extern TileType DBTechNameTypeExact();
extern void dbInstanceUnplace(); extern void dbInstanceUnplace();
extern int dbIsPrimary(); extern int dbIsPrimary();
extern void dbTechMatchResidues(); extern void dbTechMatchResidues(TileTypeBitMask *inMask, TileTypeBitMask *outMask, bool contactsOnly);
extern void DBUndoInit(); extern void DBUndoInit();
extern void DBResetTilePlane(); extern void DBResetTilePlane();
extern void DBResetTilePlaneSpecial(); extern void DBResetTilePlaneSpecial();
@ -1038,12 +1047,12 @@ extern int DBSrConnect();
extern char *dbFgets(); extern char *dbFgets();
extern void DBAdjustLabelsNew(); extern void DBAdjustLabelsNew();
extern bool DBScaleValue(); extern bool DBScaleValue();
extern int DBMergeNMTiles0(); extern int DBMergeNMTiles0(Plane *plane, Rect *area, PaintUndoInfo *undo, bool mergeOnce);
extern int DBSearchLabel(); extern int DBSearchLabel();
extern int dbCellUniqueTileSrFunc(); extern int dbCellUniqueTileSrFunc();
extern void DBWDrawFontLabel(); extern void DBWDrawFontLabel();
extern void DBCellCopyManhattanPaint(); extern void DBCellCopyManhattanPaint();
extern bool dbScalePlane(); extern bool dbScalePlane(Plane *oldplane, Plane *newplane, int pnum, int scalen, int scaled, bool doCIF);
extern int DBPaintPlaneVert(); extern int DBPaintPlaneVert();
/* -------------------------- Layer locking ------------------------------*/ /* -------------------------- Layer locking ------------------------------*/

View File

@ -203,7 +203,7 @@ extern void DBUndoEraseLabel();
extern void DBUndoCellUse(); extern void DBUndoCellUse();
extern void DBStampMismatch(); extern void DBStampMismatch();
extern void DBFlagMismatches(); extern void DBFlagMismatches();
extern void DBTechAddNameToType(); extern void DBTechAddNameToType(char *newname, TileType ttype, bool canonical);
extern void dbComputeBbox(); extern void dbComputeBbox();
extern void dbFreeCellPlane(); extern void dbFreeCellPlane();