|
Packit |
f00812 |
/* tables.h - tables serialization code
|
|
Packit |
f00812 |
*
|
|
Packit |
f00812 |
* Copyright (c) 1990 The Regents of the University of California.
|
|
Packit |
f00812 |
* All rights reserved.
|
|
Packit |
f00812 |
*
|
|
Packit |
f00812 |
* This code is derived from software contributed to Berkeley by
|
|
Packit |
f00812 |
* Vern Paxson.
|
|
Packit |
f00812 |
*
|
|
Packit |
f00812 |
* The United States Government has rights in this work pursuant
|
|
Packit |
f00812 |
* to contract no. DE-AC03-76SF00098 between the United States
|
|
Packit |
f00812 |
* Department of Energy and the University of California.
|
|
Packit |
f00812 |
*
|
|
Packit |
f00812 |
* This file is part of flex.
|
|
Packit |
f00812 |
*
|
|
Packit |
f00812 |
* Redistribution and use in source and binary forms, with or without
|
|
Packit |
f00812 |
* modification, are permitted provided that the following conditions
|
|
Packit |
f00812 |
* are met:
|
|
Packit |
f00812 |
*
|
|
Packit |
f00812 |
* 1. Redistributions of source code must retain the above copyright
|
|
Packit |
f00812 |
* notice, this list of conditions and the following disclaimer.
|
|
Packit |
f00812 |
* 2. Redistributions in binary form must reproduce the above copyright
|
|
Packit |
f00812 |
* notice, this list of conditions and the following disclaimer in the
|
|
Packit |
f00812 |
* documentation and/or other materials provided with the distribution.
|
|
Packit |
f00812 |
*
|
|
Packit |
f00812 |
* Neither the name of the University nor the names of its contributors
|
|
Packit |
f00812 |
* may be used to endorse or promote products derived from this software
|
|
Packit |
f00812 |
* without specific prior written permission.
|
|
Packit |
f00812 |
*
|
|
Packit |
f00812 |
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
|
|
Packit |
f00812 |
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
|
Packit |
f00812 |
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
Packit |
f00812 |
* PURPOSE.
|
|
Packit |
f00812 |
*/
|
|
Packit |
f00812 |
|
|
Packit |
f00812 |
#ifndef TABLES_H
|
|
Packit |
f00812 |
#define TABLES_H
|
|
Packit |
f00812 |
|
|
Packit |
f00812 |
#ifdef __cplusplus
|
|
Packit |
f00812 |
/* *INDENT-OFF* */
|
|
Packit |
f00812 |
extern "C" {
|
|
Packit |
f00812 |
/* *INDENT-ON* */
|
|
Packit |
f00812 |
#endif
|
|
Packit |
f00812 |
|
|
Packit |
f00812 |
/* Tables serialization API declarations. */
|
|
Packit |
f00812 |
#include "tables_shared.h"
|
|
Packit |
f00812 |
struct yytbl_writer {
|
|
Packit |
f00812 |
FILE *out;
|
|
Packit |
f00812 |
flex_uint32_t total_written;
|
|
Packit |
f00812 |
/**< bytes written so far */
|
|
Packit |
f00812 |
fpos_t th_ssize_pos;
|
|
Packit |
f00812 |
/**< position of th_ssize */
|
|
Packit |
f00812 |
};
|
|
Packit |
f00812 |
|
|
Packit |
f00812 |
/* These are used by main.c, gen.c, etc.
|
|
Packit |
f00812 |
* tablesext - if true, create external tables
|
|
Packit |
f00812 |
* tablesfilename - filename for external tables
|
|
Packit |
f00812 |
* tablesname - name that goes in serialized data, e.g., "yytables"
|
|
Packit |
f00812 |
* tableswr - writer for external tables
|
|
Packit |
f00812 |
* tablesverify - true if tables-verify option specified
|
|
Packit |
f00812 |
* gentables - true if we should spit out the normal C tables
|
|
Packit |
f00812 |
*/
|
|
Packit |
f00812 |
extern bool tablesext, tablesverify,gentables;
|
|
Packit |
f00812 |
extern char *tablesfilename, *tablesname;
|
|
Packit |
f00812 |
extern struct yytbl_writer tableswr;
|
|
Packit |
f00812 |
|
|
Packit |
f00812 |
int yytbl_writer_init (struct yytbl_writer *, FILE *);
|
|
Packit |
f00812 |
int yytbl_hdr_init (struct yytbl_hdr *th, const char *version_str,
|
|
Packit |
f00812 |
const char *name);
|
|
Packit |
f00812 |
int yytbl_data_init (struct yytbl_data *tbl, enum yytbl_id id);
|
|
Packit |
f00812 |
int yytbl_data_destroy (struct yytbl_data *td);
|
|
Packit |
f00812 |
int yytbl_hdr_fwrite (struct yytbl_writer *wr,
|
|
Packit |
f00812 |
const struct yytbl_hdr *th);
|
|
Packit |
f00812 |
int yytbl_data_fwrite (struct yytbl_writer *wr, struct yytbl_data *td);
|
|
Packit |
f00812 |
void yytbl_data_compress (struct yytbl_data *tbl);
|
|
Packit |
f00812 |
struct yytbl_data *mkftbl (void);
|
|
Packit |
f00812 |
|
|
Packit |
f00812 |
|
|
Packit |
f00812 |
#ifdef __cplusplus
|
|
Packit |
f00812 |
/* *INDENT-OFF* */
|
|
Packit |
f00812 |
}
|
|
Packit |
f00812 |
/* *INDENT-ON* */
|
|
Packit |
f00812 |
#endif
|
|
Packit |
f00812 |
#endif
|
|
Packit |
f00812 |
|
|
Packit |
f00812 |
/* vim:set expandtab cindent tabstop=4 softtabstop=4 shiftwidth=4 textwidth=0: */
|