6 #define MAX_CHAR_CODE 255
7 #define PRINTF_BUF_SIZE 1024
8 #define SMALL_BUF_SIZE 256
10 #define check_buf(size, buf_size) \
11 if ((size) >= buf_size - 2) \
12 pdftex_fail("buffer overflow [%i bytes]", (int)(buf_size))
14 #define append_char_to_buf(c, p, buf, buf_size) do { \
17 if (c == 13 || c == EOF) \
19 if (c != ' ' || (p > buf && p[-1] != 32)) { \
20 check_buf(p - buf, buf_size); \
25 #define append_eol(p, buf, buf_size) do { \
26 if (p - buf > 1 && p[-1] != 10) { \
27 check_buf(p - buf, buf_size); \
30 if (p - buf > 2 && p[-2] == 32) { \
37 #define remove_eol(p, buf) do { \
38 p = strend(buf) - 1; \
43 #define skip(p, c) if (*p == c) p++
44 #define strend(s) strchr(s, 0)
45 #define xtalloc(n, t) ((t *) xmalloc ((n) * sizeof (t)))
46 #define xfree(p) do { if (p != 0) free(p); p = 0; } while (0)
50 #define xstrdup strdup
51 #define xmalloc malloc
52 #define xfclose(a, b) (fclose(a))
53 #define isdigit(c) ((c) >= '0' && (c) <= '9')
54 #define search(a, b, c) (fopen(b, "rb"))