This seems like it has 2 use cases.
Internal console management around reprinting command prompt, but many
modes of operation delegate the prompt processing to tkcon or readline.
Process termination to restore the termios.
The Tcl_Exit() replacement proc takes charge of calling exit()
So this function can be easily migrated to libc atexit() which will
now run during exit() not just before. Which seems ok for the purpose
of restoring the termios state of the tty.
This solution seems compatible with TCL8 as well so all calls to this
removed API are removed.
Note this patch also removes the invalidation (of the callback so
the deefault use of Tcl_Exit() is restored) before returning from
this function. atexit() usage can not be invalidated after
registration but that can be controlled with application flag
checked inside the callback function if needed.
I have observed scenarios where I need to issue 'reset' manually
after exiting magic, still understanding better the build types
and scenarios that triggers this.
Due to use of strcasecmp() or similar C API.
Maybe HAVE_STRINGS_H is needed ? If so which platforms needs this ?
clang18 default warning cleanup (strict)
Looks like -1 is accepted as placeholder, maybe it should be the
temporary->fn (filename mtime?).
Copilot Autofix rejected: LefRead(temporary->fn, FALSE, NULL);
related git blame utils/main.c:
8e80644d (2022-01-22 13:30:11 -0500 2078) int lefTimestamp; /* If not -1, use the value pointed to
8e80644d (2022-01-22 13:30:11 -0500 2884) int lefTimestamp;
related commit:
commit 8e80644dd7
Date: Sat Jan 22 13:30:11 2022 -0500
CodeQL: https://github.com/dlmiles/magic/security/code-scanning/28
Copilot Autofix rejected: DBFileRecovery(MainFileName);
database/DBio.c looks to take NULL as a value for automatic recovery.
Related commits:
commit 231a299b16 (tag: 8.2.0)
Date: Tue Apr 25 08:41:48 2017 -0400
Initial commit at Tue Apr 25 08:41:48 EDT 2017 by tim on stravinsky
client data value as the exit status value (this was not at
all clear from the documentation and required a bit of
experimentation). The fix allows Tcl scripts to exit magic
with a non-zero status by invoking "exit" in Tcl.
This commit makes the code (mostly) C99-compatible, enabling to compile
it without the -Wno-error=implicit-function-declaration flag. This
way, Magic becomes usable on arm64 architectures, specifically on Apple
computers with M1/M2 SoC.
traditionally been kept for backwards compatibility. However, the
operation of "ext2spice" and "ext2sim" as separate programs has
become extremely difficult to maintain, and so it has been dropped
in favor of folding both into the program as commands, as was done
a long time ago in the Tcl/Tk version.
presented on the command line, then all following arguments are
assumed to be arguments of the script and not additional input
to be processed by magic. This allows arguments to be passed to
scripts passed to magic on the command line.
If exit is called in a TCL script that is executed at startup, the libc
exit() function is called directly and we don't get a chance to reset
the terminal. We return to the shell with echo off, and have to run
"reset". A simple example:
echo exit > test.tcl
magic -noconsole -dnull test.tcl
There are a few ways we could solve this. We could register an exit
handler using atexit(). Here I use Tcl_SetExitProc() to register a
callback with the TCL interpreter.
read". While "lef read" normally annotates existing layout, this
option ensures that no additional cells are created from macros in
the input LEF file. (2) Added a check on the "Input off lambda grid"
warning during CIF/GDS input such that it is not repeated once issued,
as it tends to be output many times when it occurs.
enabling the "plow" command. At this time, however, not all
rules are being implemented correctly given the numerous changes
to the DRC handling since the last time "plow" was working. Fixes
are ongoing.
development had been halted since it was first created back in April.
Version 8.2 is now the official development version, with the first
development push to create a Cairo graphics interface.