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
DBBoundCellPlane(def, extended, rect)
CellDef *def;
Rect *extended;
Rect *rect;
DBBoundCellPlane(
CellDef *def,
Rect *extended,
Rect *rect)
{
TreeFilter filter;
DBCellBoundStruct cbs;
@ -79,9 +79,9 @@ DBBoundCellPlane(def, extended, rect)
}
int
dbCellBoundFunc(use, fp)
CellUse *use;
TreeFilter *fp;
dbCellBoundFunc(
CellUse *use,
TreeFilter *fp)
{
DBCellBoundStruct *cbs;
@ -124,9 +124,9 @@ dbCellBoundFunc(use, fp)
*/
bool
DBBoundPlane(plane, rect)
Plane *plane;
Rect *rect;
DBBoundPlane(
Plane *plane,
Rect *rect)
{
Tile *left, *right, *top, *bottom, *tp;
@ -205,9 +205,9 @@ DBBoundPlane(plane, rect)
*/
bool
DBBoundPlaneVert(plane, rect)
Plane *plane;
Rect *rect;
DBBoundPlaneVert(
Plane *plane,
Rect *rect)
{
Tile *left, *right, *top, *bottom, *tp;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -112,12 +112,12 @@ static char *DBbackupFile = (char *)NULL;
/* Forward declarations */
char *dbFgets();
FILETYPE dbReadOpen();
FILETYPE dbReadOpen(CellDef *cellDef, bool setFileName, bool dereference, int *errptr);
int DBFileOffset;
bool dbReadLabels();
bool dbReadElements();
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
/* Used to make a tag callback after loading a techfile */
@ -136,8 +136,8 @@ extern int TagCallback();
*/
static int
file_is_not_writeable(name)
char *name;
file_is_not_writeable(
char *name)
{
struct stat sbuf;
@ -170,7 +170,9 @@ file_is_not_writeable(name)
}
static int
path_is_dir(const char *dirname, const char *filename)
path_is_dir(
const char *dirname,
const char *filename)
{
struct stat statbuf;
char path[PATH_MAX];
@ -221,11 +223,11 @@ typedef struct _linkedDirent {
*/
char *
DBSearchForTech(techname, techroot, pathroot, level)
char *techname;
char *techroot; /* techname without the ".tech" suffix */
char *pathroot;
int level;
DBSearchForTech(
char *techname,
char *techroot, /* techname without the ".tech" suffix */
char *pathroot,
int level)
{
char *newpath, *found, *dptr;
struct dirent *tdent;
@ -338,9 +340,9 @@ DBSearchForTech(techname, techroot, pathroot, level)
*/
int
DBAddStandardCellPaths(pathptr, level)
char *pathptr;
int level;
DBAddStandardCellPaths(
char *pathptr,
int level)
{
int paths = 0;
struct dirent *tdent;
@ -520,10 +522,10 @@ DBAddStandardCellPaths(pathptr, level)
*/
bool
dbCellReadDef(f, cellDef, ignoreTech, dereference)
FILETYPE f; /* The file, already opened by the caller */
CellDef *cellDef; /* Pointer to definition of cell to be read in */
bool ignoreTech; /* If FALSE then the technology of the file MUST
dbCellReadDef(
FILETYPE f, /* The file, already opened by the caller */
CellDef *cellDef, /* Pointer to definition of cell to be read in */
bool ignoreTech, /* If FALSE then the technology of the file MUST
* match the current technology, or else the
* subroutine will return an error condition
* without reading anything. If TRUE, a
@ -531,7 +533,7 @@ dbCellReadDef(f, cellDef, ignoreTech, dereference)
* names do not match, but an attempt will be
* 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;
char line[2048], tech[50], layername[50];
@ -1111,8 +1113,8 @@ DBRemoveBackup()
*/
void
DBFileRecovery(filename)
char *filename;
DBFileRecovery(
char *filename)
{
DIR *cwd;
struct direct *dp;
@ -1232,10 +1234,10 @@ DBFileRecovery(filename)
*/
bool
DBReadBackup(name, archive, usederef)
char *name; /* Name of the backup file */
bool archive; /* TRUE if this is an archive file */
bool usederef; /* If TRUE, then dereference all cells */
DBReadBackup(
char *name, /* Name of the backup file */
bool archive, /* TRUE if this is an archive file */
bool usederef) /* If TRUE, then dereference all cells */
{
FILETYPE f;
static const char *filetypes[] = {"archive", "backup", 0};
@ -1358,9 +1360,9 @@ DBReadBackup(name, archive, usederef)
*/
bool
DBCellRead(cellDef, ignoreTech, dereference, errptr)
CellDef *cellDef; /* Pointer to definition of cell to be read in */
bool ignoreTech; /* If FALSE then the technology of the file MUST
DBCellRead(
CellDef *cellDef, /* Pointer to definition of cell to be read in */
bool ignoreTech, /* If FALSE then the technology of the file MUST
* match the current technology, or else the
* subroutine will return an error condition
* without reading anything. If TRUE, a
@ -1368,8 +1370,8 @@ DBCellRead(cellDef, ignoreTech, dereference, errptr)
* names do not match, but an attempt will be
* made to read the file anyway.
*/
bool dereference; /* If TRUE then ignore path argument to cellDef */
int *errptr; /* Copy of errno set by file reading routine
bool dereference, /* If TRUE then ignore path argument to cellDef */
int *errptr) /* Copy of errno set by file reading routine
* is placed here, unless NULL.
*/
{
@ -1444,16 +1446,16 @@ DBCellRead(cellDef, ignoreTech, dereference, errptr)
*/
FILETYPE
dbReadOpen(cellDef, setFileName, dereference, errptr)
CellDef *cellDef; /* Def being read */
bool setFileName; /* If TRUE then cellDef->cd_file should be updated
dbReadOpen(
CellDef *cellDef, /* Def being read */
bool setFileName, /* If TRUE then cellDef->cd_file should be updated
* to point to the name of the file from which the
* 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.
*/
int *errptr; /* Pointer to int to hold error value */
int *errptr) /* Pointer to int to hold error value */
{
FILETYPE f = NULL;
int fd;
@ -1678,14 +1680,14 @@ dbReadOpen(cellDef, setFileName, dereference, errptr)
*/
void
DBOpenOnly(cellDef, name, setFileName, errptr)
CellDef *cellDef; /* Def being read */
char *name; /* Name if specified, or NULL */
bool setFileName; /* If TRUE then cellDef->cd_file should be updated
DBOpenOnly(
CellDef *cellDef, /* Def being read */
char *name, /* Name if specified, or NULL */
bool setFileName, /* If TRUE then cellDef->cd_file should be updated
* to point to the name of the file from which the
* 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);
}
@ -1707,9 +1709,9 @@ DBOpenOnly(cellDef, name, setFileName, errptr)
*/
bool
DBTestOpen(name, fullPath)
char *name;
char **fullPath;
DBTestOpen(
char *name,
char **fullPath)
{
FILETYPE f;
@ -1747,15 +1749,15 @@ DBTestOpen(name, fullPath)
*/
bool
dbReadUse(cellDef, line, len, f, scalen, scaled, dereference, dbUseTable)
CellDef *cellDef; /* Cell whose cells are being read */
char *line; /* Line containing "use ..." */
int len; /* Size of buffer pointed to by line */
FILETYPE f; /* Input file */
int scalen; /* Multiply values in file by this */
int scaled; /* Divide values in file by this */
bool dereference; /* If TRUE, ignore path references */
HashTable *dbUseTable; /* Hash table of instances seen in this file */
dbReadUse(
CellDef *cellDef, /* Cell whose cells are being read */
char *line, /* Line containing "use ..." */
int len, /* Size of buffer pointed to by line */
FILETYPE f, /* Input file */
int scalen, /* Multiply values in file by this */
int scaled, /* Divide values in file by this */
bool dereference, /* If TRUE, ignore path references */
HashTable *dbUseTable) /* Hash table of instances seen in this file */
{
int xlo, xhi, ylo, yhi, xsep, ysep, childStamp;
int absa, absb, absd, abse, nconv;
@ -2396,13 +2398,13 @@ nextLine:
*/
bool
dbReadProperties(cellDef, line, len, f, scalen, scaled)
CellDef *cellDef; /* Cell whose properties are being read */
char *line; /* Line containing << properties >> */
int len; /* Size of buffer pointed to by line */
FILETYPE f; /* Input file */
int scalen; /* Scale up by this factor */
int scaled; /* Scale down by this factor */
dbReadProperties(
CellDef *cellDef, /* Cell whose properties are being read */
char *line, /* Line containing << properties >> */
int len, /* Size of buffer pointed to by line */
FILETYPE f, /* Input file */
int scalen, /* Scale up by this factor */
int scaled) /* Scale down by this factor */
{
char propertytype[32], propertyname[128], propertyvalue[2049];
PropertyRecord *proprec;
@ -2892,13 +2894,13 @@ nextproperty:
*/
bool
dbReadElements(cellDef, line, len, f, scalen, scaled)
CellDef *cellDef; /* Cell whose elements are being read */
char *line; /* Line containing << elements >> */
int len; /* Size of buffer pointed to by line */
FILETYPE f; /* Input file */
int scalen; /* Scale up by this factor */
int scaled; /* Scale down by this factor */
dbReadElements(
CellDef *cellDef, /* Cell whose elements are being read */
char *line, /* Line containing << elements >> */
int len, /* Size of buffer pointed to by line */
FILETYPE f, /* Input file */
int scalen, /* Scale up by this factor */
int scaled) /* Scale down by this factor */
{
char elementname[128], styles[1024], *text, flags[100];
int istyle, ntok;
@ -3066,13 +3068,13 @@ nextelement:
*/
bool
dbReadLabels(cellDef, line, len, f, scalen, scaled)
CellDef *cellDef; /* Cell whose labels are being read */
char *line; /* Line containing << labels >> */
int len; /* Size of buffer pointed to by line */
FILETYPE f; /* Input file */
int scalen; /* Scale up by this factor */
int scaled; /* Scale down by this factor */
dbReadLabels(
CellDef *cellDef, /* Cell whose labels are being read */
char *line, /* Line containing << labels >> */
int len, /* Size of buffer pointed to by line */
FILETYPE f, /* Input file */
int scalen, /* Scale up by this factor */
int scaled) /* Scale down by this factor */
{
char layername[50], text[1024], port_use[50], port_class[50], port_shape[50];
TileType type;
@ -3385,10 +3387,10 @@ nextlabel:
*/
char *
dbFgets(line, len, f)
char *line;
int len;
FILETYPE f;
dbFgets(
char *line,
int len,
FILETYPE f)
{
char *cs;
int l;
@ -3430,8 +3432,8 @@ dbFgets(line, len, f)
*/
int
DBCellFindScale(cellDef)
CellDef *cellDef;
DBCellFindScale(
CellDef *cellDef)
{
int dbFindGCFFunc(), dbFindCellGCFFunc(), dbFindPropGCFFunc();
TileType type;
@ -3508,10 +3510,10 @@ DBCellFindScale(cellDef)
*/
int
dbFindGCFFunc(tile, dinfo, ggcf)
Tile *tile;
TileType dinfo; /* (unused) */
int *ggcf;
dbFindGCFFunc(
Tile *tile,
TileType dinfo, /* (unused) */
int *ggcf)
{
Rect r;
@ -3548,9 +3550,9 @@ dbFindGCFFunc(tile, dinfo, ggcf)
*/
int
dbFindCellGCFFunc(cellUse, ggcf)
CellUse *cellUse; /* Cell use whose "call" is to be written to a file */
int *ggcf; /* Greatest common denominator for all geometry */
dbFindCellGCFFunc(
CellUse *cellUse, /* Cell use whose "call" is to be written to a file */
int *ggcf) /* Greatest common denominator for all geometry */
{
Transform *t;
Rect *b;
@ -3605,10 +3607,10 @@ dbFindCellGCFFunc(cellUse, ggcf)
*/
int
dbFindPropGCFFunc(key, proprec, ggcf)
char *key;
PropertyRecord *proprec;
int *ggcf; /* Client data */
dbFindPropGCFFunc(
char *key,
PropertyRecord *proprec,
int *ggcf) /* Client data */
{
int value, n;
@ -3652,7 +3654,9 @@ dbFindPropGCFFunc(key, proprec, ggcf)
*/
int
cucompare(const void *one, const void *two)
cucompare(
const void *one,
const void *two)
{
CellUse *use1, *use2;
char *s1, *s2;
@ -3692,9 +3696,9 @@ struct cellUseList {
*/
int
dbGetUseFunc(cellUse, useRec)
CellUse *cellUse; /* Cell use whose "call" is to be written to a file */
struct cellUseList *useRec;
dbGetUseFunc(
CellUse *cellUse, /* Cell use whose "call" is to be written to a file */
struct cellUseList *useRec)
{
useRec->useList[useRec->idx] = cellUse;
useRec->idx++;
@ -3720,9 +3724,9 @@ dbGetUseFunc(cellUse, useRec)
*/
int
dbCountUseFunc(cellUse, count)
CellUse *cellUse; /* Cell use whose "call" is to be written to a file */
int *count;
dbCountUseFunc(
CellUse *cellUse, /* Cell use whose "call" is to be written to a file */
int *count)
{
(*count)++;
return 0;
@ -3754,7 +3758,9 @@ struct keyValuePair {
*/
int
keycompare(const void *one, const void *two)
keycompare(
const void *one,
const void *two)
{
int cval;
struct keyValuePair *kv1 = *((struct keyValuePair **)one);
@ -3792,10 +3798,10 @@ struct cellPropList {
*/
int
dbGetPropFunc(key, proprec, propRec)
char *key;
PropertyRecord *proprec;
struct cellPropList *propRec;
dbGetPropFunc(
char *key,
PropertyRecord *proprec,
struct cellPropList *propRec)
{
propRec->keyValueList[propRec->idx] =
(struct keyValuePair *)mallocMagic(sizeof(struct keyValuePair));
@ -3824,10 +3830,10 @@ dbGetPropFunc(key, proprec, propRec)
*/
int
dbCountPropFunc(key, proprec, count)
char *key;
PropertyRecord *proprec;
int *count; /* Client data */
dbCountPropFunc(
char *key,
PropertyRecord *proprec,
int *count) /* Client data */
{
(*count)++;
return 0;
@ -3875,9 +3881,9 @@ typedef struct _pwfrec {
*/
bool
DBCellWriteFile(cellDef, f)
CellDef *cellDef; /* Pointer to definition of cell to be written out */
FILE *f; /* The FILE to write to */
DBCellWriteFile(
CellDef *cellDef, /* Pointer to definition of cell to be written out */
FILE *f) /* The FILE to write to */
{
int dbWritePaintFunc(), dbWriteCellFunc(), dbWritePropFunc();
int dbClearCellFunc();
@ -4220,10 +4226,10 @@ dbWritePropPaintFunc(Tile *tile,
*/
int
dbWritePropFunc(key, proprec, cdata)
char *key;
PropertyRecord *proprec;
ClientData cdata;
dbWritePropFunc(
char *key,
PropertyRecord *proprec,
ClientData cdata)
{
pwfrec *pwf = (pwfrec *)cdata;
FILE *f = pwf->pwf_file;
@ -4329,9 +4335,9 @@ dbWritePropFunc(key, proprec, cdata)
*/
bool
DBCellWriteCommandFile(cellDef, f)
CellDef *cellDef; /* Pointer to definition of cell to be written out */
FILE *f; /* The FILE to write to */
DBCellWriteCommandFile(
CellDef *cellDef, /* Pointer to definition of cell to be written out */
FILE *f) /* The FILE to write to */
{
int dbWritePaintCommandsFunc();
int dbWriteUseCommandsFunc();
@ -4552,10 +4558,10 @@ ioerror:
*/
int
dbWritePaintCommandsFunc(tile, dinfo, cdarg)
Tile *tile;
TileType dinfo;
ClientData cdarg;
dbWritePaintCommandsFunc(
Tile *tile,
TileType dinfo,
ClientData cdarg)
{
char pstring[256];
struct writeArg *arg = (struct writeArg *) cdarg;
@ -4623,9 +4629,9 @@ dbWritePaintCommandsFunc(tile, dinfo, cdarg)
*/
int
dbWriteUseCommandsFunc(cellUse, cdarg)
CellUse *cellUse;
ClientData cdarg;
dbWriteUseCommandsFunc(
CellUse *cellUse,
ClientData cdarg)
{
struct writeArg *arg = (struct writeArg *) cdarg;
FILE *f = arg->wa_file;
@ -4695,10 +4701,10 @@ dbWritePropCommandPaintFunc(Tile *tile,
*/
int
dbWritePropCommandsFunc(key, proprec, cdarg)
char *key;
PropertyRecord *proprec;
ClientData cdarg;
dbWritePropCommandsFunc(
char *key,
PropertyRecord *proprec,
ClientData cdarg)
{
struct writeArg *arg = (struct writeArg *) cdarg;
char *escstr, *p, *v, *value;
@ -4807,9 +4813,9 @@ dbWritePropCommandsFunc(key, proprec, cdarg)
*/
bool
DBCellWrite(cellDef, fileName)
CellDef *cellDef; /* Pointer to definition of cell to be written out */
char *fileName; /* If not NULL, name of file to write. If NULL,
DBCellWrite(
CellDef *cellDef, /* Pointer to definition of cell to be written out */
char *fileName) /* If not NULL, name of file to write. If NULL,
* the name associated with the CellDef is used
*/
{
@ -5137,10 +5143,10 @@ cleanup:
*/
int
dbWritePaintFunc(tile, dinfo, cdarg)
Tile *tile;
TileType dinfo; /* (unused) */
ClientData cdarg;
dbWritePaintFunc(
Tile *tile,
TileType dinfo, /* (unused) */
ClientData cdarg)
{
char pstring[256];
struct writeArg *arg = (struct writeArg *) cdarg;
@ -5222,9 +5228,9 @@ dbWritePaintFunc(tile, dinfo, cdarg)
*/
int
dbClearCellFunc(cellUse, cdarg)
CellUse *cellUse; /* Cell use */
ClientData cdarg; /* Not used */
dbClearCellFunc(
CellUse *cellUse, /* Cell use */
ClientData cdarg) /* Not used */
{
cellUse->cu_def->cd_flags &= ~CDVISITED;
return 0;
@ -5255,10 +5261,10 @@ dbClearCellFunc(cellUse, cdarg)
*/
void
DBPathSubstitute(pathstart, cstring, cellDef)
char *pathstart;
char *cstring;
CellDef *cellDef;
DBPathSubstitute(
char *pathstart,
char *cstring,
CellDef *cellDef)
{
bool subbed = FALSE;
#ifdef MAGIC_WRAPPER
@ -5347,9 +5353,9 @@ DBPathSubstitute(pathstart, cstring, cellDef)
*/
int
dbWriteCellFunc(cellUse, cdarg)
CellUse *cellUse; /* Cell use whose "call" is to be written to a file */
ClientData cdarg;
dbWriteCellFunc(
CellUse *cellUse, /* Cell use whose "call" is to be written to a file */
ClientData cdarg)
{
struct writeArg *arg = (struct writeArg *) cdarg;
Transform *t;
@ -5461,8 +5467,8 @@ dbWriteCellFunc(cellUse, cdarg)
*/
char *
DBGetTech(cellName)
char *cellName; /* Name of cell whose technology
DBGetTech(
char *cellName) /* Name of cell whose technology
* is desired.
*/
{
@ -5491,7 +5497,7 @@ ret:
}
/* File and flags record used to hold information for dbWriteBackupFunc()
* in DBWriteBackup()
* in DBWriteBackup().
*/
typedef struct _fileAndFlags {
@ -5532,10 +5538,10 @@ typedef struct _fileAndFlags {
*/
bool
DBWriteBackup(filename, archive, doforall)
char *filename;
bool archive;
bool doforall;
DBWriteBackup(
char *filename,
bool archive,
bool doforall)
{
FILE *f;
int fd, pid;
@ -5657,9 +5663,9 @@ DBWriteBackup(filename, archive, doforall)
*/
int
dbWriteBackupFunc(def, clientData)
CellDef *def; /* Pointer to CellDef to be saved */
ClientData clientData;
dbWriteBackupFunc(
CellDef *def, /* Pointer to CellDef to be saved */
ClientData clientData)
{
char *name = def->cd_file;
int result, save_flags;
@ -5693,9 +5699,9 @@ dbWriteBackupFunc(def, clientData)
*/
int
dbCheckModifiedCellsFunc(def, cdata)
CellDef *def; /* Pointer to CellDef to be saved */
ClientData cdata; /* Unused */
dbCheckModifiedCellsFunc(
CellDef *def, /* Pointer to CellDef to be saved */
ClientData cdata) /* Unused */
{
if (def->cd_flags & (CDINTERNAL | CDNOEDIT | CDNOTFOUND)) 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 "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 */
@ -68,8 +68,8 @@ int DBNumFonts = 0;
*/
bool
DBIsSubcircuit(cellDef)
CellDef *cellDef;
DBIsSubcircuit(
CellDef *cellDef)
{
Label *lab;
@ -94,14 +94,14 @@ DBIsSubcircuit(cellDef)
*/
Label *
DBPutLabel(cellDef, rect, align, text, type, flags, port)
CellDef *cellDef;
Rect *rect;
int align;
char *text;
TileType type;
unsigned short flags;
unsigned int port;
DBPutLabel(
CellDef *cellDef,
Rect *rect,
int align,
char *text,
TileType type,
unsigned short flags,
unsigned int port)
{
/* Draw text in a standard X11 font */
return DBPutFontLabel(cellDef, rect, -1, 0, 0, &GeoOrigin,
@ -132,21 +132,21 @@ DBPutLabel(cellDef, rect, align, text, type, flags, port)
* ----------------------------------------------------------------------------
*/
Label *
DBPutFontLabel(cellDef, rect, font, size, rot, offset, align, text, type, flags, port)
CellDef *cellDef; /* Cell in which label is placed */
Rect *rect; /* Location of label; see above for description */
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 rot; /* Rotate of the vector font in degrees */
Point *offset; /* Offset of the font from the point of origin */
int align; /* Orientation/alignment of text. If this is < 0,
DBPutFontLabel(
CellDef *cellDef, /* Cell in which label is placed */
Rect *rect, /* Location of label; see above for description */
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 rot, /* Rotate of the vector font in degrees */
Point *offset, /* Offset of the font from the point of origin */
int align, /* Orientation/alignment of text. If this is < 0,
* an orientation will be picked to keep the text
* inside the cell boundary.
*/
char *text; /* Pointer to actual text of label */
TileType type; /* Type of tile to be labelled */
unsigned short flags; /* Label flags */
unsigned int port; /* Port index (if label is a port, per the flags) */
char *text, /* Pointer to actual text of label */
TileType type, /* Type of tile to be labelled */
unsigned short flags, /* Label flags */
unsigned int port) /* Port index (if label is a port, per the flags) */
{
Label *lab;
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
DBEraseGlobLabel(cellDef, area, mask, areaReturn, globmatch)
CellDef *cellDef; /* Cell being modified */
Rect *area; /* Area from which labels are to be erased.
DBEraseGlobLabel(
CellDef *cellDef, /* Cell being modified */
Rect *area, /* Area from which labels are to be erased.
* This may be a point; any labels touching
* 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.
*/
Rect *areaReturn; /* Expand this with label bounding box */
char *globmatch; /* If non-NULL, do glob-style matching of
Rect *areaReturn, /* Expand this with label bounding box */
char *globmatch) /* If non-NULL, do glob-style matching of
* any label against this string.
*/
{
@ -353,16 +353,16 @@ DBEraseGlobLabel(cellDef, area, mask, areaReturn, globmatch)
*/
bool
DBEraseLabel(cellDef, area, mask, areaReturn)
CellDef *cellDef; /* Cell being modified */
Rect *area; /* Area from which labels are to be erased.
DBEraseLabel(
CellDef *cellDef, /* Cell being modified */
Rect *area, /* Area from which labels are to be erased.
* This may be a point; any labels touching
* 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.
*/
Rect *areaReturn; /* Expand this with label bounding box */
Rect *areaReturn) /* Expand this with label bounding box */
{
return DBEraseGlobLabel(cellDef, area, mask, areaReturn, NULL);
}
@ -385,15 +385,15 @@ DBEraseLabel(cellDef, area, mask, areaReturn)
*/
Label *
DBCheckLabelsByContent(def, rect, type, text)
CellDef *def; /* Where to look for label to delete. */
Rect *rect; /* Coordinates of label. If NULL, then
DBCheckLabelsByContent(
CellDef *def, /* Where to look for label to delete. */
Rect *rect, /* Coordinates of label. If NULL, then
* 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.
*/
char *text; /* Text associated with label. If NULL, then
char *text) /* Text associated with label. If NULL, then
* labels are searched regardless of text.
*/
{
@ -430,15 +430,15 @@ DBCheckLabelsByContent(def, rect, type, text)
*/
void
DBEraseLabelsByContent(def, rect, type, text)
CellDef *def; /* Where to look for label to delete. */
Rect *rect; /* Coordinates of label. If NULL, then
DBEraseLabelsByContent(
CellDef *def, /* Where to look for label to delete. */
Rect *rect, /* Coordinates of label. If NULL, then
* 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.
*/
char *text; /* Text associated with label. If NULL, then
char *text) /* Text associated with label. If NULL, then
* labels are deleted regardless of text.
*/
{
@ -493,9 +493,9 @@ DBEraseLabelsByContent(def, rect, type, text)
*/
void
DBRemoveLabel(def, refLab)
CellDef *def; /* Where to look for label to delete. */
Label *refLab;
DBRemoveLabel(
CellDef *def, /* Where to look for label to delete. */
Label *refLab)
{
Label *lab, *labPrev;
@ -544,12 +544,12 @@ DBRemoveLabel(def, refLab)
*/
void
DBReOrientLabel(cellDef, area, newPos)
CellDef *cellDef; /* Cell whose labels are to be modified. */
Rect *area; /* All labels touching this area have their
DBReOrientLabel(
CellDef *cellDef, /* Cell whose labels are to be modified. */
Rect *area, /* All labels touching this area have their
* 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.
*/
{
@ -584,10 +584,10 @@ DBReOrientLabel(cellDef, area, newPos)
*/
int
dbGetLabelArea(tile, dinfo, area)
Tile *tile; /* Tile found. */
TileType dinfo; /* Split tile information (unused) */
Rect *area; /* Area to be modified. */
dbGetLabelArea(
Tile *tile, /* Tile found. */
TileType dinfo, /* Split tile information (unused) */
Rect *area) /* Area to be modified. */
{
Rect r;
@ -617,10 +617,10 @@ dbGetLabelArea(tile, dinfo, area)
*/
int
dbLabelNotEmpty(tile, dinfo, clientData)
Tile *tile; /* Tile found. */
TileType dinfo; /* Split tile information (unused) */
ClientData clientData; /* (unused) */
dbLabelNotEmpty(
Tile *tile, /* Tile found. */
TileType dinfo, /* Split tile information (unused) */
ClientData clientData) /* (unused) */
{
return 1;
}
@ -648,9 +648,9 @@ dbLabelNotEmpty(tile, dinfo, clientData)
*/
void
DBAdjustLabels(def, area)
CellDef *def; /* Cell whose paint was changed. */
Rect *area; /* Area where paint was modified. */
DBAdjustLabels(
CellDef *def, /* Cell whose paint was changed. */
Rect *area) /* Area where paint was modified. */
{
Label *lab;
TileType newType;
@ -759,9 +759,9 @@ DBAdjustLabels(def, area)
*/
void
DBAdjustLabelsNew(def, area)
CellDef *def; /* Cell whose paint was changed. */
Rect *area; /* Area where paint was modified. */
DBAdjustLabelsNew(
CellDef *def, /* Cell whose paint was changed. */
Rect *area) /* Area where paint was modified. */
{
Label *lab, *labPrev;
TileType newType;
@ -863,10 +863,10 @@ TileTypeBitMask *dbAdjustPlaneTypes; /* Mask of all types in current
* plane being searched.
*/
TileType
DBPickLabelLayer(def, lab, doCalma)
CellDef *def; /* Cell definition containing label. */
Label *lab; /* Label for which a home must be found. */
bool doCalma; /* if TRUE, use rules for GDS and LEF */
DBPickLabelLayer(
CellDef *def, /* Cell definition containing label. */
Label *lab, /* Label for which a home must be found. */
bool doCalma) /* if TRUE, use rules for GDS and LEF */
{
TileTypeBitMask types[3], types2[3];
Rect check1, check2;
@ -1116,10 +1116,10 @@ DBPickLabelLayer(def, lab, doCalma)
*/
int
dbPickFunc1(tile, dinfo, mask)
Tile *tile; /* Tile found. */
TileType dinfo; /* Split tile information */
TileTypeBitMask *mask; /* Mask to be modified. */
dbPickFunc1(
Tile *tile, /* Tile found. */
TileType dinfo, /* Split tile information */
TileTypeBitMask *mask) /* Mask to be modified. */
{
TileType type;
@ -1143,10 +1143,10 @@ dbPickFunc1(tile, dinfo, mask)
*/
int
dbPickFunc2(tile, dinfo, mask)
Tile *tile; /* Tile found. */
TileType dinfo; /* Split tile information */
TileTypeBitMask *mask; /* Mask to be modified. */
dbPickFunc2(
Tile *tile, /* Tile found. */
TileType dinfo, /* Split tile information */
TileTypeBitMask *mask) /* Mask to be modified. */
{
TileType type;
TileTypeBitMask tmp, *rMask;
@ -1230,9 +1230,9 @@ DBFontInitCurves()
*/
void
CalcBezierPoints(fp, bp)
FontPath *fp; /* Pointer to last point of closed path */
FontPath *bp; /* Pointer to 1st of 3 bezier control points */
CalcBezierPoints(
FontPath *fp, /* Pointer to last point of closed path */
FontPath *bp) /* Pointer to 1st of 3 bezier control points */
{
FontPath *newPath, *curPath;
Point *beginPath, *ctrl1, *ctrl2, *endPath;
@ -1286,8 +1286,8 @@ CalcBezierPoints(fp, bp)
*/
char *
dbGetToken(ff)
FILE *ff;
dbGetToken(
FILE *ff)
{
static char line[512];
static char *lineptr = NULL;
@ -1351,8 +1351,8 @@ dbGetToken(ff)
*/
void
DBFontLabelSetBBox(label)
Label *label;
DBFontLabelSetBBox(
Label *label)
{
char *tptr;
Point *coffset, rcenter;
@ -1511,12 +1511,12 @@ DBFontLabelSetBBox(label)
*/
int
DBFontChar(font, ccode, clist, coffset, cbbox)
int font; /* Index of font */
char ccode; /* ASCII character code */
FontChar **clist; /* Return vector list here */
Point **coffset; /* Return position offset here */
Rect **cbbox; /* Return bounding box here */
DBFontChar(
int font, /* Index of font */
char ccode, /* ASCII character code */
FontChar **clist, /* Return vector list here */
Point **coffset, /* Return position offset here */
Rect **cbbox) /* Return bounding box here */
{
if (font < 0 || font >= DBNumFonts) return - 1;
@ -1548,8 +1548,8 @@ DBFontChar(font, ccode, clist, coffset, cbbox)
*/
int
DBNameToFont(name)
char *name;
DBNameToFont(
char *name)
{
int i;
for (i = 0; i < DBNumFonts; i++)
@ -1585,9 +1585,9 @@ DBNameToFont(name)
#define NUMBUF 16
int
DBLoadFont(fontfile, scale)
char *fontfile;
float scale;
DBLoadFont(
char *fontfile,
float scale)
{
FILE *ff;
const char * const ascii_names[] = {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -25,6 +25,15 @@
#ifndef _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
#include "tiles/tile.h"
#endif
@ -784,7 +793,7 @@ typedef struct
extern void DBPaint();
extern void DBErase();
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 DBPaintPlaneWrapper();
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)
/* I/O */
extern bool DBCellRead();
extern bool DBCellRead(CellDef *cellDef, bool ignoreTech, bool dereference, int *errptr);
extern bool DBTestOpen();
extern char *DBGetTech();
extern bool DBCellWrite();
extern CellDef *DBCellReadArea();
extern CellDef *DBCellReadArea(CellUse *rootUse, Rect *rootRect, bool halt_on_error);
extern void DBFileRecovery();
extern bool DBWriteBackup();
extern bool DBReadBackup();
extern bool DBWriteBackup(char *filename, bool archive, bool doforall);
extern bool DBReadBackup(char *name, bool archive, bool usederef);
extern void DBRemoveBackup();
extern void DBPathSubstitute();
/* Labels */
extern Label *DBPutLabel();
extern Label *DBPutFontLabel();
extern Label *DBPutLabel(CellDef *cellDef, Rect *rect, int align, char *text, TileType type, unsigned short flags, unsigned int port);
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 bool DBEraseGlobLabel();
extern bool DBEraseLabel();
@ -856,9 +865,9 @@ extern void DBTechInitConnect();
/* Cell symbol table */
extern void DBCellInit();
extern void DBCellPrint();
extern void DBUsePrint();
extern void DBTopPrint();
extern void DBCellPrint(char *CellName, int who, bool dolist);
extern void DBUsePrint(char *CellName, int who, bool dolist);
extern void DBTopPrint(MagWindow *mw, bool dolist);
extern CellDef *DBCellLookDef();
extern CellDef *DBCellNewDef();
extern CellDef *DBCellDefAlloc();
@ -869,10 +878,10 @@ extern int DBCellSrDefs();
extern CellUse *DBCellNewUse();
extern bool DBCellDeleteUse();
extern CellUse *DBCellFindDup();
extern void DBLockUse();
extern void DBLockUse(char *UseName, bool bval);
extern void DBUnlockUse();
extern void DBOrientUse();
extern void DBAbutmentUse();
extern void DBOrientUse(char *UseName, bool dodef);
extern void DBAbutmentUse(char *UseName, bool dolist);
/* Cell selection */
extern CellUse *DBSelectCell();
@ -935,24 +944,24 @@ extern bool DBIsAncestor();
extern void DBCellSetAvail();
extern void DBCellClearAvail();
extern bool DBCellGetModified();
extern void DBCellSetModified();
extern void DBCellSetModified(CellDef *cellDef, bool ismod);
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 DBUpdateStamps();
extern void DBEnumerateTypes();
extern Plane *DBNewPlane();
extern bool DBDescendSubcell();
extern void DBCellCopyMaskHints();
extern void DBFlattenInPlace();
extern void DBCellFlattenAllCells();
extern void DBFlattenInPlace(CellUse *use, CellUse *dest, int xMask, bool dolabels, bool toplabels, bool doclear);
extern void DBCellFlattenAllCells(SearchContext *scx, CellUse *dest, int xMask, bool dolabels, bool toplabels);
extern PaintResultType (*DBNewPaintTable())[TT_MAXTYPES][TT_MAXTYPES];
typedef int (*IntProc)();
IntProc DBNewPaintPlane();
/* Diagnostic */
extern void DBTechPrintTypes();
extern void DBTechPrintTypes(TileTypeBitMask *mask, bool dolist);
extern void DBTechPrintCanonicalType();
/* Deallocation */
@ -973,7 +982,7 @@ extern void DBPropClearAll();
extern int DBTreeSrTiles();
extern int DBTreeSrUniqueTiles();
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 DBSrRoots();
extern int DBCellEnum();
@ -990,15 +999,15 @@ extern int dbSrConnectStartFunc(Tile *tile, TileType dinfo, ClientData clientDat
extern void DBEraseValid();
extern void DBPaintValid();
extern void DBTreeCountPaint();
extern void DBOpenOnly();
extern int DBLoadFont();
extern void DBOpenOnly(CellDef *cellDef, char *name, bool setFileName, int *errptr);
extern int DBLoadFont(char *fontfile, float scale);
extern int DBNameToFont();
extern int DBFontChar();
extern int DBFontChar(int font, char ccode, FontChar **clist, Point **coffset, Rect **cbbox);
extern void DBFontInitCurves();
extern void DBUndoEraseLabel();
extern void DBUndoPutLabel();
extern bool DBCellRename();
extern bool DBCellDelete();
extern bool DBCellRename(char *cellname, char *newname, bool doforce);
extern bool DBCellDelete(char *cellname, bool force);
extern int DBCellSrArea();
extern int DBSrCellPlaneArea(BPlane *plane, const Rect *rect, int (*func)(), ClientData arg);
extern int DBMoveCell();
@ -1012,7 +1021,7 @@ extern bool DBScalePoint();
extern int DBScaleCell();
extern TileType DBTechNameTypes();
extern void DBTreeFindUse();
extern void DBGenerateUniqueIds();
extern void DBGenerateUniqueIds(CellDef *def, bool warn);
extern void DBSelectionUniqueIds();
extern TileType DBInvTransformDiagonal();
extern bool DBIsSubcircuit();
@ -1028,7 +1037,7 @@ extern int DBSrCellUses();
extern TileType DBTechNameTypeExact();
extern void dbInstanceUnplace();
extern int dbIsPrimary();
extern void dbTechMatchResidues();
extern void dbTechMatchResidues(TileTypeBitMask *inMask, TileTypeBitMask *outMask, bool contactsOnly);
extern void DBUndoInit();
extern void DBResetTilePlane();
extern void DBResetTilePlaneSpecial();
@ -1038,12 +1047,12 @@ extern int DBSrConnect();
extern char *dbFgets();
extern void DBAdjustLabelsNew();
extern bool DBScaleValue();
extern int DBMergeNMTiles0();
extern int DBMergeNMTiles0(Plane *plane, Rect *area, PaintUndoInfo *undo, bool mergeOnce);
extern int DBSearchLabel();
extern int dbCellUniqueTileSrFunc();
extern void DBWDrawFontLabel();
extern void DBCellCopyManhattanPaint();
extern bool dbScalePlane();
extern bool dbScalePlane(Plane *oldplane, Plane *newplane, int pnum, int scalen, int scaled, bool doCIF);
extern int DBPaintPlaneVert();
/* -------------------------- Layer locking ------------------------------*/

View File

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