1 /* $NetBSD: tables.h,v 1.2 2014/10/29 18:28:36 christos Exp $ */
3 /* tables.h - tables serialization code
5 * Copyright (c) 1990 The Regents of the University of California.
8 * This code is derived from software contributed to Berkeley by
11 * The United States Government has rights in this work pursuant
12 * to contract no. DE-AC03-76SF00098 between the United States
13 * Department of Energy and the University of California.
15 * This file is part of flex.
17 * Redistribution and use in source and binary forms, with or without
18 * modification, are permitted provided that the following conditions
21 * 1. Redistributions of source code must retain the above copyright
22 * notice, this list of conditions and the following disclaimer.
23 * 2. Redistributions in binary form must reproduce the above copyright
24 * notice, this list of conditions and the following disclaimer in the
25 * documentation and/or other materials provided with the distribution.
27 * Neither the name of the University nor the names of its contributors
28 * may be used to endorse or promote products derived from this software
29 * without specific prior written permission.
31 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
32 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
33 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
46 /* Tables serialization API declarations. */
47 #include "tables_shared.h"
50 flex_uint32_t total_written
;
51 /**< bytes written so far */
53 /**< position of th_ssize */
56 /* These are used by main.c, gen.c, etc.
57 * tablesext - if true, create external tables
58 * tablesfilename - filename for external tables
59 * tablesname - name that goes in serialized data, e.g., "yytables"
60 * tableswr - writer for external tables
61 * tablesverify - true if tables-verify option specified
62 * gentables - true if we should spit out the normal C tables
64 extern bool tablesext
, tablesverify
,gentables
;
65 extern char *tablesfilename
, *tablesname
;
66 extern struct yytbl_writer tableswr
;
68 int yytbl_writer_init (struct yytbl_writer
*, FILE *);
69 int yytbl_hdr_init (struct yytbl_hdr
*th
, const char *version_str
,
71 int yytbl_data_init (struct yytbl_data
*tbl
, enum yytbl_id id
);
72 int yytbl_data_destroy (struct yytbl_data
*td
);
73 int yytbl_hdr_fwrite (struct yytbl_writer
*wr
,
74 const struct yytbl_hdr
*th
);
75 int yytbl_data_fwrite (struct yytbl_writer
*wr
, struct yytbl_data
*td
);
76 void yytbl_data_compress (struct yytbl_data
*tbl
);
77 struct yytbl_data
*mkftbl (void);
87 /* vim:set expandtab cindent tabstop=4 softtabstop=4 shiftwidth=4 textwidth=0: */