Modified the file locking behavior so that the command "locking" is

recognized as a valid command when file locking has been disabled as
a compile-time option.  The command then generates an error on
"locking enable" but simply ignores the command "locking disable".
This commit is contained in:
Tim Edwards 2022-04-25 13:23:29 -04:00
parent fd4f239e2d
commit fe2eb6d390
5 changed files with 29 additions and 9 deletions

View File

@ -1 +1 @@
8.3.293 8.3.294

View File

@ -549,7 +549,6 @@ keepGoing(use, clientdata)
return 0; /* keep the search going */ return 0; /* keep the search going */
} }
#ifdef FILE_LOCKS
/* /*
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
* *
@ -578,6 +577,11 @@ keepGoing(use, clientdata)
* Side effects: * Side effects:
* Sets global boolean variable FileLocking. * Sets global boolean variable FileLocking.
* *
* Note:
* When magic is configured with --disable-locking, then this command
* is implemented such that "locking enable" does nothing, and
* "locking disable" generates an error.
*
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
@ -593,6 +597,7 @@ CmdLocking(w, cmd)
if (cmd->tx_argc <= 1) if (cmd->tx_argc <= 1)
{ {
#ifdef FILE_LOCKS
#ifdef MAGIC_WRAPPER #ifdef MAGIC_WRAPPER
/* Interpreter return value is the state of locking */ /* Interpreter return value is the state of locking */
Tcl_SetResult(magicinterp, (FileLocking) ? "enabled" : "disabled", Tcl_SetResult(magicinterp, (FileLocking) ? "enabled" : "disabled",
@ -612,8 +617,27 @@ CmdLocking(w, cmd)
} }
FileLocking = (option <= 4) ? FALSE : TRUE; FileLocking = (option <= 4) ? FALSE : TRUE;
} }
#else /* !FILE_LOCKS */
#ifdef MAGIC_WRAPPER
Tcl_SetResult(magicinterp,
"File locking disabled as a compile-time option",
TCL_VOLATILE);
#else
/* Print the status of file locking to the console */
TxPrintf("File locking disabled as a compile-time option\n");
#endif
}
else
{
option = Lookup(cmd->tx_argv[1], cmdLockingYesNo);
if (option < 0)
TxError("Unknown locking option \"%s\"\n", cmd->tx_argv[1]);
else if (option > 4) /* "true", "enable", "on", etc. */
TxError("Cannot enable locking because it has been disabled"
" as a compile-time option.\n");
}
#endif /* !FILE_LOCKS */
} }
#endif /* FILE_LOCKS */
/* /*
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------

View File

@ -47,9 +47,7 @@ extern void CmdEdit(), CmdElement(), CmdErase(), CmdExpand(), CmdExtract();
extern void CmdFeedback(), CmdFill(), CmdFindBox(), CmdFindLabel(), CmdFlush(); extern void CmdFeedback(), CmdFill(), CmdFindBox(), CmdFindLabel(), CmdFlush();
extern void CmdGetcell(), CmdGrid(), CmdIdentify(); extern void CmdGetcell(), CmdGrid(), CmdIdentify();
extern void CmdLabel(), CmdLoad(); extern void CmdLabel(), CmdLoad();
#ifdef FILE_LOCKS
extern void CmdLocking(); extern void CmdLocking();
#endif
extern void CmdMove(), CmdNetlist(), CmdOrient(), CmdPaint(), CmdPath(); extern void CmdMove(), CmdNetlist(), CmdOrient(), CmdPaint(), CmdPath();
extern void CmdPlow(), CmdPolygon(), CmdPort(), CmdProperty(); extern void CmdPlow(), CmdPolygon(), CmdPort(), CmdProperty();
extern void CmdRandom(), CmdSave(), CmdScaleGrid(), CmdSee(); extern void CmdRandom(), CmdSave(), CmdScaleGrid(), CmdSee();
@ -372,11 +370,9 @@ DBWInitCommands()
WindAddCommand(DBWclientID, WindAddCommand(DBWclientID,
"load [cellname] load a cell into a window", "load [cellname] load a cell into a window",
CmdLoad, FALSE); CmdLoad, FALSE);
#ifdef FILE_LOCKS
WindAddCommand(DBWclientID, WindAddCommand(DBWclientID,
"locking [enable|disable] enable or disable file locking", "locking [enable|disable] enable or disable file locking",
CmdLocking, FALSE); CmdLocking, FALSE);
#endif
WindAddCommand(DBWclientID, WindAddCommand(DBWclientID,
"move [dir [amount]] OR\n" "move [dir [amount]] OR\n"
"move to x y move box and selection, either by amount\n\ "move to x y move box and selection, either by amount\n\

View File

@ -1028,7 +1028,7 @@ DRCTechAddRule(sectionName, argc, argv)
"exact_overlap", 2, 2, drcExactOverlap, "exact_overlap", 2, 2, drcExactOverlap,
"layers", "layers",
"extend", 5, 6, drcExtend, "extend", 5, 6, drcExtend,
"layers1 layers2 distance why", "layers1 layers2 distance [option] why",
"no_overlap", 3, 3, drcNoOverlap, "no_overlap", 3, 3, drcNoOverlap,
"layers1 layers2", "layers1 layers2",
"option", 2, 2, drcOption, "option", 2, 2, drcOption,

View File

@ -155,7 +155,7 @@ extHierSubstrate(ha, use, x, y)
{ {
/* Check area under all of the subcircuit (not just the part */ /* Check area under all of the subcircuit (not just the part */
/* in the current interaction area). */ /* in the current interaction area). */
GeoTransRect(&use->cu_transform, &use->cu_def->cd_bbox, &subArea.r_ll); GeoTransRect(&use->cu_transform, &use->cu_def->cd_bbox, &subArea);
} }
for (pNum = PL_TECHDEPBASE; pNum < DBNumPlanes; pNum++) for (pNum = PL_TECHDEPBASE; pNum < DBNumPlanes; pNum++)