diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2020-02-06 23:02:45 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2020-02-06 23:02:45 +0000 |
commit | 4e707cbcf73bad6d48c8beecd1762c8c1398db07 (patch) | |
tree | 315a5bf5420f22b1751f7799152f7a574aac7516 /Build/source/utils/autosp/autosp-src/utils.c | |
parent | 2298366a350fef08543538b6cd2f5c181b8f2ff9 (diff) |
autosp 2020-02-06
git-svn-id: svn://tug.org/texlive/trunk@53702 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/autosp/autosp-src/utils.c')
-rw-r--r-- | Build/source/utils/autosp/autosp-src/utils.c | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/Build/source/utils/autosp/autosp-src/utils.c b/Build/source/utils/autosp/autosp-src/utils.c index ada298e8bfa..2e84a70ba40 100644 --- a/Build/source/utils/autosp/autosp-src/utils.c +++ b/Build/source/utils/autosp/autosp-src/utils.c @@ -22,7 +22,51 @@ /* utils.c - utilities for autosp, fixmsxpart.c and msxlint.c */ -# include "utils.h" +#ifdef HAVE_CONFIG_H /* for TeXLive */ +#include <config.h> +#endif + +# define PRIVATE static +# include <stdlib.h> +# include <string.h> +# include <stdio.h> +# include <ctype.h> + +# ifdef KPATHSEA +# include <kpathsea/getopt.h> +# else +# include <getopt.h> +# endif +# include <time.h> + +# define LINE_LEN 1024 + +# ifdef HAVE_STDBOOL_H +# include <stdbool.h> +# else +# ifndef HAVE__BOOL +# define _Bool signed char +# endif +# define bool _Bool +# define true 1 +# define false 0 +# endif + +extern size_t append (char *dst, char **offset, const char *src, size_t n); +/* Copies src to *offset and updates *offset accordingly (if possible). + * Assumes *offset is dst if offset == NULL. + * The src string must be null-terminated. + * Execution aborts unless **offset == '\0'. + * Returns (original offset - dst) + strlen(src); if >= n, the string was truncated. + */ + +extern bool prefix (const char *cs, const char *ct); /* is string cs[] a prefix of ct[]? */ +extern bool suffix (const char *cs, const char *ct); /* is string cs[] a suffix of ct[]? */ + +int lineno; + +extern void error (const char msg[]); /* abort with stderr message msg */ +extern void warning (const char msg[]); /* output warning message msg to stderr */ void warning (const char msg[]) /* output warning message msg to stderr */ |