Debian Codegraph @

texk/dvipos/utils.h

raw
1 /* dvipos-20070107
2
3 Copyright (C) 2003 by Jin-Hwan <[email protected]>
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
18 */
19
20 #ifndef _UTILS_H_
21 #define _UTILS_H_
22
23 #ifdef MIKTEX
24 #include "miktex.h"
25 #include "gnu-miktex.h"
26 #include "web2c-miktex.h"
27 #else
28 #include <kpathsea/kpathsea.h>
29 #endif
30
31 #include <stdio.h>
32
33 typedef int UNSIGNED_BYTE, SIGNED_BYTE, SIGNED_PAIR;
34 typedef unsigned UNSIGNED_PAIR;
35 typedef long UNSIGNED_TRIPLE, SIGNED_TRIPLE, SIGNED_QUAD;
36 typedef unsigned long UNSIGNED_QUAD;
37
38 extern UNSIGNED_BYTE get_unsigned_byte (FILE *fp);
39 extern SIGNED_BYTE get_signed_byte (FILE *fp);
40 extern UNSIGNED_PAIR get_unsigned_pair (FILE *fp);
41 extern SIGNED_PAIR get_signed_pair (FILE *fp);
42 extern UNSIGNED_TRIPLE get_unsigned_triple (FILE *fp);
43 extern UNSIGNED_TRIPLE get_unsigned_triple_kanji (FILE *fp);
44 extern SIGNED_TRIPLE get_signed_triple (FILE *fp);
45 extern UNSIGNED_QUAD get_unsigned_quad (FILE *fp);
46 extern SIGNED_QUAD get_signed_quad (FILE *fp);
47
48 extern void put_unsigned_byte (SIGNED_QUAD quad, FILE *fp);
49 extern void put_signed_byte (SIGNED_QUAD quad, FILE *fp);
50 extern void put_unsigned_pair (SIGNED_QUAD quad, FILE *fp);
51 extern void put_signed_pair (SIGNED_QUAD quad, FILE *fp);
52 extern void put_unsigned_triple (SIGNED_QUAD quad, FILE *fp);
53 extern void put_signed_triple (SIGNED_QUAD quad, FILE *fp);
54 extern void put_signed_quad (SIGNED_QUAD quad, FILE *fp);
55
56 extern void sput_signed_pair (char *buf, SIGNED_QUAD quad);
57 extern void sput_signed_quad (char *buf, SIGNED_QUAD quad);
58
59 #ifndef KPATHSEA
60 # ifdef concat
61 # undef concat
62 extern char *concat (const char *s1, const char *s2);
63 # endif
64 extern char *concat3 (const char *s1, const char *s2, const char *s3);
65 extern char *make_suffix (const char *s, const char *suffix);
66 #endif
67
68 #define M_FAIL 0x01
69 #define M_VERBOSE 0x02
70 #define M_WARNING 0x04
71 #define M_DEBUG 0x08
72 #define M_USAGE 0x10
73
74 extern void msg_out (int level, const char *fmt, ...);
75
76 /* Global Variables */
77 extern int verbose, do_smashchars;
78 extern FILE *infp, *outfp, *bbxfp, *frmfp;
79 extern char *infname, *bbxfname, *frmfname;
80 extern SIGNED_QUAD dbg_location, rule_width;
81
82 #define WEB_INFINITY 0x7FFFFFFFL //017777777777
83
84 #define VERSION "20070107"
85
86 #endif /* _UTILS_H_ */