gfsmCommon.h
Go to the documentation of this file.
1 
2 /*=============================================================================*\
3  * File: gfsmCommon.h
4  * Author: Bryan Jurish <moocow.bovine@gmail.com>
5  * Description: finite state machine library: common definitions
6  *
7  * Copyright (c) 2004-2008 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_COMMON_H
29 #define _GFSM_COMMON_H
30 
31 #include <gfsmConfig.h>
32 #include <glib.h>
33 
34 /*======================================================================
35  * Defines
36  */
37 #ifdef __GNUC__
38 # define GFSM_UNUSED __attribute__((unused))
39 #else
40 # define GFSM_UNUSED
41 #endif
42 
43 
44 /*======================================================================
45  * Basic Types
46  */
48 typedef guint16 gfsmLabelId;
49 
51 typedef guint32 gfsmLabelVal;
52 
54 typedef guint32 gfsmStateId;
55 
58 
60 typedef gfloat gfsmWeight;
61 
62 /*======================================================================
63  * Vector types
64  */
66 typedef GPtrArray gfsmLabelVector;
67 
69 typedef GPtrArray gfsmStateIdVector;
70 
71 
72 /*======================================================================
73  * Constants
74  */
76 extern const gfsmLabelId gfsmEpsilon;
77 
79 extern const gfsmLabelId gfsmEpsilon1;
80 
82 extern const gfsmLabelId gfsmEpsilon2;
83 
85 extern const gpointer gfsmNoKey;
86 
88 extern const gfsmLabelId gfsmNoLabel;
89 
91 extern const gfsmStateId gfsmNoState;
92 
96 extern const gfsmWeight gfsmNoWeight;
97 
98 #endif /* _GFSM_COMMON_H */