Data Structures | Typedefs
gfsmArcList.h File Reference

Definitions & utilities for arc lists, Deprecated . More...

#include <gfsmArc.h>
#include <gfsmMem.h>
#include <gfsmArcList.hi>
Include dependency graph for gfsmArcList.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  gfsmArcListNode_
 "Heavy" arc-list structure, no longer using GSList More...

Typedefs

typedef struct gfsmArcListNode_ gfsmArcListNode
 "Heavy" arc-list structure, no longer using GSList
typedef gfsmArcListNode gfsmArcList
 Alias for gfsmArcListNode.

Functions

Arc List: Constructors etc.
static gfsmArcListgfsm_arclist_prepend_node (gfsmArcList *al, gfsmArcList *nod)
static gfsmArcListgfsm_arclist_new_full (gfsmStateId src, gfsmStateId dst, gfsmLabelVal lo, gfsmLabelVal hi, gfsmWeight wt, gfsmArcList *nxt)
static gfsmArcListgfsm_arclist_insert (gfsmArcList *al, gfsmStateId src, gfsmStateId dst, gfsmLabelVal lo, gfsmLabelVal hi, gfsmWeight wt, gfsmArcCompData *acdata)
static gfsmArcListgfsm_arclist_insert_node (gfsmArcList *al, gfsmArcList *nod, gfsmArcCompData *acdata)
gfsmArcListgfsm_arclist_insert_node_sorted (gfsmArcList *al, gfsmArcList *link, gfsmArcCompData *acdata)
gfsmArcListgfsm_arclist_clone (gfsmArcList *src)
void gfsm_arclist_free (gfsmArcList *al)
static void gfsm_arclist_free_1 (gfsmArcList *nod)

Arc List: Access & Manipulation

#define gfsm_arclist_arc(al)   ((al) ? (&(al->arc)) : NULL)
gfsmArcListgfsm_arclist_concat (gfsmArcList *al1, gfsmArcList *al2)
gfsmArcListgfsm_arclist_remove_node (gfsmArcList *al, gfsmArcList *nod)
static gfsmArcListgfsm_arclist_delete_node (gfsmArcList *al, gfsmArcList *nod)
gfsmArcListgfsm_arclist_reverse (gfsmArcList *al)

Arc List: Utilities

#define gfsm_arclist_sort_full   gfsm_arclist_sort_with_data
guint gfsm_arclist_length (gfsmArcList *al)
static gfsmArcListgfsm_arclist_sort (gfsmArcList *al, gfsmArcCompData *acdata)
static gfsmArcListgfsm_arclist_sort_with_data (gfsmArcList *al, GCompareDataFunc cmpfunc, gpointer data)
gfsmArcListgfsm_arclist_sort_real (gfsmArcList *list, GFunc compare_func, gpointer user_data)

Detailed Description

Deprecated:
in favor of gfsm_automaton_add_arc() and gfsmArcIter interface
See Also
gfsmAutomaton.h, gfsmArcIter.h

Macro Definition Documentation

#define gfsm_arclist_arc (   al)    ((al) ? (&(al->arc)) : NULL)

Get the arc pointer for an arclist – may be NULL

Deprecated:
in favor of gfsmArcIter interface
See Also
gfsmArcIter.h
#define gfsm_arclist_sort_full   gfsm_arclist_sort_with_data

Typedef Documentation

Function Documentation

static gfsmArcList* gfsm_arclist_prepend_node ( gfsmArcList al,
gfsmArcList nod 
)
inlinestatic

Prepend the node nod to the gfsmArcList al

Returns
a pointer to the new 1st element of the arclist
Deprecated:
in favor of gfsm_automaton_add_arc(), gfsm_arciter_insert()
static gfsmArcList* gfsm_arclist_new_full ( gfsmStateId  src,
gfsmStateId  dst,
gfsmLabelVal  lo,
gfsmLabelVal  hi,
gfsmWeight  wt,
gfsmArcList nxt 
)
inlinestatic

Allocate and return a new arc-list node

static gfsmArcList* gfsm_arclist_insert ( gfsmArcList al,
gfsmStateId  src,
gfsmStateId  dst,
gfsmLabelVal  lo,
gfsmLabelVal  hi,
gfsmWeight  wt,
gfsmArcCompData acdata 
)
inlinestatic

Insert an arc into a (possibly sorted) arclist.

Parameters
algfsmArcList into which a new arc is to be inserted
srcsource state id for the new arc
dsttarget state id for the new arc
lolower label for the new arc
hiupper label for the new arc wt weight for the new arc
acdatacomparison data for 'smart' sorted insertion
Returns
a pointer to the (possibly new) 1st node of the arc list
Deprecated:
in favor of gfsm_automaton_add_arc(), gfsm_arciter_insert()
static gfsmArcList* gfsm_arclist_insert_node ( gfsmArcList al,
gfsmArcList nod,
gfsmArcCompData acdata 
)
inlinestatic

Insert a single arc-link into a (possibly sorted) arclist.

Parameters
alarc list into which link is to be inserted
linkarc list node to insert
acdatasort data for 'smart' sorted insertion
Returns
a pointer to the (possibly new) 1st element of the arclist
Deprecated:
in favor of gfsm_automaton_add_arc(), gfsm_arciter_insert()
gfsmArcList* gfsm_arclist_insert_node_sorted ( gfsmArcList al,
gfsmArcList link,
gfsmArcCompData acdata 
)
gfsmArcList* gfsm_arclist_clone ( gfsmArcList src)

Create and return a (deep) copy of an existing arc-list

void gfsm_arclist_free ( gfsmArcList al)

Destroy an arc-list node and all subsequent nodes

static void gfsm_arclist_free_1 ( gfsmArcList nod)
inlinestatic
gfsmArcList* gfsm_arclist_concat ( gfsmArcList al1,
gfsmArcList al2 
)

Concatenate 2 arc-lists

Parameters
al1initial sublist
al2final sublist
Returns
pointer to head of the concatenated list
gfsmArcList* gfsm_arclist_remove_node ( gfsmArcList al,
gfsmArcList nod 
)

Splice a single node out from a gfsmArcList.

Parameters
alarc list
nodnode to extract
Returns
pointer to head of the new arc list, without nod
Warning
removed nod is not freed!
See Also
gfsm_arclist_delte_node()
static gfsmArcList* gfsm_arclist_delete_node ( gfsmArcList al,
gfsmArcList nod 
)
inlinestatic

Remove and free a single node from a gfsmArcList.

Parameters
alarc list
nodnode to extract
Returns
pointer to head of the new arc list, without nod
gfsmArcList* gfsm_arclist_reverse ( gfsmArcList al)

Reverse a gfsmArcList

Parameters
alarc list to reverse
Returns
pointer to head of the reversed arc list
guint gfsm_arclist_length ( gfsmArcList al)

Get length of an arc-list al (linear time)

static gfsmArcList* gfsm_arclist_sort ( gfsmArcList al,
gfsmArcCompData acdata 
)
inlinestatic

Sort an arclist al using one of the builtin sort modes as specified by acdata.

Parameters
alarc list to sort
acdatasort data for builtin comparison
Returns
pointer to the new head of the sorted arc list
static gfsmArcList* gfsm_arclist_sort_with_data ( gfsmArcList al,
GCompareDataFunc  cmpfunc,
gpointer  data 
)
inlinestatic

Sort an arclist al using a user-defined arc comparison function.

Parameters
alarc list to sort
cmpfunc3-way comparison function on gfsmArc* for sorting
dataadditional data for cmpfunc
Returns
pointer to the new head of the sorted arc list
gfsmArcList* gfsm_arclist_sort_real ( gfsmArcList list,
GFunc  compare_func,
gpointer  user_data 
)

low-level guts for gfsm_arclist_sort()