diff options
author | Norbert Preining <norbert@preining.info> | 2022-10-19 03:01:25 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2022-10-19 03:01:25 +0000 |
commit | 7b6cdf4c23e6ed232601dabc70f5553a8dee9c9b (patch) | |
tree | 608a2d05e7d0ffa5cde10be67db643ae542dc280 /support/chktex/OpSys.h | |
parent | 0b311348359e1406b173d9c0de4974af3e90f836 (diff) |
CTAN sync 202210190301
Diffstat (limited to 'support/chktex/OpSys.h')
-rw-r--r-- | support/chktex/OpSys.h | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/support/chktex/OpSys.h b/support/chktex/OpSys.h index 7ce3f1b527..d1b3f37689 100644 --- a/support/chktex/OpSys.h +++ b/support/chktex/OpSys.h @@ -59,7 +59,7 @@ * You may wish to modify the SetupVars() (OpSys.c) to better suit your * preferences. In any case, it should put the filename (and full path) * of the `.chktexrc' file into the ConfigFile array. The array is sized - * BUFSIZ bytes. + * BUFFER_SIZE bytes. * * The program does also assume that __unix__ is defined if the source is * compiled on a UNIX machine. @@ -83,6 +83,9 @@ # define EXIT_SUCCESS 0 #endif +#define EXIT_WARNINGS 2 +#define EXIT_ERRORS 3 + /* -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- */ /* @@ -182,6 +185,26 @@ # define BAKAPPENDIX ".bak" #endif + +/* -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- */ + +/* + * This defines the buffer size used in many places. The biggest + * limitation imposed by a small buffer is the size of a line which + * can be accurately processed by chktex. On the other hand, a large + * buffer size will waste memory. However, memory is quite cheap + * these days, especially considering the amount needed by ChkTeX. + * + * ChkTeX used to use BUFSIZ which was 1024 (fairly reasonable) on + * many UNIX-like systems, but was much smaller on Windows. So, + * instead we create our own buffer size and hope that no-one has + * lines longer than 4k. + * + */ + +#define BUFFER_SIZE 4096 + + /***************** END OF USER SETTABLE PREFERENCES *****************/ /********************************************************************/ @@ -189,14 +212,14 @@ struct WordList; #endif /* Sorry; there are now cyclic dependencies in the -* source tree. :-/ +* source tree. :-/ */ extern const char *ReverseOn; extern const char *ReverseOff; -extern char ConfigFile[BUFSIZ]; +extern char ConfigFile[BUFFER_SIZE]; +extern struct WordList ConfigFiles; -char *MatchFileName(char *String); int SetupVars(void); void SetupTerm(void); void AddAppendix(char *Name, const char *App); @@ -204,4 +227,7 @@ void tackon(char *, const char *); int LocateFile(const char *Filename, char *Dest, const char *App, struct WordList *wl); +void AddDirectoryFromRelativeFile(const char * Filename, struct WordList *TeXInputs); +int IsRegFile(const char *Filename); + #endif /* OPSYS_H */ |