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_ {
44 
47 
48 
49 /*======================================================================
50  * Methods: Arc List: Constructors etc.
51  */
53 
54 
61 
65  gfsmStateId dst,
66  gfsmLabelVal lo,
67  gfsmLabelVal hi,
68  gfsmWeight wt,
69  gfsmArcList *nxt);
70 
71 
85  gfsmStateId src,
86  gfsmStateId dst,
87  gfsmLabelVal lo,
88  gfsmLabelVal hi,
89  gfsmWeight wt,
90  gfsmArcCompData *acdata);
91 
92 
102 
105 
108 
109 
112 
113 /* Free a single node of an arc-list */
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 
140 
149 
157 
163 
165 
166 
167 /*======================================================================
168  * Methods: Arc List: Utilities
169  */
171 
172 
175  // Signature: <tt>guint gfsm_arclist_length(gfsmArcList *al)</tt>
176 //#define gfsm_arclist_length g_slist_length
177 
185 
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 */