Main Page
Related Pages
Data Structures
Files
File List
Globals
src
libgfsm
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
45
GFSM_INLINE
46
guint
gfsm_bitvector_bits2bytes_
(guint nbits);
47
49
GFSM_INLINE
50
guint
gfsm_bitvector_bytes2bits_
(guint nbytes);
51
53
54
/*======================================================================
55
* Constructors etc.
56
*/
58
59
61
GFSM_INLINE
62
gfsmBitVector
*
gfsm_bitvector_new
(
void
);
63
65
GFSM_INLINE
66
gfsmBitVector
*
gfsm_bitvector_sized_new
(guint nbits);
67
69
GFSM_INLINE
70
void
gfsm_bitvector_resize
(
gfsmBitVector
*bv, guint nbits);
71
73
GFSM_INLINE
74
guint
gfsm_bitvector_size
(
gfsmBitVector
*bv);
75
77
GFSM_INLINE
78
void
gfsm_bitvector_clear
(
gfsmBitVector
*bv);
79
81
GFSM_INLINE
82
gfsmBitVector
*
gfsm_bitvector_zero
(
gfsmBitVector
*bv);
83
85
GFSM_INLINE
86
gfsmBitVector
*
gfsm_bitvector_one
(
gfsmBitVector
*bv);
87
89
GFSM_INLINE
90
void
gfsm_bitvector_free
(
gfsmBitVector
*bv);
92
93
/*======================================================================
94
* Accessors
95
*/
97
98
101
GFSM_INLINE
102
gboolean
gfsm_bitvector_get
(
gfsmBitVector
*bv, guint i);
103
107
GFSM_INLINE
108
void
gfsm_bitvector_set
(
gfsmBitVector
*bv, guint i, gboolean v);
109
111
112
/*======================================================================
113
* I/O
114
*/
116
117
124
gboolean
gfsm_bitvector_write_bin_handle
(
gfsmBitVector
*bv,
gfsmIOHandle
*ioh,
gfsmError
**errp);
125
132
gboolean
gfsm_bitvector_read_bin_handle
(
gfsmBitVector
*bv,
gfsmIOHandle
*ioh,
gfsmError
**errp);
133
135
136
//-- inline definitions
137
#ifdef GFSM_INLINE_ENABLED
138
# include <gfsmBitVector.hi>
139
#endif
140
141
#endif
/* _GFSM_BITVECTOR_H */
Generated on Tue Oct 21 2014 09:44:47 for libgfsm by
1.8.1.2