| 1 | /*  tables.h - 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 | * | 
|---|
| 9 | *  The United States Government has rights in this work pursuant | 
|---|
| 10 | *  to contract no. DE-AC03-76SF00098 between the United States | 
|---|
| 11 | *  Department of Energy and the University of California. | 
|---|
| 12 | * | 
|---|
| 13 | *  This file is part of flex. | 
|---|
| 14 | * | 
|---|
| 15 | *  Redistribution and use in source and binary forms, with or without | 
|---|
| 16 | *  modification, are permitted provided that the following conditions | 
|---|
| 17 | *  are met: | 
|---|
| 18 | * | 
|---|
| 19 | *  1. Redistributions of source code must retain the above copyright | 
|---|
| 20 | *     notice, this list of conditions and the following disclaimer. | 
|---|
| 21 | *  2. Redistributions in binary form must reproduce the above copyright | 
|---|
| 22 | *     notice, this list of conditions and the following disclaimer in the | 
|---|
| 23 | *     documentation and/or other materials provided with the distribution. | 
|---|
| 24 | * | 
|---|
| 25 | *  Neither the name of the University nor the names of its contributors | 
|---|
| 26 | *  may be used to endorse or promote products derived from this software | 
|---|
| 27 | *  without specific prior written permission. | 
|---|
| 28 | * | 
|---|
| 29 | *  THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR | 
|---|
| 30 | *  IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | 
|---|
| 31 | *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 
|---|
| 32 | *  PURPOSE. | 
|---|
| 33 | */ | 
|---|
| 34 |  | 
|---|
| 35 |  | 
|---|
| 36 | #ifndef TABLES_H | 
|---|
| 37 | #define TABLES_H | 
|---|
| 38 |  | 
|---|
| 39 | #ifdef __cplusplus | 
|---|
| 40 | /* *INDENT-OFF* */ | 
|---|
| 41 | extern  "C" { | 
|---|
| 42 | /* *INDENT-ON* */ | 
|---|
| 43 | #endif | 
|---|
| 44 |  | 
|---|
| 45 | /* Tables serialization API declarations. */ | 
|---|
| 46 | #include "tables_shared.h" | 
|---|
| 47 | struct yytbl_writer { | 
|---|
| 48 | FILE   *out; | 
|---|
| 49 | flex_uint32_t total_written; | 
|---|
| 50 | /**< bytes written so far */ | 
|---|
| 51 | fpos_t  th_ssize_pos; | 
|---|
| 52 | /**< position of th_ssize */ | 
|---|
| 53 | }; | 
|---|
| 54 |  | 
|---|
| 55 | /* These are used by main.c, gen.c, etc. | 
|---|
| 56 | * tablesext - if true, create external tables | 
|---|
| 57 | * tablesfilename - filename for external tables | 
|---|
| 58 | * tablesname - name that goes in serialized data, e.g., "yytables" | 
|---|
| 59 | * tableswr -  writer for external tables | 
|---|
| 60 | * tablesverify - true if tables-verify option specified | 
|---|
| 61 | * gentables - true if we should spit out the normal C tables | 
|---|
| 62 | */ | 
|---|
| 63 | extern bool tablesext, tablesverify,gentables; | 
|---|
| 64 | extern char *tablesfilename, *tablesname; | 
|---|
| 65 | extern struct yytbl_writer tableswr; | 
|---|
| 66 |  | 
|---|
| 67 | int     yytbl_writer_init (struct yytbl_writer *, FILE *); | 
|---|
| 68 | int     yytbl_hdr_init (struct yytbl_hdr *th, const char *version_str, | 
|---|
| 69 | const char *name); | 
|---|
| 70 | int     yytbl_data_init (struct yytbl_data *tbl, enum yytbl_id id); | 
|---|
| 71 | int     yytbl_data_destroy (struct yytbl_data *td); | 
|---|
| 72 | int     yytbl_hdr_fwrite (struct yytbl_writer *wr, | 
|---|
| 73 | const struct yytbl_hdr *th); | 
|---|
| 74 | int     yytbl_data_fwrite (struct yytbl_writer *wr, struct yytbl_data *td); | 
|---|
| 75 | void    yytbl_data_compress (struct yytbl_data *tbl); | 
|---|
| 76 | struct yytbl_data *mkftbl (void); | 
|---|
| 77 |  | 
|---|
| 78 |  | 
|---|
| 79 | #ifdef __cplusplus | 
|---|
| 80 | /* *INDENT-OFF* */ | 
|---|
| 81 | } | 
|---|
| 82 | /* *INDENT-ON* */ | 
|---|
| 83 | #endif | 
|---|
| 84 | #endif | 
|---|
| 85 |  | 
|---|
| 86 | /* vim:set expandtab cindent tabstop=4 softtabstop=4 shiftwidth=4 textwidth=0: */ | 
|---|