tables.c (228072) | tables.c (250125) |
---|---|
1/* tables.c - tables serialization code 2 * 3 * Copyright (c) 1990 The Regents of the University of California. 4 * All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * Vern Paxson. 8 * --- 43 unchanged lines hidden (view full) --- 52 */ 53#define TFLAGS_CLRDATA(flg) ((flg) & ~(YYTD_DATA8 | YYTD_DATA16 | YYTD_DATA32)) 54 55int yytbl_write32 (struct yytbl_writer *wr, flex_uint32_t v); 56int yytbl_write16 (struct yytbl_writer *wr, flex_uint16_t v); 57int yytbl_write8 (struct yytbl_writer *wr, flex_uint8_t v); 58int yytbl_writen (struct yytbl_writer *wr, void *v, flex_int32_t len); 59static flex_int32_t yytbl_data_geti (const struct yytbl_data *tbl, int i); | 1/* tables.c - tables serialization code 2 * 3 * Copyright (c) 1990 The Regents of the University of California. 4 * All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * Vern Paxson. 8 * --- 43 unchanged lines hidden (view full) --- 52 */ 53#define TFLAGS_CLRDATA(flg) ((flg) & ~(YYTD_DATA8 | YYTD_DATA16 | YYTD_DATA32)) 54 55int yytbl_write32 (struct yytbl_writer *wr, flex_uint32_t v); 56int yytbl_write16 (struct yytbl_writer *wr, flex_uint16_t v); 57int yytbl_write8 (struct yytbl_writer *wr, flex_uint8_t v); 58int yytbl_writen (struct yytbl_writer *wr, void *v, flex_int32_t len); 59static flex_int32_t yytbl_data_geti (const struct yytbl_data *tbl, int i); |
60/* XXX Not used |
|
60static flex_int32_t yytbl_data_getijk (const struct yytbl_data *tbl, int i, 61 int j, int k); | 61static flex_int32_t yytbl_data_getijk (const struct yytbl_data *tbl, int i, 62 int j, int k); |
63 */ |
|
62 63 64/** Initialize the table writer. 65 * @param wr an uninitialized writer 66 * @param the output file 67 * @return 0 on success 68 */ 69int yytbl_writer_init (struct yytbl_writer *wr, FILE * out) --- 255 unchanged lines hidden (view full) --- 325 rv = fwrite (&v, bytes, 1, wr->out); 326 if (rv != 1) 327 return -1; 328 wr->total_written += bytes; 329 return bytes; 330} 331 332 | 64 65 66/** Initialize the table writer. 67 * @param wr an uninitialized writer 68 * @param the output file 69 * @return 0 on success 70 */ 71int yytbl_writer_init (struct yytbl_writer *wr, FILE * out) --- 255 unchanged lines hidden (view full) --- 327 rv = fwrite (&v, bytes, 1, wr->out); 328 if (rv != 1) 329 return -1; 330 wr->total_written += bytes; 331 return bytes; 332} 333 334 |
335/* XXX Not Used */ 336#if 0 |
|
333/** Extract data element [i][j] from array data tables. 334 * @param tbl data table 335 * @param i index into higher dimension array. i should be zero for one-dimensional arrays. 336 * @param j index into lower dimension array. 337 * @param k index into struct, must be 0 or 1. Only valid for YYTD_ID_TRANSITION table 338 * @return data[i][j + k] 339 */ 340static flex_int32_t yytbl_data_getijk (const struct yytbl_data *tbl, int i, --- 18 unchanged lines hidden (view full) --- 359 k]; 360 default: 361 flex_die (_("invalid td_flags detected")); 362 break; 363 } 364 365 return 0; 366} | 337/** Extract data element [i][j] from array data tables. 338 * @param tbl data table 339 * @param i index into higher dimension array. i should be zero for one-dimensional arrays. 340 * @param j index into lower dimension array. 341 * @param k index into struct, must be 0 or 1. Only valid for YYTD_ID_TRANSITION table 342 * @return data[i][j + k] 343 */ 344static flex_int32_t yytbl_data_getijk (const struct yytbl_data *tbl, int i, --- 18 unchanged lines hidden (view full) --- 363 k]; 364 default: 365 flex_die (_("invalid td_flags detected")); 366 break; 367 } 368 369 return 0; 370} |
371#endif /* Not used */ |
|
367 368/** Extract data element [i] from array data tables treated as a single flat array of integers. 369 * Be careful for 2-dimensional arrays or for YYTD_ID_TRANSITION, which is an array 370 * of structs. 371 * @param tbl data table 372 * @param i index into array. 373 * @return data[i] 374 */ --- 123 unchanged lines hidden --- | 372 373/** Extract data element [i] from array data tables treated as a single flat array of integers. 374 * Be careful for 2-dimensional arrays or for YYTD_ID_TRANSITION, which is an array 375 * of structs. 376 * @param tbl data table 377 * @param i index into array. 378 * @return data[i] 379 */ --- 123 unchanged lines hidden --- |