Mercurial > hg > xemacs-beta
comparison src/xmu.c @ 120:cca96a509cfe r20-1b12
Import from CVS: tag r20-1b12
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:25:29 +0200 |
parents | 54cc21c15cbb |
children | 0132846995bd |
comparison
equal
deleted
inserted
replaced
119:d101af7320b8 | 120:cca96a509cfe |
---|---|
165 | 165 |
166 #define MAX_SIZE 255 | 166 #define MAX_SIZE 255 |
167 | 167 |
168 /* shared data for the image read/parse logic */ | 168 /* shared data for the image read/parse logic */ |
169 static short hexTable[256]; /* conversion value */ | 169 static short hexTable[256]; /* conversion value */ |
170 static Bool initialized = False; /* easier to fill in at run time */ | 170 static int hex_initialized; /* easier to fill in at run time */ |
171 | 171 |
172 | 172 |
173 /* | 173 /* |
174 * Table index for the hex values. Initialized once, first time. | 174 * Table index for the hex values. Initialized once, first time. |
175 * Used for translation value or delimiter significance lookup. | 175 * Used for translation value or delimiter significance lookup. |
199 /* delimiters of significance are flagged w/ negative value */ | 199 /* delimiters of significance are flagged w/ negative value */ |
200 hexTable[' '] = -1; hexTable[','] = -1; | 200 hexTable[' '] = -1; hexTable[','] = -1; |
201 hexTable['}'] = -1; hexTable['\n'] = -1; | 201 hexTable['}'] = -1; hexTable['\n'] = -1; |
202 hexTable['\t'] = -1; | 202 hexTable['\t'] = -1; |
203 | 203 |
204 initialized = True; | 204 hex_initialized = 1; |
205 } | 205 } |
206 | 206 |
207 /* | 207 /* |
208 * read next hex value in the input stream, return -1 if EOF | 208 * read next hex value in the input stream, return -1 if EOF |
209 */ | 209 */ |
266 #ifndef Xmalloc | 266 #ifndef Xmalloc |
267 #define Xmalloc(size) malloc(size) | 267 #define Xmalloc(size) malloc(size) |
268 #endif | 268 #endif |
269 | 269 |
270 /* first time initialization */ | 270 /* first time initialization */ |
271 if (initialized == False) initHexTable(); | 271 if (!hex_initialized) initHexTable(); |
272 | 272 |
273 /* error cleanup and return macro */ | 273 /* error cleanup and return macro */ |
274 #define RETURN(code) { if (data) free (data); return code; } | 274 #define RETURN(code) { if (data) free (data); return code; } |
275 | 275 |
276 while (fgets(line, MAX_SIZE, fstream)) { | 276 while (fgets(line, MAX_SIZE, fstream)) { |