Main Page
Related Pages
Data Structures
Files
File List
Globals
src
libgfsm
gfsmCompound.h
Go to the documentation of this file.
1
2
/*=============================================================================*\
3
* File: gfsmCompound.h
4
* Author: Bryan Jurish <moocow.bovine@gmail.com>
5
* Description: finite state machine library: basic compound types
6
*
7
* Copyright (c) 2004-2011 Bryan Jurish.
8
*
9
* This library is free software; you can redistribute it and/or
10
* modify it under the terms of the GNU Lesser General Public
11
* License as published by the Free Software Foundation; either
12
* version 3 of the License, or (at your option) any later version.
13
*
14
* This library is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
* Lesser General Public License for more details.
18
*
19
* You should have received a copy of the GNU Lesser General Public
20
* License along with this library; if not, write to the Free Software
21
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22
*=============================================================================*/
23
28
#ifndef _GFSM_COMPOUND_H
29
#define _GFSM_COMPOUND_H
30
31
#include <
gfsmEnum.h
>
32
#include <
gfsmWeightMap.h
>
33
34
/*======================================================================
35
* Compound Types
36
*/
38
typedef
guint32
gfsmLabelPair
;
39
41
typedef
struct
{
42
gfsmStateId
id1
;
43
gfsmStateId
id2
;
44
}
gfsmStatePair
;
45
47
51
typedef
guint8
gfsmComposeFilterState
;
52
54
59
typedef
struct
{
60
gfsmStateId
id1
;
61
gfsmStateId
id2
;
62
gfsmComposeFilterState
idf
;
63
}
gfsmComposeState
;
64
66
typedef
struct
{
67
gfsmStateId
id
;
68
gfsmWeight
w
;
69
}
gfsmStateWeightPair
;
70
73
typedef
gfsmEnum
gfsmStatePairEnum
;
74
77
typedef
gfsmEnum
gfsmComposeStateEnum
;
78
81
typedef
gfsmWeightHash
gfsmStatePair2WeightHash
;
82
83
84
/*======================================================================
85
* LabelPair: Methods
86
*/
88
89
91
GFSM_INLINE
92
gfsmLabelPair
gfsm_labelpair_new
(guint32 lo, guint32 hi);
93
95
GFSM_INLINE
96
gfsmLabelId
gfsm_labelpair_lower
(
gfsmLabelPair
lp);
97
99
GFSM_INLINE
100
gfsmLabelId
gfsm_labelpair_upper
(
gfsmLabelPair
lp);
101
103
#define gfsm_labelpair_hash g_direct_hash
104
106
#define gfsm_labelpair_equal g_direct_equal
107
109
gint
gfsm_labelpair_compare
(
gfsmLabelPair
lp1,
gfsmLabelPair
lp2);
110
112
gint
gfsm_labelpair_compare_with_data
(
gfsmLabelPair
lp1,
gfsmLabelPair
lp2, gpointer data);
114
115
/*======================================================================
116
* Methods: gfsmStatePair
117
*/
119
120
122
GFSM_INLINE
123
gfsmStatePair
*
gfsm_statepair_new
(
gfsmStateId
id1,
gfsmStateId
id2);
124
126
GFSM_INLINE
127
gfsmStatePair
*
gfsm_statepair_clone
(
gfsmStatePair
*sp);
128
132
GFSM_INLINE
133
void
gfsm_statepair_free
(
gfsmStatePair
*sp);
134
136
guint
gfsm_statepair_hash
(
gfsmStatePair
*sp);
137
139
gint
gfsm_statepair_compare
(
const
gfsmStatePair
*sp1,
const
gfsmStatePair
*sp2);
140
142
gboolean
gfsm_statepair_equal
(
const
gfsmStatePair
*sp1,
const
gfsmStatePair
*sp2);
143
145
146
/*======================================================================
147
* Methods: gfsmComposeState
148
*/
150
151
153
GFSM_INLINE
154
gfsmComposeState
*
gfsm_compose_state_new
(
gfsmStateId
id1,
gfsmStateId
id2,
gfsmComposeFilterState
idf);
155
157
GFSM_INLINE
158
gfsmComposeState
*
gfsm_compose_state_clone
(
gfsmComposeState
*sp);
159
163
GFSM_INLINE
164
void
gfsm_compose_state_free
(
gfsmComposeState
*csp);
165
167
guint
gfsm_compose_state_hash
(
gfsmComposeState
*sp);
168
170
gint
gfsm_compose_state_compare
(
const
gfsmComposeState
*sp1,
const
gfsmComposeState
*sp2);
171
173
gboolean
gfsm_compose_state_equal
(
const
gfsmComposeState
*sp1,
const
gfsmComposeState
*sp2);
174
176
177
178
/*======================================================================
179
* Methods: gfsmStateWeightPair
180
*/
182
183
185
GFSM_INLINE
186
gfsmStateWeightPair
*
gfsm_state_weight_pair_new
(
gfsmStateId
id
,
gfsmWeight
w);
187
189
GFSM_INLINE
190
gfsmStateWeightPair
*
gfsm_state_weight_pair_clone
(
const
gfsmStateWeightPair
*swp);
191
195
GFSM_INLINE
196
void
gfsm_state_weight_pair_free
(
gfsmStateWeightPair
*swp);
197
199
guint
gfsm_state_weight_pair_hash
(
gfsmStateWeightPair
*sp);
200
202
gint
gfsm_state_weight_pair_compare
(
const
gfsmStateWeightPair
*swp1,
const
gfsmStateWeightPair
*swp2,
gfsmSemiring
*sr);
203
205
gint
gfsm_state_weight_pair_compare_q
(
const
gfsmStateWeightPair
*swp1,
const
gfsmStateWeightPair
*swp2, gpointer data);
206
208
gboolean
gfsm_state_weight_pair_equal
(
const
gfsmStateWeightPair
*swp1,
const
gfsmStateWeightPair
*swp2);
209
211
212
/*======================================================================
213
* Methods: gfsmStatePairEnum
214
*/
216
217
221
GFSM_INLINE
222
gfsmStatePairEnum
*
gfsm_statepair_enum_new
(
void
);
223
225
#define gfsm_statepair_enum_clear gfsm_enum_clear
226
228
#define gfsm_statepair_enum_free gfsm_enum_free
229
231
232
/*======================================================================
233
* Methods: gfsmComposeStateEnum
234
*/
236
237
241
GFSM_INLINE
242
gfsmComposeStateEnum
*
gfsm_compose_state_enum_new
(
void
);
243
245
#define gfsm_compose_state_enum_clear gfsm_enum_clear
246
248
#define gfsm_compose_state_enum_free gfsm_enum_free
249
251
252
253
/*======================================================================
254
* Methods: gfsmStatePair2WeightHash
255
*/
257
258
262
GFSM_INLINE
263
gfsmStatePair2WeightHash
*
gfsm_statepair2weighthash_new
(
void
);
264
266
267
//-- inline definitions
268
#ifdef GFSM_INLINE_ENABLED
269
# include <gfsmCompound.hi>
270
#endif
271
272
#endif
/* _GFSM_COMPOUND_H */
Generated on Tue Oct 21 2014 09:44:47 for libgfsm by
1.8.1.2