comparison src/xmu.c @ 48:56c54cf7c5b6 r19-16b90

Import from CVS: tag r19-16b90
author cvs
date Mon, 13 Aug 2007 08:56:04 +0200
parents 0293115a14e9
children 131b0175ea99
comparison
equal deleted inserted replaced
47:11c6df210d7f 48:56c54cf7c5b6
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)) {