gfsmBitVector.h
Go to the documentation of this file.
1 
2 /*=============================================================================*\
3  * File: gfsmBitVector.h
4  * Author: Bryan Jurish <moocow.bovine@gmail.com>
5  * Description: finite state machine library
6  *
7  * Copyright (c) 2004-2007 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_BITVECTOR_H
29 #define _GFSM_BITVECTOR_H
30 
31 #include <gfsmIO.h>
32 
33 /*======================================================================
34  * Types
35  */
37 typedef GArray gfsmBitVector;
38 
39 /*======================================================================
40  * Utilities
41  */
43 
44 
46 guint gfsm_bitvector_bits2bytes_(guint nbits);
47 
50 guint gfsm_bitvector_bytes2bits_(guint nbytes);
51 
53 
54 /*======================================================================
55  * Constructors etc.
56  */
58 
59 
63 
67 
70 void gfsm_bitvector_resize(gfsmBitVector *bv, guint nbits);
71 
75 
79 
83 
87 
92 
93 /*======================================================================
94  * Accessors
95  */
97 
98 
102 gboolean gfsm_bitvector_get(gfsmBitVector *bv, guint i);
103 
108 void gfsm_bitvector_set(gfsmBitVector *bv, guint i, gboolean v);
109 
111 
112 /*======================================================================
113  * I/O
114  */
116 
117 
125 
133 
135 
136 //-- inline definitions
137 #ifdef GFSM_INLINE_ENABLED
138 # include <gfsmBitVector.hi>
139 #endif
140 
141 #endif /* _GFSM_BITVECTOR_H */