Main Page
Related Pages
Data Structures
Files
File List
Globals
src
libgfsm
gfsmArcList.h
Go to the documentation of this file.
1
2
/*=============================================================================*\
3
* File: gfsmArcList.h
4
* Author: Bryan Jurish <moocow.bovine@gmail.com>
5
* Description: finite state machine library: arc lists
6
* + formerly defined in gfsmArc.h
7
*
8
* Copyright (c) 2004-2011 Bryan Jurish.
9
*
10
* This library is free software; you can redistribute it and/or
11
* modify it under the terms of the GNU Lesser General Public
12
* License as published by the Free Software Foundation; either
13
* version 3 of the License, or (at your option) any later version.
14
*
15
* This library is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18
* Lesser General Public License for more details.
19
*
20
* You should have received a copy of the GNU Lesser General Public
21
* License along with this library; if not, write to the Free Software
22
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23
*=============================================================================*/
24
33
#ifndef _GFSM_ARC_LIST_H
34
#define _GFSM_ARC_LIST_H
35
36
#include <
gfsmArc.h
>
37
#include <
gfsmMem.h
>
38
40
typedef
struct
gfsmArcListNode_
{
41
gfsmArc
arc
;
42
struct
gfsmArcListNode_
*
next
;
43
}
gfsmArcListNode
;
44
46
typedef
gfsmArcListNode
gfsmArcList
;
47
48
49
/*======================================================================
50
* Methods: Arc List: Constructors etc.
51
*/
53
54
59
GFSM_INLINE
60
gfsmArcList
*
gfsm_arclist_prepend_node
(
gfsmArcList
*al,
gfsmArcList
*nod);
61
63
GFSM_INLINE
64
gfsmArcList
*
gfsm_arclist_new_full
(
gfsmStateId
src,
65
gfsmStateId
dst,
66
gfsmLabelVal
lo,
67
gfsmLabelVal
hi,
68
gfsmWeight
wt,
69
gfsmArcList
*nxt);
70
71
83
GFSM_INLINE
84
gfsmArcList
*
gfsm_arclist_insert
(
gfsmArcList
*al,
85
gfsmStateId
src,
86
gfsmStateId
dst,
87
gfsmLabelVal
lo,
88
gfsmLabelVal
hi,
89
gfsmWeight
wt,
90
gfsmArcCompData
*acdata);
91
92
100
GFSM_INLINE
101
gfsmArcList
*
gfsm_arclist_insert_node
(
gfsmArcList
*al,
gfsmArcList
*nod,
gfsmArcCompData
*acdata);
102
104
gfsmArcList
*
gfsm_arclist_insert_node_sorted
(
gfsmArcList
*al,
gfsmArcList
*link,
gfsmArcCompData
*acdata);
105
107
gfsmArcList
*
gfsm_arclist_clone
(
gfsmArcList
*src);
108
109
111
void
gfsm_arclist_free
(
gfsmArcList
*al);
112
113
/* Free a single node of an arc-list */
114
GFSM_INLINE
115
void
gfsm_arclist_free_1
(
gfsmArcList
*nod);
116
118
119
/*======================================================================
120
* Methods: Arc List: Accessors
121
*/
123
124
129
#define gfsm_arclist_arc(al) \
130
((al) ? (&(al->arc)) : NULL)
131
132
// ((al) ? ((gfsmArc*)((al)->data)) : NULL)
133
139
gfsmArcList
*
gfsm_arclist_concat
(
gfsmArcList
*al1,
gfsmArcList
*al2);
140
148
gfsmArcList
*
gfsm_arclist_remove_node
(
gfsmArcList
*al,
gfsmArcList
*nod);
149
155
GFSM_INLINE
156
gfsmArcList
*
gfsm_arclist_delete_node
(
gfsmArcList
*al,
gfsmArcList
*nod);
157
162
gfsmArcList
*
gfsm_arclist_reverse
(
gfsmArcList
*al);
163
165
166
167
/*======================================================================
168
* Methods: Arc List: Utilities
169
*/
171
172
174
guint
gfsm_arclist_length
(
gfsmArcList
*al);
175
// Signature: <tt>guint gfsm_arclist_length(gfsmArcList *al)</tt>
176
//#define gfsm_arclist_length g_slist_length
177
183
GFSM_INLINE
184
gfsmArcList
*
gfsm_arclist_sort
(
gfsmArcList
*al,
gfsmArcCompData
*acdata);
185
192
GFSM_INLINE
193
gfsmArcList
*
gfsm_arclist_sort_with_data
(
gfsmArcList
*al, GCompareDataFunc cmpfunc, gpointer data);
194
196
#define gfsm_arclist_sort_full gfsm_arclist_sort_with_data
197
199
gfsmArcList
*
gfsm_arclist_sort_real
(
gfsmArcList
*list, GFunc compare_func, gpointer user_data);
200
201
203
204
//-- inline definitions
205
#ifdef GFSM_INLINE_ENABLED
206
# include <gfsmArcList.hi>
207
#endif
208
209
#endif
/* _GFSM_ARC_LIST_H */
Generated on Tue Oct 21 2014 09:44:47 for libgfsm by
1.8.1.2