1 /*-
2 ******************************************************************************
3 ******************************************************************************
4 **
5 **  MODULE
6 **
7 **      $RCSfile: datatype.h,v $
8 **      $Revision: 3.71 $
9 **      $Date: 1996/08/18 20:37:06 $
10 **
11 **  DESCRIPTION
12 **
13 **      A 32-bit implementation of BibTeX v0.99c for MS-DOS, OS/2 2.x,
14 **      Unix and VMS.  This C language implementation is based on the
15 **      original WEB source but it has been enhanced to support 8-bit input
16 **      characters and a very large processing capacity.
17 **
18 **      For documentation describing how to use and build this program,
19 **      see the 00README.TXT file that accompanies this distribution.
20 **
21 **  MODULE CONTENTS
22 **
23 **      This module defines the data types used in the BibTeX WEB source.  C
24 **      isn't as flexible as PASCAL when defining data types, so some of the
25 **      types defined are fairly abitrary.
26 **
27 **      There are particular problems when defining data types for variables
28 **      that will be used for indexing arrays.  Whilst the "short" data
29 **      type will often suffice, "unsigned short" has to be used to index
30 **      the string pool, which has 65,000 elements.  Care must be taken when
31 **      mixing signed and unsigned values, especially if the signed value
32 **      can be negative.
33 **
34 **  AUTHORS
35 **
36 **      Original WEB translation to C, conversion to "big" (32-bit) capacity,
37 **      addition of run-time selectable capacity and 8-bit support extensions
38 **      by:
39 **
40 **          Niel Kempson
41 **          Snowy Owl Systems Limited, Cheltenham, England
42 **          E-mail: kempson@snowyowl.co.uk
43 **
44 **      8-bit support extensions also by:
45 **
46 **          Alejandro Aguilar-Sierra
47 **          Centro de Ciencias de la Atm\'osfera,
48 **          Universidad Nacional Aut\'onoma de M\'exico, M\'exico
49 **          E-mail: asierra@servidor.unam.mx
50 **
51 **  COPYRIGHT
52 **
53 **      This implementation copyright (c) 1991-1995 by Niel Kempson
54 **           and copyright (c) 1995 by Alejandro Aguilar-Sierra.
55 **
56 **      This program is free software; you can redistribute it and/or
57 **      modify it under the terms of the GNU General Public License as
58 **      published by the Free Software Foundation; either version 1, or
59 **      (at your option) any later version.
60 **
61 **      This program is distributed in the hope that it will be useful,
62 **      but WITHOUT ANY WARRANTY; without even the implied warranty of
63 **      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
64 **      General Public License for more details.
65 **
66 **      You should have received a copy of the GNU General Public License
67 **      along with this program; if not, write to the Free Software
68 **      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
69 **
70 **      In other words, you are welcome to use, share and improve this
71 **      program.  You are forbidden to forbid anyone else to use, share
72 **      and improve what you give them.  Help stamp out software-hoarding!
73 **
74 **  ACKNOWLEDGEMENT
75 **
76 **      The original BibTeX was written by Oren Patashnik using Donald
77 **      Knuth's WEB system.  This format produces a PASCAL program for
78 **      execution and a TeX documented version of the source code. This
79 **      program started as a (manual) translation of the WEB source into C.
80 **
81 **  CHANGE LOG
82 **
83 **      $Log: datatype.h,v $
84 **      Revision 3.71  1996/08/18  20:37:06  kempson
85 **      Official release 3.71 (see HISTORY file for details).
86 **
87 **      Revision 3.70  1996/04/08  10:08:40  kempson
88 **      Final documentation & cosmetic changes for official release 3.70.
89 **
90 **      Revision 3.5  1995/09/24  20:44:37  kempson
91 **      Many changes for final beta test version.
92 **
93 **      Revision 3.4  1995/04/09  22:15:44  kempson
94 **      Placed under RCS control
95 **
96 ******************************************************************************
97 ******************************************************************************
98 */
99 #ifndef __DATATYPE_H__
100 # define __DATATYPE_H__             1
101 
102 
103 /*-
104 **============================================================================
105 ** Define the generic data types.  For the BIG version of BibTeX, we declare
106 ** that all integers are 32 bit.  This will only work on systems with a
107 ** 'flat' 32 bit addressing scheme and lots of virtual memory.
108 **============================================================================
109 */
110 typedef char                Boolean_T;
111 typedef unsigned char       UChar_T;
112 typedef char                Char_T;
113 typedef char                Integer8_T;
114 typedef FILE               *File_ptr;
115 typedef jmp_buf		    LongJumpBuf_T;
116 
117 
118 /*-
119 ** Define some data types for 16-bit BibTex
120 **
121 ** typedef short               Integer16_T;
122 ** typedef long                Integer32_T;
123 ** typedef unsigned short      Unsigned16_T;
124 ** typedef unsigned long       Unsigned32_T;
125 ** typedef Integer16_T         Integer_T;
126 */
127 
128 /*-
129 ** Define some data types for 32-bit BibTeX
130 */
131 typedef long                Integer16_T;
132 typedef long                Integer32_T;
133 typedef unsigned long       Unsigned16_T;
134 typedef unsigned long       Unsigned32_T;
135 typedef long                Integer_T;
136 
137 
138 /*-
139 **============================================================================
140 ** The generic data types defined above will be used to approximate the
141 ** data types used in the BibTeX WEB source.
142 **============================================================================
143 */
144 typedef UChar_T             ASCIICode_T;
145 typedef File_ptr            AlphaFile_T;
146 typedef Integer16_T         AuxNumber_T;
147 typedef Integer16_T         BibNumber_T;
148 typedef Integer16_T         BltInRange_T;
149 typedef Integer16_T         BufPointer_T;
150 typedef ASCIICode_T        *BufType_T;
151 typedef Integer16_T         CiteNumber_T;
152 typedef Integer16_T         FieldLoc_T;
153 typedef Integer8_T          FnClass_T;
154 
155 /*
156 **typedef Integer16_T         HashLoc_T;
157 **typedef Integer16_T         HashPointer_T;
158 **typedef Integer16_T         HashPtr2_T;
159 */
160 typedef Integer32_T         HashLoc_T;
161 typedef Integer32_T         HashPointer_T;
162 typedef Integer32_T         HashPtr2_T;
163 
164 typedef Integer8_T          IDType_T;
165 typedef Integer16_T         IntEntLoc_T;
166 typedef Integer8_T          LexType_T;
167 typedef Integer16_T         LitStkLoc_T;
168 typedef UChar_T             PdsLen_T;
169 typedef Integer8_T          PdsLoc_T;
170 typedef const Char_T       *PdsType_T;
171 typedef Unsigned16_T        PoolPointer_T;
172 typedef Integer8_T          StkType_T;
173 typedef Integer16_T         StrEntLoc_T;
174 typedef Integer8_T          StrGlobLoc_T;
175 typedef Integer8_T          StrIlk_T;
176 typedef Integer16_T         StrNumber_T;
177 typedef Integer16_T         WizFnLoc_T;
178 
179 
180 
181 #endif                          /* __DATATYPE_H__ */
182