Commit Graph

33 Commits

Author SHA1 Message Date
Darryl L. Miles 722209b1ae parser.c: ParsSplit() constify (const char **remainder) 2025-10-04 20:50:31 -04:00
Darryl L. Miles d55a2b74ac header file #ifndef guard namespace consistency (global change)
This add an effective namespace prefix to the guard ifndef
2025-07-29 10:50:32 -04:00
Darryl L. Miles f88c7a86cb utils/magic_zlib.h: limit #include <zlib.h> to files that need it
Remove limited use HAVE_ZLIB wrapper API into separate header as
utils.h is used in many places and most source files don't need
to drag in the header file from this external dependency.

Copyright date(s) taken from original source file / git blame.
2025-07-29 10:50:32 -04:00
Darryl L. Miles f22ecda44a set.c: SetNoisyBool() constify and add prototype 2024-12-26 15:20:58 -05:00
Darryl L. Miles 2b69b07860 set.c: SetNoisyDI() constify and add prototype 2024-12-26 15:20:58 -05:00
Darryl L. Miles f51ad56aea set.c: SetNoisyInt() constify and add prototype 2024-12-26 15:20:58 -05:00
Darryl L. Miles 5b97638ac7 port.c: MagAtof() constify and add prototype 2024-12-26 15:20:58 -05:00
Darryl L. Miles 14a8409e40 utils.h: Wait()/WaitPid() add prototype 2024-12-26 15:20:58 -05:00
Darryl L. Miles 265ace5c9f path.c: PaEnum() constify and add prototype 2024-12-26 15:20:58 -05:00
Darryl L. Miles c77d3852d5 path.c: PaOpen() constify and add prototype 2024-12-26 15:20:58 -05:00
Darryl L. Miles fd7eab2193 path.c: PaZOpen() constify and add prototype 2024-12-26 15:20:58 -05:00
Darryl L. Miles d077368436 path.c: PaLockOpen() constify and add prototype 2024-12-26 15:20:58 -05:00
Darryl L. Miles 875d825afb path.c: PaLockZOpen() constify and add prototype 2024-12-26 15:20:58 -05:00
Darryl L. Miles bfb411d19f path.c: nextName() constify and add prototype 2024-12-26 15:20:58 -05:00
Darryl L. Miles feef9730f3 path.c: PaExpand() constify and add prototype 2024-12-26 15:20:58 -05:00
Darryl L. Miles 6a6f85862e path.c: PaAppend() constify and add prototype 2024-12-26 15:20:58 -05:00
Darryl L. Miles fca164715e PaCheckCompressed() constify implementation 2024-12-26 15:20:58 -05:00
Darryl L. Miles e7bfa72298 args.c: ArgStr() constify and add prototype 2024-12-26 15:20:58 -05:00
Darryl L. Miles 2ba1d20ab4 utils/match.c constify Match() and add prototype 2024-12-26 15:20:58 -05:00
Darryl L. Miles f5b41a06d6 utils/lookup*.c: constify the API
extern int Lookup(const char *str, const char * const *table);
extern int LookupAny(char, const char * const *);
extern int LookupFull(const char *, const char **);
extern int LookupStruct(const char *str, const LookupTable *table_start, int size);
extern int LookupStructFull(const char *str, const char * const *table, int size);
2024-12-26 15:20:58 -05:00
Darryl L. Miles fd6c30a380 geometry.c: constify and add prototypes 2024-12-26 15:10:35 -05:00
Darryl L. Miles 91da638579 utils/strdup.c: StrDup() and mode constifiy impl 2024-12-26 15:10:35 -05:00
Tim Edwards 075262b2ef Added the ability to read compressed .mag files (writing is not yet
supported).  Fixed the long-standing issue in which DRC does not
get stopped by the "drc off" command (the behavior for interrupting
the DRC was dependent on the DRC being turned on, and the "drc off"
command was turning it off before breaking, causing the interrupt
to be ignored).
2022-11-02 17:12:46 -04:00
Tim Edwards d229aefb15 A handful of changes after applying pull request #191 from
Alessandro De Laurenzis.  That pull request cleaned up the vast
majority of compiler warnings.  However, that cleanup exposed a
few additional warnings pointing to errors in the code that needed
fixing.  The code now compiles cleanly except for one warning
about redefined CAD_DIR that I have not looked into.
2022-10-29 09:57:41 -04:00
Alessandro De Laurenzis 68cecd5382 C99 code compat when configured with no TCL support 2022-10-29 06:07:46 +02:00
Alessandro De Laurenzis b306a39560 Compatibility with C99 standard
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.
2022-10-29 06:07:46 +02:00
Tim Edwards 371018ae4b Implemented native gzip compression/decompression using zlib routines.
Compression levels of the output can be controlled with the "gds
compress [<value>]" command, where <value> 0 (default) is uncompressed
output, 6 is "normal" gzip compression, and 9 is maximum compression.
2022-05-10 09:19:39 -04:00
Tim Edwards 6e0768ebd4 Removed the "-k" option from "gunzip", which is not only redundant
with "-c" but is unsupported on some OS versions of gunzip.
2022-05-09 15:27:51 -04:00
Tim Edwards 85d8ad6622 Added the capability to handle compressed GDS files through the use
of systems calls to "gzip" and "gunzip".  A compressed GDS file can
be made simply by doing "gds write <name>.gds.gz", and can be read
simply by doing "gds read <name>.gds.gz".  Names of compressed files
can be put in the GDS_FILE property of a cell.
2022-05-05 17:40:56 -04:00
Tim Edwards 1bb4cb92ea Played around with the file locking and discovered to my chagrin that
whenever a process writes a cell to disk, it immediately releases the
file lock it had on that cell, which is clearly not the intent of file
locking.  Fixed this issue.  On a related topic, revised the "cellname
writeable" command so that it can make a cell editable even if the cell
has an advisory lock and cannot be made writeable.  Perhaps there should
be a clearer distinction here between "writeable" and "editable".  Also:
Reconsidered the previous commit, which removed the "--disable-locking"
from the configuration options.  Because some operating systems may not
implement fnctl()-based file locking (Cygwin, for one, apparently doesn't),
it is still useful to be able to completely remove the function, in case
the operating system will fail to recognize the fnctl() values in the
code.  Now, file locking behavior can be permanently removed through the
configuration option, or temporarily disabled from the command line.
2022-01-01 16:53:46 -05:00
Tim Edwards e4d1c29112 Reworked the file locking option as a command instead of as a
compile-time option.  The behavior can now be controlled from
within the program with "locking disable" or "locking enable".
2022-01-01 14:28:59 -05:00
Tim Edwards 2af38a4191 Updates from running the fix-ending-whitespace script. 2020-05-23 17:13:14 -04:00
Tim Edwards 231a299b16 Initial commit at Tue Apr 25 08:41:48 EDT 2017 by tim on stravinsky 2017-04-25 08:41:48 -04:00