gfsmIndexedIO.h
Go to the documentation of this file.
1 
2 /*=============================================================================*\
3  * File: gfsmIndexedIO.h
4  * Author: Bryan Jurish <moocow.bovine@gmail.com>
5  * Description: finite state machine library: indexed automata: I/O
6  *
7  * Copyright (c) 2007 Bryan Jurish.
8  *
9  * For information on usage and redistribution, and for a DISCLAIMER
10  * OF ALL WARRANTIES, see the file "COPYING" in this distribution.
11  *
12  * This library is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Lesser General Public
14  * License as published by the Free Software Foundation; either
15  * version 3 of the License, or (at your option) any later version.
16  *
17  * This library is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  * Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public
23  * License along with this library; if not, write to the Free Software
24  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25  *=============================================================================*/
26 
31 #ifndef _GFSM_INDEXED_IO_H
32 #define _GFSM_INDEXED_IO_H
33 
34 #include <gfsmAutomatonIO.h>
35 #include <gfsmIndexed.h>
36 
37 /*======================================================================
38  * Types
39  */
41 typedef struct {
42  gchar magic[16];
49  guint32 srtype;
50  guint32 sort_mask;
51  guint32 reserved2;
52  guint32 reserved3;
54 
55 /*======================================================================
56  * Constants
57  */
58 
60 extern const gchar gfsm_indexed_header_magic[16];
61 
64 
67 
68 /*======================================================================
69  * Methods: Binary I/O
70  */
72 
73 
77 
80 
83 
85 gboolean gfsm_indexed_automaton_load_bin_filename(gfsmIndexedAutomaton *fsm, const gchar *filename, gfsmError **errp);
86 
89 
90 /*--------------------------------------------------------------*/
91 
94 
97 
99 gboolean gfsm_indexed_automaton_save_bin_filename_nc(gfsmIndexedAutomaton *fsm, const gchar *filename, gfsmError **errp);
100 
105 gboolean gfsm_indexed_automaton_save_bin_filename(gfsmIndexedAutomaton *fsm, const gchar *filename, int zlevel, gfsmError **errp);
106 
109 
111 
112 /*======================================================================
113  * Automaton Methods: Text I/O
114  */
116 
117 
120  gfsmIOHandle *ioh,
121  gfsmAlphabet *lo_alphabet,
122  gfsmAlphabet *hi_alphabet,
123  gfsmAlphabet *state_alphabet,
124  gfsmError **errp);
125 
126 
129  FILE *f,
130  gfsmAlphabet *lo_alphabet,
131  gfsmAlphabet *hi_alphabet,
132  gfsmAlphabet *state_alphabet,
133  int zlevel,
134  gfsmError **errp);
135 
137 #define gfsm_indexed_automaton_print_file(fsm,f,errp) \
138  gfsm_indexed_automaton_print_file_full(fsm,f,NULL,NULL,NULL,0,errp)
139 
142  const gchar *filename,
143  gfsmAlphabet *lo_alphabet,
144  gfsmAlphabet *hi_alphabet,
145  gfsmAlphabet *state_alphabet,
146  int zlevel,
147  gfsmError **errp);
148 
150 #define gfsm_indexed_automaton_print_filename(fsm,f,errp) \
151  gfsm_indexed_automaton_print_filename_full(fsm,f,NULL,NULL,NULL,0,errp)
152 
155  GString *gs,
156  gfsmAlphabet *lo_alphabet,
157  gfsmAlphabet *hi_alphabet,
158  gfsmAlphabet *state_alphabet,
159  gfsmError **errp);
160 
162 
163 #endif /* _GFSM_INDEXED_IO_H */