Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / programs / dtdocbook / sgmls / sgmlaux.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /* $XConsortium: sgmlaux.h /main/3 1996/06/19 17:17:25 drk $ */
24 /* This file controls the interface between the parser core and the auxiliary
25 functions in entgen.c, sgmlio.c, and sgmlmsg.c */
26
27 #include "std.h"
28 #include "entity.h"
29 #include "sgmldecl.h"
30
31 /* Error types (ERRTYPE) for calls to error-handling services
32    performed for SGML by the text processor (SGMLIO).
33    NOTE: Strings in these blocks have no lengths, but cannot exceed
34    NAMELEN (plus 1 more byte for the zero terminator).
35 */
36 #define FILERR    0           /* Error: file access. */
37 #define DOCERR    1           /* Error: in document markup. */
38 #define MDERR     2           /* Error: in markup declaration with subdcl. */
39 #define MDERR2    3           /* Error: in markup declaration with no subdcl. */
40 #define EXITERR   4           /* Error: terminal error in document markup. */
41 /* Quantities affecting error messages and their arguments.
42 */
43 #define MAXARGS    2          /* Maximum number of arguments in a msg. */
44
45 /* NOTE: Error handler must return, or next call to SGML must be RSET or END,
46          except for EXITERR errors which must not return.
47 */
48 struct error {                /* IPB for error messages. */
49      UNS errtype;             /* Type of error: DOC, MD, MD2, FIL. */
50      UNS errnum;              /* Error number. */
51      UNS errsp;               /* Special parameter index in message file. */
52      int sverrno;             /* Saved value of errno. */
53      int parmno;              /* MDERROR: declaration parameter number. */
54      UNCH *subdcl;            /* MDERROR: subject of declaration. */
55      UNIV eparm[MAXARGS];     /* Ptrs to arguments (no length, but EOS). */
56 };
57
58 struct location {
59      int filesw;
60      unsigned long rcnt;
61      int ccnt;
62      UNCH curchar;
63      UNCH nextchar;
64      UNCH *ename;
65      UNIV fcb;
66 };
67
68 int ioopen P((UNIV, UNIV*));
69 VOID ioclose P((UNIV));
70 int ioread P((UNIV, UNCH *, int *));
71 VOID iopend P((UNIV, int, UNCH *));
72 int iocont P((UNIV));
73 VOID ioinit P((struct switches *));
74 char *ioflid P((UNIV));
75
76 UNIV entgen P((struct fpi *));
77
78 VOID msgprint P((struct error *));
79 VOID msginit P((struct switches *));
80 UNIV msgsave P((struct error *));
81 VOID msgsprint P((UNIV));
82 VOID msgsfree P((UNIV));
83 int msgcnterr P((void));
84
85
86 int inprolog P((void));
87 UNCH *getgi P((int));
88
89 int getlocation P((int, struct location *));
90 UNIV rmalloc P((unsigned int));
91 UNIV rrealloc P((UNIV, UNS));
92 VOID frem P((UNIV));
93 VOID exiterr P((unsigned int,struct parse *));