xanlib.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <assert.h>
#include <errno.h>
#include <pthread.h>
#include <sys/mman.h>
#include <math.h>
#include <limits.h>
#include <xanlib.h>
#include <xan-system.h>
#include <config.h>
Include dependency graph for xanlib.c:

Go to the source code of this file.

Defines

#define PRIMES_TABLE_LENGTH   (sizeof(primes)/sizeof(primes[0]))
#define HASHTABLE_DEFAULT_LOAD_FACTOR   0.65
#define BITS_IN_A_WORD   ( 8 * sizeof(size_t) )
#define MASK(pos)   ( ((size_t)1) << ((pos) % BITS_IN_A_WORD) )
#define WORD_NUMBER(set, pos)   ( (set)->data[(pos) / BITS_IN_A_WORD] )
#define WORDS_NECESSARY(length)   ( ((length) + (BITS_IN_A_WORD - 1)) / BITS_IN_A_WORD )

Functions

static void * varRead (XanVar *var)
static void * _varRead (XanVar *var)
static void varWrite (XanVar *var, void *data)
static void _varWrite (XanVar *var, void *data)
static void varLock (XanVar *var)
static void varUnlock (XanVar *var)
static void varDestroyVarAndData (XanVar *var)
static void * xanStackPop (XanStack *stack)
static void * _xanStackPop (XanStack *stack)
static void xanStackPush (XanStack *stack, void *newElement)
static void _xanStackPush (XanStack *stack, void *newElement)
static int xanStackGetSize (XanStack *stack)
static int _xanStackGetSize (XanStack *stack)
static void _xanStackDestroyStack (XanStack *stack)
static void xanListDeleteClones (XanList *list)
static void _xanListDeleteClones (XanList *list)
static int xanListShareSomeElements (XanList *list, XanList *otherList)
static int _xanListShareSomeElements (XanList *list, XanList *otherList)
static void xanListAppendList (XanList *list, XanList *listToAppend)
static void _xanListAppendList (XanList *list, XanList *listToAppend)
static XanListItemxanListAppend (XanList *list, void *data)
static XanListItem_xanListAppend (XanList *list, void *data)
static XanListItemxanListInsert (XanList *list, void *data)
static XanListItem_xanListInsert (XanList *list, void *data)
static XanListItemxanListInsertBefore (XanList *list, XanListItem *prev, void *data)
static XanListItem_xanListInsertBefore (XanList *list, XanListItem *prev, void *data)
static XanListItemxanListInsertAfter (XanList *list, XanListItem *prev, void *data)
static XanListItem_xanListInsertAfter (XanList *list, XanListItem *prev, void *data)
static XanListItemxanListMoveToBegin (XanList *list, XanListItem *item)
static XanListItem_xanListMoveToBegin (XanList *list, XanListItem *item)
static XanListItemxanListFirst (XanList *list)
static XanListItem_xanListFirst (XanList *list)
static XanListItemxanListLast (XanList *list)
static XanListItem_xanListLast (XanList *list)
static XanListItemxanListFind (XanList *list, void *data)
static XanListItem_xanListFind (XanList *list, void *data)
static void xanListDelete (XanList *list, void *data)
static void _xanListDelete (XanList *list, void *data)
static void xanListDeleteAll (XanList *list, void *data)
static void _xanListDeleteAll (XanList *list, void *data)
static int xanListContainsTheSameElements (XanList *list, XanList *otherList)
static int _xanListContainsTheSameElements (XanList *list, XanList *otherList)
static void xanListDeleteItem (XanList *list, XanListItem *item)
static void _xanListDeleteItem (XanList *list, XanListItem *item)
static void * xanListData (XanList *list, XanListItem *item)
static void * _xanListData (XanList *list, XanListItem *item)
static void ** xanListGetSlotData (XanList *list, XanListItem *item)
static void ** _xanListGetSlotData (XanList *list, XanListItem *item)
static XanListItemxanListNext (XanList *list, XanListItem *item)
static XanListItem_xanListNext (XanList *list, XanListItem *item)
static XanListItemxanListPrev (XanList *list, XanListItem *item)
static XanListItem_xanListPrev (XanList *list, XanListItem *item)
static void xanListDestroy (XanList *list)
static void _xanListDestroy (XanList *list)
static void xanListEmptyOutList (XanList *list)
static void _xanListEmptyOutList (XanList *list)
static int xanListLength (XanList *list)
static int _xanListLength (XanList *list)
static XanListxanListCloneList (XanList *list)
static XanList_xanListCloneList (XanList *list)
static void xanListSetCloneFunction (XanList *list, void *(*cloneFunction)(void *data))
static void _xanListSetCloneFunction (XanList *list, void *(*cloneFunction)(void *data))
static void * xanListGetCloneFunction (XanList *list)
static void * _xanListGetCloneFunction (XanList *list)
static void xanListDestroyListAndData (XanList *list)
static void _xanListDestroyListAndData (XanList *list)
static int xanListEqualsInstancesNumber (XanList *list, void *data)
static int _xanListEqualsInstancesNumber (XanList *list, void *data)
static XanListItemxanListGetElementFromPositionNumber (XanList *list, int positionNumber)
static XanListItem_xanListGetElementFromPositionNumber (XanList *list, int positionNumber)
static void _xanListLock (XanList *list)
static void _xanListUnlock (XanList *list)
static void * xanPipeGet (XanPipe *pipe)
static void * _xanPipeGet (XanPipe *pipe)
static XanListItemxanPipePut (XanPipe *pipe, void *item)
static XanListItem_xanPipePut (XanPipe *pipe, void *item)
static XanListItemxanPipePutAtEnd (XanPipe *pipe, void *item)
static XanListItem_xanPipePutAtEnd (XanPipe *pipe, void *item)
static XanListItemxanPipeMoveToEnd (XanPipe *pipe, void *item)
static XanListItem_xanPipeMoveToEnd (XanPipe *pipe, void *item)
static void xanPipeDeleteItem (XanPipe *pipe, XanListItem *item)
static void _xanPipeDeleteItem (XanPipe *pipe, XanListItem *item)
static int xanPipeIsEmpty (XanPipe *pipe)
static int _xanPipeIsEmpty (XanPipe *pipe)
static void xanPipeLock (XanPipe *pipe)
static void xanPipeUnlock (XanPipe *pipe)
static void _xanPipeDestroyPipe (XanPipe *pipe)
static XanNodexanNodeGetParent (XanNode *node)
static XanNodexanNodeGetNextChildren (XanNode *node, XanNode *child)
static XanNodexanNodeAddNewChildren (XanNode *node, void *childData)
static void xanNodeAddChildren (XanNode *node, XanNode *child)
static void xanNodeSetParent (XanNode *node, XanNode *parent)
static void xanNodeSetData (XanNode *node, void *data)
static void * xanNodeGetData (XanNode *node)
static XanNode_xanNodeGetParent (XanNode *node)
static XanNode_xanNodeGetNextChildren (XanNode *node, XanNode *child)
static XanNode_xanNodeAddNewChildren (XanNode *node, void *childData)
static void _xanNodeAddChildren (XanNode *node, XanNode *child)
static void _xanNodeSetParent (XanNode *node, XanNode *parent)
static void _xanNodeSetData (XanNode *node, void *data)
static void * _xanNodeGetData (XanNode *node)
static XanNodexanNodeCloneTree (XanNode *node)
static XanNode_xanNodeCloneTree (XanNode *node)
static void xanNodeDeleteChildren (XanNode *node, XanNode *child)
static void _xanNodeDeleteChildren (XanNode *node, XanNode *child)
static XanListxanNodeGetChildrens (XanNode *node)
static XanList_xanNodeGetChildrens (XanNode *node)
static void xanNodeSetCloneFunction (XanNode *node, void *(*cloneFunction)(void *data))
static void _xanNodeSetCloneFunction (XanNode *node, void *(*cloneFunction)(void *data))
static void xanNodeDestroyTreeAndData (XanNode *node)
static void _xanNodeDestroyTreeAndData (XanNode *node)
static void xanNodeDestroyTree (XanNode *node)
static void _xanNodeDestroyTree (XanNode *node)
static void _xanNodeDestroyNode (XanNode *node)
static XanListxanNodeToPreOrderList (XanNode *node)
static XanList_xanNodeToPreOrderList (XanNode *node)
static XanListxanNodeToPostOrderList (XanNode *node)
static XanList_xanNodeToPostOrderList (XanNode *node)
static XanListxanNodeToInOrderList (XanNode *node)
static XanList_xanNodeToInOrderList (XanNode *node)
static XanNodexanNodeFind (XanNode *rootNode, void *data)
static XanNode_xanNodeFind (XanNode *rootNode, void *data)
static void _xanHashTableLock (XanHashTable *table)
static void _xanHashTableUnlock (XanHashTable *table)
static unsigned int xanHashTableDefaultHashFunction (void *element)
static int xanHashTableDefaultEqualsFunction (void *key1, void *key2)
static void xanHashTableInsert (XanHashTable *table, void *key, void *element)
static void _xanHashTableInsert (XanHashTable *table, void *key, void *element)
static void * xanHashTableLookup (XanHashTable *table, void *key)
static void * _xanHashTableLookup (XanHashTable *table, void *key)
static void xanHashTableDelete (XanHashTable *table, void *key)
static void _xanHashTableDelete (XanHashTable *table, void *key)
static void xanHashTableDestroy (XanHashTable *table)
static void _xanHashTableDestroy (XanHashTable *table)
static XanListxanHashTableToList (XanHashTable *table)
static XanList_xanHashTableToList (XanHashTable *table)
static XanListxanHashTableToSlotList (XanHashTable *table)
static XanList_xanHashTableToSlotList (XanHashTable *table)
static int xanHashTableElementsInside (XanHashTable *table)
static int _xanHashTableElementsInside (XanHashTable *table)
static XanHashTablexanHashTableCloneHashTable (XanHashTable *table)
static XanHashTable_xanHashTableCloneHashTable (XanHashTable *table)
static void xanHashTableSetCloneFunction (XanHashTable *table, void *(*cloneFunction)(void *data))
static void _xanHashTableSetCloneFunction (XanHashTable *table, void *(*cloneFunction)(void *data))
static void * xanHashTableGetCloneFunction (XanHashTable *table)
static void * _xanHashTableGetCloneFunction (XanHashTable *table)
static void _xanHashTableExpand (XanHashTable *table)
static unsigned int _xanHashTableImproveHash (XanHashTable *table, void *key)
static void internalPreOrderListHelpFunction (XanNode *tree, XanList *list)
static void internalPostOrderListHelpFunction (XanNode *tree, XanList *list)
static void internalInOrderListHelpFunction (XanNode *tree, XanList *list)
XanListxanListNew (void *(*allocFunction)(size_t size), void(*freeFunction)(void *addr), void *(*cloneFunction)(void *addr))
 Make a new list.
XanVarxanVarNew (void *(*allocFunction)(size_t size), void(*freeFunction)(void *addr))
 Make a new variable.
XanPipexanPipeNew (void *(*allocFunction)(size_t size), void(*freeFunction)(void *addr))
 Make a new pipe.
XanStackxanStackNew (void *(*allocFunction)(size_t size), void(*freeFunction)(void *addr), void *(*cloneFunction)(void *data))
XanNodexanNodeNew (void *(*allocFunction)(size_t size), void(*freeFunction)(void *addr), void *(*cloneFunction)(void *data))
 Make a new node.
XanHashTablexanHashTableNew (unsigned int length, int hasFixedLength, void *(*allocFunction)(size_t size), void *(*reallocFunction)(void *addr, size_t newSize), void(*freeFunction)(void *addr), unsigned int(*hashFunction)(void *element), int(*equalsFunction)(void *key1, void *key2))
 Make a new Hash Table.
XanListXanHashTable_ToItemList (XanHashTable *table)
 From HashTable to List.
void print_ascii_err (signed char *message, int err)
 Print an error message.
void print_err (char *message, int err)
 Print an error message.
int str_has_suffix (char *string, char *suffix)
bool xanStackContains (XanStack *stack, void *element)
bool xanStackSynchContains (XanStack *stack, void *element)
void libxanCompilationFlags (char *buffer, int bufferLength)
void libxanCompilationTime (char *buffer, int bufferLength)
char * libxanVersion ()
XanBitSetXanBitSet_Alloc (size_t length)
 allocate a bitset structure in memory and return a pointer
void XanBitSet_Intersect (XanBitSet *dest, XanBitSet *src)
 compute the intersection between dest and src and assign it to dest
int XanBitSet_GetCountOfBitsSet (XanBitSet *set)
 compute the number of bit that are set in the xan_bitset
bool XanBitSet_Equal (XanBitSet *bs1, XanBitSet *bs2)
 test if bs1 is equal to bs2
XanBitSetXanBitSet_Clone (XanBitSet *src)
 clone src and return it
void XanBitSet_Copy (XanBitSet *dest, XanBitSet *src)
void XanBitSet_Print (XanBitSet *set, int cr)
 print the XanBitSet to the standard output. Set cr if you want a newline
void XanBitSet_ClearAll (XanBitSet *set)
 set to 0 all the bits in the bitset
void XanBitSet_SetAll (XanBitSet *set)
 set to 1 all the bits in the bitset
void XanBitSet_Subtract (XanBitSet *fromThis, XanBitSet *subtractThis)
void XanBitSet_Free (XanBitSet *set)
 release the memory used for the bitset
void XanBitSet_ClearBit (XanBitSet *set, size_t pos)
 set the pos-st bit to 0
void XanBitSet_SetBit (XanBitSet *set, size_t pos)
 set the pos-st bit to 1
static bool is_bit_set (XanBitSet *set, size_t pos)
bool XanBitSet_IsBitSet (XanBitSet *set, size_t pos)
 return the value of the pos-th bit (1 if it is set, 0 otherwise)
bool XanBitSet_IsSubSetOf (XanBitSet *setA, XanBitSet *setB)
 Check wheter setA is a subset of setB. In particular, even if setA and setB contain exactly the same elements true is returned. setA and setB must be of the same length.

Variables

static const size_t primes []

Define Documentation

#define BITS_IN_A_WORD   ( 8 * sizeof(size_t) )

Definition at line 3304 of file xanlib.c.

#define HASHTABLE_DEFAULT_LOAD_FACTOR   0.65

Definition at line 46 of file xanlib.c.

Referenced by _xanHashTableInsert().

#define MASK ( pos   )     ( ((size_t)1) << ((pos) % BITS_IN_A_WORD) )

Definition at line 3307 of file xanlib.c.

Referenced by is_bit_set(), XanBitSet_ClearBit(), XanBitSet_Print(), and XanBitSet_SetBit().

#define PRIMES_TABLE_LENGTH   (sizeof(primes)/sizeof(primes[0]))

Definition at line 45 of file xanlib.c.

Referenced by xanHashTableNew().

#define WORD_NUMBER ( set,
pos   )     ( (set)->data[(pos) / BITS_IN_A_WORD] )

Definition at line 3310 of file xanlib.c.

Referenced by is_bit_set(), XanBitSet_ClearBit(), XanBitSet_Print(), and XanBitSet_SetBit().

#define WORDS_NECESSARY ( length   )     ( ((length) + (BITS_IN_A_WORD - 1)) / BITS_IN_A_WORD )

Function Documentation

static void * _varRead ( XanVar var  )  [inline, static]

Definition at line 1452 of file xanlib.c.

References XanVar::data.

Referenced by varRead(), and xanVarNew().

static void _varWrite ( XanVar var,
void *  data 
) [inline, static]

Definition at line 1466 of file xanlib.c.

References XanVar::data.

Referenced by varWrite(), and xanVarNew().

static XanHashTable * _xanHashTableCloneHashTable ( XanHashTable table  )  [inline, static]
static void _xanHashTableDelete ( XanHashTable table,
void *  key 
) [inline, static]
static void _xanHashTableDestroy ( XanHashTable table  )  [inline, static]
static int _xanHashTableElementsInside ( XanHashTable table  )  [inline, static]

Definition at line 2622 of file xanlib.c.

References XanHashTable::size.

Referenced by xanHashTableElementsInside(), and xanHashTableNew().

static void _xanHashTableExpand ( XanHashTable table  )  [inline, static]
static void * _xanHashTableGetCloneFunction ( XanHashTable table  )  [inline, static]

Definition at line 2566 of file xanlib.c.

References XanHashTable::clone.

Referenced by xanHashTableGetCloneFunction(), and xanHashTableNew().

static unsigned int _xanHashTableImproveHash ( XanHashTable table,
void *  key 
) [inline, static]
static void _xanHashTableInsert ( XanHashTable table,
void *  key,
void *  element 
) [inline, static]
static void _xanHashTableLock ( XanHashTable table  )  [inline, static]

Definition at line 2714 of file xanlib.c.

References XanHashTable::mutex.

Referenced by xanHashTableNew().

static void * _xanHashTableLookup ( XanHashTable table,
void *  key 
) [inline, static]
static void _xanHashTableSetCloneFunction ( XanHashTable table,
void *(*)(void *data)  cloneFunction 
) [inline, static]

Definition at line 2574 of file xanlib.c.

References XanHashTable::clone.

Referenced by xanHashTableNew(), and xanHashTableSetCloneFunction().

static XanList * _xanHashTableToList ( XanHashTable table  )  [inline, static]
static XanList * _xanHashTableToSlotList ( XanHashTable table  )  [inline, static]
static void _xanHashTableUnlock ( XanHashTable table  )  [inline, static]

Definition at line 2721 of file xanlib.c.

References XanHashTable::mutex.

Referenced by xanHashTableNew().

static XanListItem * _xanListAppend ( XanList list,
void *  data 
) [inline, static]
static void _xanListAppendList ( XanList list,
XanList listToAppend 
) [inline, static]

Definition at line 581 of file xanlib.c.

References _xanListAppend(), _xanListData(), _xanListFirst(), and _xanListNext().

Referenced by xanListAppendList(), and xanListNew().

Here is the call graph for this function:

static XanList * _xanListCloneList ( XanList list  )  [inline, static]

Definition at line 733 of file xanlib.c.

References _xanListAppend(), _xanListFirst(), _xanListNext(), XanList::alloc, XanList::clone, XanListItem::data, XanList::free, and xanListNew().

Referenced by _xanNodeGetChildrens(), xanListCloneList(), and xanListNew().

Here is the call graph for this function:

static int _xanListContainsTheSameElements ( XanList list,
XanList otherList 
) [inline, static]

Definition at line 1232 of file xanlib.c.

References _xanListFind(), _xanListFirst(), _xanListNext(), XanListItem::data, and XanList::len.

Referenced by xanListContainsTheSameElements(), and xanListNew().

Here is the call graph for this function:

static void * _xanListData ( XanList list,
XanListItem item 
) [inline, static]
static void _xanListDelete ( XanList list,
void *  data 
) [inline, static]
static void _xanListDeleteAll ( XanList list,
void *  data 
) [inline, static]

Definition at line 1255 of file xanlib.c.

References _xanListData(), _xanListFind(), _xanListNext(), _xanListPrev(), XanList::firstItem, XanList::free, XanList::lastItem, XanList::len, XanListItem::next, and XanListItem::prev.

Referenced by xanListDeleteAll(), and xanListNew().

Here is the call graph for this function:

static void _xanListDeleteClones ( XanList list  )  [inline, static]

Definition at line 528 of file xanlib.c.

References _xanListData(), _xanListDeleteItem(), _xanListFirst(), and _xanListNext().

Referenced by xanListDeleteClones(), and xanListNew().

Here is the call graph for this function:

static void _xanListDeleteItem ( XanList list,
XanListItem item 
) [inline, static]
static void _xanListDestroy ( XanList list  )  [inline, static]
static void _xanListDestroyListAndData ( XanList list  )  [inline, static]

Definition at line 935 of file xanlib.c.

References _xanListFirst(), _xanListNext(), XanListItem::data, and XanList::free.

Referenced by xanListDestroyListAndData(), and xanListNew().

Here is the call graph for this function:

static void _xanListEmptyOutList ( XanList list  )  [inline, static]

Definition at line 968 of file xanlib.c.

References _xanListDeleteItem(), _xanListFirst(), XanList::firstItem, and XanList::lastItem.

Referenced by xanListEmptyOutList(), and xanListNew().

Here is the call graph for this function:

static int _xanListEqualsInstancesNumber ( XanList list,
void *  data 
) [inline, static]

Definition at line 915 of file xanlib.c.

References _xanListData(), _xanListFirst(), and _xanListNext().

Referenced by xanListEqualsInstancesNumber(), and xanListNew().

Here is the call graph for this function:

static XanListItem * _xanListFind ( XanList list,
void *  data 
) [inline, static]

Definition at line 986 of file xanlib.c.

References _xanListData(), _xanListFirst(), and _xanListNext().

Referenced by _xanListContainsTheSameElements(), _xanListDelete(), _xanListDeleteAll(), _xanPipeMoveToEnd(), xanListFind(), xanListNew(), and xanStackContains().

Here is the call graph for this function:

static XanListItem * _xanListFirst ( XanList list  )  [inline, static]
static void * _xanListGetCloneFunction ( XanList list  )  [inline, static]

Definition at line 774 of file xanlib.c.

References XanList::clone.

Referenced by xanListGetCloneFunction(), and xanListNew().

static XanListItem * _xanListGetElementFromPositionNumber ( XanList list,
int  positionNumber 
) [inline, static]

Definition at line 877 of file xanlib.c.

References _xanListFirst(), _xanListNext(), XanList::firstItem, XanList::lastItem, and XanList::len.

Referenced by xanListGetElementFromPositionNumber(), and xanListNew().

Here is the call graph for this function:

static void ** _xanListGetSlotData ( XanList list,
XanListItem item 
) [inline, static]

Definition at line 1027 of file xanlib.c.

References XanListItem::data.

Referenced by xanListGetSlotData(), and xanListNew().

static XanListItem * _xanListInsert ( XanList list,
void *  data 
) [inline, static]
static XanListItem * _xanListInsertAfter ( XanList list,
XanListItem prev,
void *  data 
) [inline, static]

Definition at line 1103 of file xanlib.c.

References _xanListAppend(), XanList::alloc, XanListItem::data, XanList::lastItem, XanList::len, XanListItem::next, and XanListItem::prev.

Referenced by xanListInsertAfter(), and xanListNew().

Here is the call graph for this function:

static XanListItem * _xanListInsertBefore ( XanList list,
XanListItem prev,
void *  data 
) [inline, static]

Definition at line 1146 of file xanlib.c.

References _xanListInsert(), XanList::alloc, XanListItem::data, XanList::firstItem, XanList::lastItem, XanList::len, XanListItem::next, and XanListItem::prev.

Referenced by xanListInsertBefore(), and xanListNew().

Here is the call graph for this function:

static XanListItem * _xanListLast ( XanList list  )  [inline, static]

Definition at line 1009 of file xanlib.c.

References XanList::lastItem.

Referenced by xanListLast(), and xanListNew().

static int _xanListLength ( XanList list  )  [inline, static]
static void _xanListLock ( XanList list  )  [inline, static]

Definition at line 899 of file xanlib.c.

References XanList::itemsMutex.

Referenced by xanListNew().

static XanListItem * _xanListMoveToBegin ( XanList list,
XanListItem item 
) [inline, static]
static XanListItem * _xanListNext ( XanList list,
XanListItem item 
) [inline, static]
static XanListItem * _xanListPrev ( XanList list,
XanListItem item 
) [inline, static]
static void _xanListSetCloneFunction ( XanList list,
void *(*)(void *data)  cloneFunction 
) [inline, static]

Definition at line 792 of file xanlib.c.

References XanList::clone.

Referenced by xanListNew(), and xanListSetCloneFunction().

static int _xanListShareSomeElements ( XanList list,
XanList otherList 
) [inline, static]

Definition at line 556 of file xanlib.c.

References _xanListData(), _xanListFirst(), and _xanListNext().

Referenced by xanListNew(), and xanListShareSomeElements().

Here is the call graph for this function:

static void _xanListUnlock ( XanList list  )  [inline, static]

Definition at line 907 of file xanlib.c.

References XanList::itemsMutex.

Referenced by xanListNew().

static void _xanNodeAddChildren ( XanNode node,
XanNode child 
) [inline, static]

Definition at line 2293 of file xanlib.c.

References _xanListAppend(), _xanNodeDeleteChildren(), _xanNodeGetParent(), _xanNodeSetParent(), and XanNode::childrens.

Referenced by xanNodeAddChildren(), and xanNodeNew().

Here is the call graph for this function:

static XanNode * _xanNodeAddNewChildren ( XanNode node,
void *  childData 
) [inline, static]

Definition at line 2314 of file xanlib.c.

References _xanListAppend(), _xanNodeSetData(), _xanNodeSetParent(), XanNode::alloc, XanNode::childrens, XanNode::clone, XanNode::free, and xanNodeNew().

Referenced by xanNodeAddNewChildren(), and xanNodeNew().

Here is the call graph for this function:

static XanNode * _xanNodeCloneTree ( XanNode node  )  [inline, static]

Definition at line 2193 of file xanlib.c.

References _xanListInsert(), _xanNodeSetData(), XanNode::alloc, XanNode::childrens, XanNode::clone, XanNode::data, XanNode::free, XanNode::getNextChildren, and xanNodeNew().

Referenced by xanNodeCloneTree(), and xanNodeNew().

Here is the call graph for this function:

static void _xanNodeDeleteChildren ( XanNode node,
XanNode child 
) [inline, static]

Definition at line 2279 of file xanlib.c.

References _xanListDelete(), _xanNodeSetParent(), XanNode::childrens, and XanNode::data.

Referenced by _xanNodeAddChildren(), xanNodeDeleteChildren(), and xanNodeNew().

Here is the call graph for this function:

static void _xanNodeDestroyNode ( XanNode node  )  [inline, static]

Definition at line 2092 of file xanlib.c.

References _xanListDestroy(), XanNode::childrens, and XanNode::free.

Referenced by xanNodeNew().

Here is the call graph for this function:

static void _xanNodeDestroyTree ( XanNode node  )  [inline, static]

Definition at line 2103 of file xanlib.c.

References _xanListDestroy(), _xanNodeGetNextChildren(), XanNode::childrens, and XanNode::free.

Referenced by xanNodeDestroyTree(), and xanNodeNew().

Here is the call graph for this function:

static void _xanNodeDestroyTreeAndData ( XanNode node  )  [inline, static]

Definition at line 2071 of file xanlib.c.

References _xanListDestroy(), _xanNodeGetNextChildren(), XanNode::childrens, XanNode::data, and XanNode::free.

Referenced by xanNodeDestroyTreeAndData(), and xanNodeNew().

Here is the call graph for this function:

static XanNode * _xanNodeFind ( XanNode rootNode,
void *  data 
) [inline, static]

Definition at line 2151 of file xanlib.c.

References XanNode::data, and XanNode::getNextChildren.

Referenced by xanNodeFind(), and xanNodeNew().

static XanList * _xanNodeGetChildrens ( XanNode node  )  [inline, static]

Definition at line 2343 of file xanlib.c.

References _xanListCloneList(), _xanListLength(), and XanNode::childrens.

Referenced by xanNodeGetChildrens(), and xanNodeNew().

Here is the call graph for this function:

static void * _xanNodeGetData ( XanNode node  )  [inline, static]

Definition at line 2063 of file xanlib.c.

References XanNode::data.

Referenced by internalPreOrderListHelpFunction(), xanNodeGetData(), and xanNodeNew().

static XanNode * _xanNodeGetNextChildren ( XanNode node,
XanNode child 
) [inline, static]

Definition at line 2245 of file xanlib.c.

References _xanListData(), _xanListFirst(), _xanListNext(), and XanNode::childrens.

Referenced by _xanNodeDestroyTree(), _xanNodeDestroyTreeAndData(), xanNodeGetNextChildren(), and xanNodeNew().

Here is the call graph for this function:

static XanNode * _xanNodeGetParent ( XanNode node  )  [inline, static]

Definition at line 2225 of file xanlib.c.

References XanNode::getNextChildren, and XanNode::parent.

Referenced by _xanNodeAddChildren(), xanNodeGetParent(), and xanNodeNew().

static void _xanNodeSetCloneFunction ( XanNode node,
void *(*)(void *data)  cloneFunction 
) [inline, static]

Definition at line 2184 of file xanlib.c.

References XanNode::childrens, XanNode::clone, and XanList::setCloneFunction.

Referenced by xanNodeNew(), and xanNodeSetCloneFunction().

static void _xanNodeSetData ( XanNode node,
void *  data 
) [inline, static]

Definition at line 2055 of file xanlib.c.

References XanNode::data.

Referenced by _xanNodeAddNewChildren(), _xanNodeCloneTree(), xanNodeNew(), and xanNodeSetData().

static void _xanNodeSetParent ( XanNode node,
XanNode parent 
) [inline, static]
static XanList * _xanNodeToInOrderList ( XanNode node  )  [inline, static]

Definition at line 2169 of file xanlib.c.

References XanNode::alloc, XanNode::clone, XanNode::free, internalInOrderListHelpFunction(), XanList::length, and xanListNew().

Referenced by xanNodeNew(), and xanNodeToInOrderList().

Here is the call graph for this function:

static XanList * _xanNodeToPostOrderList ( XanNode node  )  [inline, static]

Definition at line 2136 of file xanlib.c.

References XanNode::alloc, XanNode::clone, XanNode::free, internalPostOrderListHelpFunction(), XanList::length, and xanListNew().

Referenced by xanNodeNew(), and xanNodeToPostOrderList().

Here is the call graph for this function:

static XanList * _xanNodeToPreOrderList ( XanNode node  )  [inline, static]

Definition at line 2121 of file xanlib.c.

References XanNode::alloc, XanNode::clone, XanNode::free, internalPreOrderListHelpFunction(), XanList::length, and xanListNew().

Referenced by xanNodeNew(), and xanNodeToPreOrderList().

Here is the call graph for this function:

static void _xanPipeDeleteItem ( XanPipe pipe,
XanListItem item 
) [inline, static]

Definition at line 1671 of file xanlib.c.

References _xanListDeleteItem(), and XanPipe::items.

Referenced by xanPipeDeleteItem(), and xanPipeNew().

Here is the call graph for this function:

static void _xanPipeDestroyPipe ( XanPipe pipe  )  [inline, static]

Definition at line 1719 of file xanlib.c.

References _xanListDestroy(), and XanPipe::items.

Referenced by xanPipeNew().

Here is the call graph for this function:

static void * _xanPipeGet ( XanPipe pipe  )  [inline, static]

Definition at line 1601 of file xanlib.c.

References _xanListData(), _xanListDeleteItem(), _xanListFirst(), XanList::data, XanList::first, XanPipe::items, XanPipe::itemsCond, XanPipe::itemsMutex, XanList::length, and XanList::next.

Referenced by xanPipeNew().

Here is the call graph for this function:

static int _xanPipeIsEmpty ( XanPipe pipe  )  [inline, static]

Definition at line 1750 of file xanlib.c.

References _xanListLength(), and XanPipe::items.

Referenced by xanPipeIsEmpty(), and xanPipeNew().

Here is the call graph for this function:

static XanListItem * _xanPipeMoveToEnd ( XanPipe pipe,
void *  item 
) [inline, static]

Definition at line 1643 of file xanlib.c.

References _xanListFind(), _xanListMoveToBegin(), XanList::data, XanList::equalsInstancesNumber, XanPipe::items, XanList::length, and PDEBUG.

Referenced by xanPipeMoveToEnd(), and xanPipeNew().

Here is the call graph for this function:

static XanListItem * _xanPipePut ( XanPipe pipe,
void *  item 
) [inline, static]

Definition at line 1728 of file xanlib.c.

References _xanListAppend(), XanList::data, XanPipe::items, XanPipe::itemsCond, PDEBUG, and XanList::synchAppend.

Referenced by xanPipeNew(), and xanPipePut().

Here is the call graph for this function:

static XanListItem * _xanPipePutAtEnd ( XanPipe pipe,
void *  item 
) [inline, static]

Definition at line 1696 of file xanlib.c.

References _xanListInsert(), XanList::data, XanPipe::items, XanPipe::itemsCond, PDEBUG, and XanList::synchAppend.

Referenced by xanPipeNew(), and xanPipePutAtEnd().

Here is the call graph for this function:

static void _xanStackDestroyStack ( XanStack stack  )  [inline, static]

Definition at line 3210 of file xanlib.c.

References _xanListDestroy(), and XanStack::internalList.

Referenced by xanStackNew().

Here is the call graph for this function:

static int _xanStackGetSize ( XanStack stack  )  [inline, static]

Definition at line 3219 of file xanlib.c.

References _xanListLength(), and XanStack::internalList.

Referenced by xanStackGetSize(), and xanStackNew().

Here is the call graph for this function:

static void * _xanStackPop ( XanStack stack  )  [inline, static]

Definition at line 3242 of file xanlib.c.

References _xanListData(), _xanListDeleteItem(), _xanListFirst(), _xanListLength(), and XanStack::internalList.

Referenced by xanStackNew(), and xanStackPop().

Here is the call graph for this function:

static void _xanStackPush ( XanStack stack,
void *  newElement 
) [inline, static]

Definition at line 3263 of file xanlib.c.

References _xanListInsert(), and XanStack::internalList.

Referenced by xanStackNew(), and xanStackPush().

Here is the call graph for this function:

static void internalInOrderListHelpFunction ( XanNode tree,
XanList list 
) [inline, static]

Definition at line 3128 of file xanlib.c.

References _xanListAppend(), XanNode::getData, XanNode::getNextChildren, and internalPreOrderListHelpFunction().

Referenced by _xanNodeToInOrderList().

Here is the call graph for this function:

static void internalPostOrderListHelpFunction ( XanNode tree,
XanList list 
) [inline, static]

Definition at line 3106 of file xanlib.c.

References _xanListAppend(), XanNode::getData, and XanNode::getNextChildren.

Referenced by _xanNodeToPostOrderList().

Here is the call graph for this function:

static void internalPreOrderListHelpFunction ( XanNode tree,
XanList list 
) [inline, static]

Definition at line 3084 of file xanlib.c.

References _xanListAppend(), _xanNodeGetData(), and XanNode::getNextChildren.

Referenced by _xanNodeToPreOrderList(), and internalInOrderListHelpFunction().

Here is the call graph for this function:

static bool is_bit_set ( XanBitSet set,
size_t  pos 
) [inline, static]

Definition at line 3418 of file xanlib.c.

References MASK, and WORD_NUMBER.

Referenced by XanBitSet_IsBitSet(), and XanBitSet_IsSubSetOf().

void libxanCompilationFlags ( char *  buffer,
int  bufferLength 
)

Definition at line 3271 of file xanlib.c.

void libxanCompilationTime ( char *  buffer,
int  bufferLength 
)

Definition at line 3288 of file xanlib.c.

char* libxanVersion (  ) 

Definition at line 3296 of file xanlib.c.

void print_ascii_err ( signed char *  message,
int  err 
)

Print an error message.

Print to stderr the error message given as input. If the err parameter is different from zero, then it append to the message the error message given bound to the err number.

Parameters:
message The error message to print
err The errno number given by the Linux system

Definition at line 2995 of file xanlib.c.

References print_err().

Here is the call graph for this function:

void print_err ( char *  message,
int  err 
)

Print an error message.

Print to stderr the error message given as input. If the err parameter is different from zero, then it append to the message the error message given bound to the err number.

Parameters:
message The error message to print
err The errno number given by the Linux system

Definition at line 2999 of file xanlib.c.

Referenced by _xanHashTableDelete(), _xanHashTableInsert(), _xanListDelete(), and print_ascii_err().

int str_has_suffix ( char *  string,
char *  suffix 
)

Definition at line 3072 of file xanlib.c.

static void varDestroyVarAndData ( XanVar var  )  [inline, static]

Definition at line 1412 of file xanlib.c.

References XanVar::data, XanVar::free, and XanVar::mutex.

Referenced by xanVarNew().

static void varLock ( XanVar var  )  [inline, static]

Definition at line 1424 of file xanlib.c.

References XanVar::mutex.

Referenced by xanVarNew().

static void * varRead ( XanVar var  )  [inline, static]

Definition at line 1440 of file xanlib.c.

References _varRead(), and XanVar::mutex.

Referenced by xanVarNew().

Here is the call graph for this function:

static void varUnlock ( XanVar var  )  [inline, static]

Definition at line 1432 of file xanlib.c.

References XanVar::mutex.

Referenced by xanVarNew().

static void varWrite ( XanVar var,
void *  data 
) [inline, static]

Definition at line 1456 of file xanlib.c.

References _varWrite(), and XanVar::mutex.

Referenced by xanVarNew().

Here is the call graph for this function:

bitset * XanBitSet_Alloc ( size_t  length  ) 

allocate a bitset structure in memory and return a pointer

Definition at line 3316 of file xanlib.c.

References WORDS_NECESSARY.

Referenced by XanBitSet_Clone().

void XanBitSet_ClearAll ( XanBitSet set  ) 

set to 0 all the bits in the bitset

Definition at line 3377 of file xanlib.c.

References WORDS_NECESSARY.

void XanBitSet_ClearBit ( XanBitSet set,
size_t  pos 
)

set the pos-st bit to 0

Definition at line 3408 of file xanlib.c.

References MASK, and WORD_NUMBER.

XanBitSet * XanBitSet_Clone ( XanBitSet src  ) 

clone src and return it

Definition at line 3357 of file xanlib.c.

References XanBitSet::data, XanBitSet::length, WORDS_NECESSARY, and XanBitSet_Alloc().

Here is the call graph for this function:

void XanBitSet_Copy ( XanBitSet dest,
XanBitSet src 
)

Definition at line 3364 of file xanlib.c.

References XanBitSet::data, XanBitSet::length, and WORDS_NECESSARY.

int XanBitSet_Equal ( XanBitSet bs1,
XanBitSet bs2 
)

test if bs1 is equal to bs2

Definition at line 3352 of file xanlib.c.

References XanBitSet::data, XanBitSet::length, and WORDS_NECESSARY.

void XanBitSet_Free ( XanBitSet set  ) 

release the memory used for the bitset

Definition at line 3403 of file xanlib.c.

int XanBitSet_GetCountOfBitsSet ( XanBitSet set  ) 

compute the number of bit that are set in the xan_bitset

Definition at line 3335 of file xanlib.c.

References XanBitSet_IsBitSet().

Here is the call graph for this function:

void XanBitSet_Intersect ( XanBitSet dest,
XanBitSet src 
)

compute the intersection between dest and src and assign it to dest

Definition at line 3329 of file xanlib.c.

References XanBitSet::data, XanBitSet::length, and WORDS_NECESSARY.

int XanBitSet_IsBitSet ( XanBitSet set,
size_t  pos 
)

return the value of the pos-th bit (1 if it is set, 0 otherwise)

Definition at line 3422 of file xanlib.c.

References is_bit_set().

Referenced by XanBitSet_GetCountOfBitsSet().

Here is the call graph for this function:

XanBitSet_IsSubSetOf ( XanBitSet setA,
XanBitSet setB 
)

Check wheter setA is a subset of setB. In particular, even if setA and setB contain exactly the same elements true is returned. setA and setB must be of the same length.

Definition at line 3427 of file xanlib.c.

References is_bit_set(), and XanBitSet::length.

Here is the call graph for this function:

XanBitSet_Print ( XanBitSet set,
int  cr 
)

print the XanBitSet to the standard output. Set cr if you want a newline

Definition at line 3369 of file xanlib.c.

References MASK, and WORD_NUMBER.

void XanBitSet_SetAll ( XanBitSet set  ) 

set to 1 all the bits in the bitset

Definition at line 3382 of file xanlib.c.

References WORDS_NECESSARY.

void XanBitSet_SetBit ( XanBitSet set,
size_t  pos 
)

set the pos-st bit to 1

Definition at line 3413 of file xanlib.c.

References MASK, and WORD_NUMBER.

void XanBitSet_Subtract ( XanBitSet fromThis,
XanBitSet subtractThis 
)

Definition at line 3387 of file xanlib.c.

References XanBitSet::data, XanBitSet::length, and WORDS_NECESSARY.

XanList* XanHashTable_ToItemList ( XanHashTable table  ) 

From HashTable to List.

Returns the list of element and elementID pairs (in the form of XanHashTableItem) that are part of the hashtable. These are only copies of the XanHashTableItems of the hashtable, and modifing them does not affect the original hashtable. Each of the Items has to be deallocated while deallocating the XanList (e.g. calling the function destroyListAndData of the XanList data structure).

Definition at line 2660 of file xanlib.c.

References _xanListInsert(), XanHashTable::alloc, XanHashTable::free, XanHashTable::length, XanHashTableItem::next, XanHashTable::table, XanHashTableItem::used, and xanListNew().

Here is the call graph for this function:

static XanHashTable * xanHashTableCloneHashTable ( XanHashTable table  )  [inline, static]

Definition at line 2453 of file xanlib.c.

References _xanHashTableCloneHashTable(), and XanHashTable::mutex.

Referenced by xanHashTableNew().

Here is the call graph for this function:

static int xanHashTableDefaultEqualsFunction ( void *  key1,
void *  key2 
) [inline, static]

Definition at line 2506 of file xanlib.c.

Referenced by xanHashTableNew().

static unsigned int xanHashTableDefaultHashFunction ( void *  element  )  [inline, static]

Definition at line 2511 of file xanlib.c.

Referenced by xanHashTableNew().

static void xanHashTableDelete ( XanHashTable table,
void *  key 
) [inline, static]

Definition at line 2543 of file xanlib.c.

References _xanHashTableDelete(), XanHashTable::length, XanHashTable::mutex, and XanHashTable::table.

Referenced by xanHashTableNew().

Here is the call graph for this function:

static void xanHashTableDestroy ( XanHashTable table  )  [inline, static]

Definition at line 2555 of file xanlib.c.

References _xanHashTableDestroy(), XanHashTable::length, XanHashTable::mutex, and XanHashTable::table.

Referenced by xanHashTableNew().

Here is the call graph for this function:

static int xanHashTableElementsInside ( XanHashTable table  )  [inline, static]

Definition at line 2467 of file xanlib.c.

References _xanHashTableElementsInside(), and XanHashTable::mutex.

Referenced by xanHashTableNew().

Here is the call graph for this function:

static void * xanHashTableGetCloneFunction ( XanHashTable table  )  [inline, static]

Definition at line 2440 of file xanlib.c.

References _xanHashTableGetCloneFunction(), and XanHashTable::mutex.

Referenced by xanHashTableNew().

Here is the call graph for this function:

static void xanHashTableInsert ( XanHashTable table,
void *  key,
void *  element 
) [inline, static]

Definition at line 2515 of file xanlib.c.

References _xanHashTableInsert(), XanHashTable::length, XanHashTable::mutex, and XanHashTable::table.

Referenced by xanHashTableNew().

Here is the call graph for this function:

static void * xanHashTableLookup ( XanHashTable table,
void *  key 
) [inline, static]

Definition at line 2528 of file xanlib.c.

References _xanHashTableLookup(), XanHashTable::length, XanHashTable::mutex, and XanHashTable::table.

Referenced by xanHashTableNew().

Here is the call graph for this function:

XanHashTable* xanHashTableNew ( unsigned int  length,
int  hasFixedLength,
void *(*)(size_t size)  allocFunction,
void *(*)(void *addr, size_t newSize)  reallocFunction,
void(*)(void *addr)  freeFunction,
unsigned int(*)(void *element)  hashFunction,
int(*)(void *key1, void *key2)  equalsFunction 
)

Make a new Hash Table.

Allocate and initialize a new Hash table. After the allocation, the hash and equals functions cannot be changed.

Definition at line 2361 of file xanlib.c.

References _xanHashTableCloneHashTable(), _xanHashTableDelete(), _xanHashTableDestroy(), _xanHashTableElementsInside(), _xanHashTableGetCloneFunction(), _xanHashTableInsert(), _xanHashTableLock(), _xanHashTableLookup(), _xanHashTableSetCloneFunction(), _xanHashTableToList(), _xanHashTableToSlotList(), _xanHashTableUnlock(), XanHashTable::alloc, XanHashTable::clone, XanHashTable::cloneHashTable, XanHashTable::currentLoadFactor, XanHashTable::delete, XanHashTable::destroy, XanHashTable::elementsInside, XanHashTable::equals, XanHashTable::free, XanHashTable::getCloneFunction, XanHashTable::hasFixedLength, XanHashTable::hash, XanHashTable::insert, XanHashTable::length, XanHashTable::lock, XanHashTable::lookup, XanHashTable::mutex, XanHashTable::primeIndex, primes, PRIMES_TABLE_LENGTH, XanHashTable::realloc, XanHashTable::setCloneFunction, XanHashTable::size, XanHashTable::synchCloneHashTable, XanHashTable::synchDelete, XanHashTable::synchDestroy, XanHashTable::synchElementsInside, XanHashTable::synchGetCloneFunction, XanHashTable::synchInsert, XanHashTable::synchLookup, XanHashTable::synchSetCloneFunction, XanHashTable::synchToList, XanHashTable::synchToSlotList, XanHashTable::table, XanHashTable::toList, XanHashTable::toSlotList, XanHashTable::unlock, xanHashTableCloneHashTable(), xanHashTableDefaultEqualsFunction(), xanHashTableDefaultHashFunction(), xanHashTableDelete(), xanHashTableDestroy(), xanHashTableElementsInside(), xanHashTableGetCloneFunction(), xanHashTableInsert(), xanHashTableLookup(), xanHashTableSetCloneFunction(), xanHashTableToList(), and xanHashTableToSlotList().

Referenced by _xanHashTableCloneHashTable().

Here is the call graph for this function:

static void xanHashTableSetCloneFunction ( XanHashTable table,
void *(*)(void *data)  cloneFunction 
) [inline, static]

Definition at line 2430 of file xanlib.c.

References _xanHashTableSetCloneFunction(), and XanHashTable::mutex.

Referenced by xanHashTableNew().

Here is the call graph for this function:

static XanList * xanHashTableToList ( XanHashTable table  )  [inline, static]

Definition at line 2493 of file xanlib.c.

References _xanHashTableToList(), and XanHashTable::mutex.

Referenced by xanHashTableNew().

Here is the call graph for this function:

static XanList * xanHashTableToSlotList ( XanHashTable table  )  [inline, static]

Definition at line 2480 of file xanlib.c.

References _xanHashTableToSlotList(), and XanHashTable::mutex.

Referenced by xanHashTableNew().

Here is the call graph for this function:

static XanListItem * xanListAppend ( XanList list,
void *  data 
) [inline, static]

Definition at line 309 of file xanlib.c.

References _xanListAppend(), and XanList::itemsMutex.

Referenced by xanListNew().

Here is the call graph for this function:

static void xanListAppendList ( XanList list,
XanList listToAppend 
) [inline, static]

Definition at line 296 of file xanlib.c.

References _xanListAppendList(), and XanList::itemsMutex.

Referenced by xanListNew().

Here is the call graph for this function:

static XanList * xanListCloneList ( XanList list  )  [inline, static]

Definition at line 718 of file xanlib.c.

References _xanListCloneList(), and XanList::itemsMutex.

Referenced by xanListNew().

Here is the call graph for this function:

static int xanListContainsTheSameElements ( XanList list,
XanList otherList 
) [inline, static]

Definition at line 430 of file xanlib.c.

References _xanListContainsTheSameElements(), and XanList::itemsMutex.

Referenced by xanListNew().

Here is the call graph for this function:

static void * xanListData ( XanList list,
XanListItem item 
) [inline, static]

Definition at line 228 of file xanlib.c.

References _xanListData(), and XanList::itemsMutex.

Referenced by xanListNew().

Here is the call graph for this function:

static void xanListDelete ( XanList list,
void *  data 
) [inline, static]

Definition at line 419 of file xanlib.c.

References _xanListDelete(), and XanList::itemsMutex.

Referenced by xanListNew().

Here is the call graph for this function:

static void xanListDeleteAll ( XanList list,
void *  data 
) [inline, static]

Definition at line 448 of file xanlib.c.

References _xanListDeleteAll(), and XanList::itemsMutex.

Referenced by xanListNew().

Here is the call graph for this function:

static void xanListDeleteClones ( XanList list  )  [inline, static]

Definition at line 270 of file xanlib.c.

References _xanListDeleteClones(), and XanList::itemsMutex.

Referenced by xanListNew().

Here is the call graph for this function:

static void xanListDeleteItem ( XanList list,
XanListItem item 
) [inline, static]

Definition at line 408 of file xanlib.c.

References _xanListDeleteItem(), and XanList::itemsMutex.

Referenced by xanListNew().

Here is the call graph for this function:

static void xanListDestroy ( XanList list  )  [inline, static]

Definition at line 518 of file xanlib.c.

References _xanListDestroy(), and XanList::itemsMutex.

Referenced by xanListNew().

Here is the call graph for this function:

static void xanListDestroyListAndData ( XanList list  )  [inline, static]

Definition at line 508 of file xanlib.c.

References _xanListDestroyListAndData(), and XanList::itemsMutex.

Referenced by xanListNew().

Here is the call graph for this function:

static void xanListEmptyOutList ( XanList list  )  [inline, static]

Definition at line 499 of file xanlib.c.

References _xanListEmptyOutList(), and XanList::itemsMutex.

Referenced by xanListNew().

Here is the call graph for this function:

static int xanListEqualsInstancesNumber ( XanList list,
void *  data 
) [inline, static]

Definition at line 486 of file xanlib.c.

References _xanListEqualsInstancesNumber(), and XanList::itemsMutex.

Referenced by xanListNew().

Here is the call graph for this function:

static XanListItem * xanListFind ( XanList list,
void *  data 
) [inline, static]

Definition at line 366 of file xanlib.c.

References _xanListFind(), and XanList::itemsMutex.

Referenced by xanListNew().

Here is the call graph for this function:

static XanListItem * xanListFirst ( XanList list  )  [inline, static]

Definition at line 394 of file xanlib.c.

References _xanListFirst(), and XanList::itemsMutex.

Referenced by xanListNew().

Here is the call graph for this function:

static void * xanListGetCloneFunction ( XanList list  )  [inline, static]

Definition at line 761 of file xanlib.c.

References _xanListGetCloneFunction(), and XanList::itemsMutex.

Referenced by xanListNew().

Here is the call graph for this function:

static XanListItem * xanListGetElementFromPositionNumber ( XanList list,
int  positionNumber 
) [inline, static]

Definition at line 473 of file xanlib.c.

References _xanListGetElementFromPositionNumber(), and XanList::itemsMutex.

Referenced by xanListNew().

Here is the call graph for this function:

static void ** xanListGetSlotData ( XanList list,
XanListItem item 
) [inline, static]

Definition at line 214 of file xanlib.c.

References _xanListGetSlotData(), and XanList::itemsMutex.

Referenced by xanListNew().

Here is the call graph for this function:

static XanListItem * xanListInsert ( XanList list,
void *  data 
) [inline, static]

Definition at line 323 of file xanlib.c.

References _xanListInsert(), and XanList::itemsMutex.

Referenced by xanListNew().

Here is the call graph for this function:

static XanListItem * xanListInsertAfter ( XanList list,
XanListItem prev,
void *  data 
) [inline, static]

Definition at line 337 of file xanlib.c.

References _xanListInsertAfter(), and XanList::itemsMutex.

Referenced by xanListNew().

Here is the call graph for this function:

static XanListItem * xanListInsertBefore ( XanList list,
XanListItem prev,
void *  data 
) [inline, static]

Definition at line 352 of file xanlib.c.

References _xanListInsertBefore(), and XanList::itemsMutex.

Referenced by xanListNew().

Here is the call graph for this function:

static XanListItem * xanListLast ( XanList list  )  [inline, static]

Definition at line 380 of file xanlib.c.

References _xanListLast(), and XanList::itemsMutex.

Referenced by xanListNew().

Here is the call graph for this function:

static int xanListLength ( XanList list  )  [inline, static]

Definition at line 800 of file xanlib.c.

References _xanListLength(), and XanList::itemsMutex.

Referenced by xanListNew().

Here is the call graph for this function:

static XanListItem * xanListMoveToBegin ( XanList list,
XanListItem item 
) [inline, static]

Definition at line 459 of file xanlib.c.

References _xanListMoveToBegin(), and XanList::itemsMutex.

Referenced by xanListNew().

Here is the call graph for this function:

XanList* xanListNew ( void *(*)(size_t size)  allocFunction,
void(*)(void *addr)  freeFunction,
void *(*)(void *addr)  cloneFunction 
)

Make a new list.

Make a new list. e.g. XanList *myList = xanListNew(malloc, free, NULL);

Parameters:
allocFunction This function is called each time the list needs to allocate new memory; if it is NULL, then the list will use the malloc function.
freeFunction This function is called each time the list needs to free memory; if it is NULL, then the list will use the free function.
cloneFunction This function is called each time the list needs to clone the variable stored inside its elements; if it is NULL, then the list does not clone the variable stored inside each element of the list.
Returns:
Return the new list.

Definition at line 637 of file xanlib.c.

References _xanListAppend(), _xanListAppendList(), _xanListCloneList(), _xanListContainsTheSameElements(), _xanListData(), _xanListDelete(), _xanListDeleteAll(), _xanListDeleteClones(), _xanListDeleteItem(), _xanListDestroy(), _xanListDestroyListAndData(), _xanListEmptyOutList(), _xanListEqualsInstancesNumber(), _xanListFind(), _xanListFirst(), _xanListGetCloneFunction(), _xanListGetElementFromPositionNumber(), _xanListGetSlotData(), _xanListInsert(), _xanListInsertAfter(), _xanListInsertBefore(), _xanListLast(), _xanListLength(), _xanListLock(), _xanListMoveToBegin(), _xanListNext(), _xanListPrev(), _xanListSetCloneFunction(), _xanListShareSomeElements(), _xanListUnlock(), XanList::alloc, XanList::append, XanList::appendList, XanList::clone, XanList::cloneList, XanList::containsTheSameElements, XanList::data, XanList::delete, XanList::deleteAll, XanList::deleteClones, XanList::deleteItem, XanList::destroyList, XanList::destroyListAndData, XanList::emptyOutList, XanList::equalsInstancesNumber, XanList::find, XanList::first, XanList::firstItem, XanList::free, XanList::getCloneFunction, XanList::getElementFromPositionNumber, XanList::getSlotData, XanList::insert, XanList::insertAfter, XanList::insertBefore, XanList::itemsMutex, XanList::last, XanList::lastItem, XanList::len, XanList::length, XanList::lock, XanList::moveToBegin, XanList::next, XanList::prev, XanList::setCloneFunction, XanList::shareSomeElements, XanList::synchAppend, XanList::synchAppendList, XanList::synchCloneList, XanList::synchContainsTheSameElements, XanList::synchData, XanList::synchDelete, XanList::synchDeleteAll, XanList::synchDeleteClones, XanList::synchDeleteItem, XanList::synchDestroyList, XanList::synchDestroyListAndData, XanList::synchEmptyOutList, XanList::synchEqualsInstancesNumber, XanList::synchFind, XanList::synchFirst, XanList::synchGetCloneFunction, XanList::synchGetElementFromPositionNumber, XanList::synchGetSlotData, XanList::synchInsert, XanList::synchInsertAfter, XanList::synchInsertBefore, XanList::synchLast, XanList::synchLength, XanList::synchMoveToBegin, XanList::synchNext, XanList::synchPrev, XanList::synchSetCloneFunction, XanList::synchShareSomeElements, XanList::unlock, xanListAppend(), xanListAppendList(), xanListCloneList(), xanListContainsTheSameElements(), xanListData(), xanListDelete(), xanListDeleteAll(), xanListDeleteClones(), xanListDeleteItem(), xanListDestroy(), xanListDestroyListAndData(), xanListEmptyOutList(), xanListEqualsInstancesNumber(), xanListFind(), xanListFirst(), xanListGetCloneFunction(), xanListGetElementFromPositionNumber(), xanListGetSlotData(), xanListInsert(), xanListInsertAfter(), xanListInsertBefore(), xanListLast(), xanListLength(), xanListMoveToBegin(), xanListNext(), xanListPrev(), xanListSetCloneFunction(), and xanListShareSomeElements().

Referenced by _xanHashTableToList(), _xanHashTableToSlotList(), _xanListCloneList(), _xanNodeToInOrderList(), _xanNodeToPostOrderList(), _xanNodeToPreOrderList(), XanHashTable_ToItemList(), xanNodeNew(), xanPipeNew(), and xanStackNew().

static XanListItem * xanListNext ( XanList list,
XanListItem item 
) [inline, static]

Definition at line 256 of file xanlib.c.

References _xanListNext(), and XanList::itemsMutex.

Referenced by xanListNew().

Here is the call graph for this function:

static XanListItem * xanListPrev ( XanList list,
XanListItem item 
) [inline, static]

Definition at line 242 of file xanlib.c.

References _xanListPrev(), and XanList::itemsMutex.

Referenced by xanListNew().

Here is the call graph for this function:

static void xanListSetCloneFunction ( XanList list,
void *(*)(void *data)  cloneFunction 
) [inline, static]

Definition at line 782 of file xanlib.c.

References _xanListSetCloneFunction(), and XanList::itemsMutex.

Referenced by xanListNew().

Here is the call graph for this function:

static int xanListShareSomeElements ( XanList list,
XanList otherList 
) [inline, static]

Definition at line 282 of file xanlib.c.

References _xanListShareSomeElements(), and XanList::itemsMutex.

Referenced by xanListNew().

Here is the call graph for this function:

static void xanNodeAddChildren ( XanNode node,
XanNode child 
) [inline, static]

Definition at line 2019 of file xanlib.c.

References _xanNodeAddChildren(), and XanNode::mutex.

Referenced by xanNodeNew().

Here is the call graph for this function:

static XanNode * xanNodeAddNewChildren ( XanNode node,
void *  childData 
) [inline, static]

Definition at line 2030 of file xanlib.c.

References _xanNodeAddNewChildren(), and XanNode::mutex.

Referenced by xanNodeNew().

Here is the call graph for this function:

static XanNode * xanNodeCloneTree ( XanNode node  )  [inline, static]

Definition at line 1946 of file xanlib.c.

References _xanNodeCloneTree(), and XanNode::mutex.

Referenced by xanNodeNew().

Here is the call graph for this function:

static void xanNodeDeleteChildren ( XanNode node,
XanNode child 
) [inline, static]

Definition at line 2008 of file xanlib.c.

References _xanNodeDeleteChildren(), and XanNode::mutex.

Referenced by xanNodeNew().

Here is the call graph for this function:

static void xanNodeDestroyTree ( XanNode node  )  [inline, static]

Definition at line 1903 of file xanlib.c.

References _xanNodeDestroyTree(), and XanNode::mutex.

Referenced by xanNodeNew().

Here is the call graph for this function:

static void xanNodeDestroyTreeAndData ( XanNode node  )  [inline, static]

Definition at line 1913 of file xanlib.c.

References _xanNodeDestroyTreeAndData(), and XanNode::mutex.

Referenced by xanNodeNew().

Here is the call graph for this function:

static XanNode * xanNodeFind ( XanNode rootNode,
void *  data 
) [inline, static]

Definition at line 1876 of file xanlib.c.

References _xanNodeFind(), and XanNode::mutex.

Referenced by xanNodeNew().

Here is the call graph for this function:

static XanList * xanNodeGetChildrens ( XanNode node  )  [inline, static]

Definition at line 1933 of file xanlib.c.

References _xanNodeGetChildrens(), and XanNode::mutex.

Referenced by xanNodeNew().

Here is the call graph for this function:

static void * xanNodeGetData ( XanNode node  )  [inline, static]

Definition at line 1959 of file xanlib.c.

References _xanNodeGetData(), and XanNode::mutex.

Referenced by xanNodeNew().

Here is the call graph for this function:

static XanNode * xanNodeGetNextChildren ( XanNode node,
XanNode child 
) [inline, static]

Definition at line 1995 of file xanlib.c.

References _xanNodeGetNextChildren(), and XanNode::mutex.

Referenced by xanNodeNew().

Here is the call graph for this function:

static XanNode * xanNodeGetParent ( XanNode node  )  [inline, static]

Definition at line 1982 of file xanlib.c.

References _xanNodeGetParent(), and XanNode::mutex.

Referenced by xanNodeNew().

Here is the call graph for this function:

XanNode* xanNodeNew ( void *(*)(size_t size)  allocFunction,
void(*)(void *addr)  freeFunction,
void *(*)(void *data)  cloneFunction 
)

Make a new node.

Make a new node of the N-ary tree.

Parameters:
allocFunction This function is called each time the tree needs to allocate new memory; if it is NULL, then the tree will use the malloc function.
freeFunction This function is called each time the tree needs to free memory; if it is NULL, then the tree will use the free function.
cloneFunction This function is called each time the tree needs to clone the variable stored inside its elements; if it is NULL, then the tree does not clone the variable stored inside each element of the tree rooted at the current node.
Returns:
Return the new node.

Definition at line 1785 of file xanlib.c.

References _xanNodeAddChildren(), _xanNodeAddNewChildren(), _xanNodeCloneTree(), _xanNodeDeleteChildren(), _xanNodeDestroyNode(), _xanNodeDestroyTree(), _xanNodeDestroyTreeAndData(), _xanNodeFind(), _xanNodeGetChildrens(), _xanNodeGetData(), _xanNodeGetNextChildren(), _xanNodeGetParent(), _xanNodeSetCloneFunction(), _xanNodeSetData(), _xanNodeSetParent(), _xanNodeToInOrderList(), _xanNodeToPostOrderList(), _xanNodeToPreOrderList(), XanNode::addChildren, XanNode::addNewChildren, XanNode::alloc, XanNode::childrens, XanNode::clone, XanNode::cloneTree, XanNode::data, XanNode::deleteChildren, XanNode::destroyNode, XanNode::destroyTree, XanNode::destroyTreeAndData, XanNode::find, XanNode::free, XanNode::getChildrens, XanNode::getData, XanNode::getNextChildren, XanNode::getParent, XanNode::mutex, XanNode::parent, XanNode::setCloneFunction, XanNode::setData, XanNode::setParent, XanNode::synchAddChildren, XanNode::synchAddNewChildren, XanNode::synchCloneTree, XanNode::synchDeleteChildren, XanNode::synchDestroyTree, XanNode::synchDestroyTreeAndData, XanNode::synchFind, XanNode::synchGetChildrens, XanNode::synchGetData, XanNode::synchGetNextChildren, XanNode::synchGetParent, XanNode::synchSetCloneFunction, XanNode::synchSetData, XanNode::synchSetParent, XanNode::synchToInOrderList, XanNode::synchToPostOrderList, XanNode::synchToPreOrderList, XanNode::toInOrderList, XanNode::toPostOrderList, XanNode::toPreOrderList, xanListNew(), xanNodeAddChildren(), xanNodeAddNewChildren(), xanNodeCloneTree(), xanNodeDeleteChildren(), xanNodeDestroyTree(), xanNodeDestroyTreeAndData(), xanNodeFind(), xanNodeGetChildrens(), xanNodeGetData(), xanNodeGetNextChildren(), xanNodeGetParent(), xanNodeSetCloneFunction(), xanNodeSetData(), xanNodeSetParent(), xanNodeToInOrderList(), xanNodeToPostOrderList(), and xanNodeToPreOrderList().

Referenced by _xanNodeAddNewChildren(), and _xanNodeCloneTree().

Here is the call graph for this function:

static void xanNodeSetCloneFunction ( XanNode node,
void *(*)(void *data)  cloneFunction 
) [inline, static]

Definition at line 1923 of file xanlib.c.

References _xanNodeSetCloneFunction(), and XanNode::mutex.

Referenced by xanNodeNew().

Here is the call graph for this function:

static void xanNodeSetData ( XanNode node,
void *  data 
) [inline, static]

Definition at line 1972 of file xanlib.c.

References _xanNodeSetData(), and XanNode::mutex.

Referenced by xanNodeNew().

Here is the call graph for this function:

static void xanNodeSetParent ( XanNode node,
XanNode parent 
) [inline, static]

Definition at line 2043 of file xanlib.c.

References _xanNodeSetParent(), and XanNode::mutex.

Referenced by xanNodeNew().

Here is the call graph for this function:

static XanList * xanNodeToInOrderList ( XanNode node  )  [inline, static]

Definition at line 1889 of file xanlib.c.

References _xanNodeToInOrderList(), and XanNode::mutex.

Referenced by xanNodeNew().

Here is the call graph for this function:

static XanList * xanNodeToPostOrderList ( XanNode node  )  [inline, static]

Definition at line 1862 of file xanlib.c.

References _xanNodeToPostOrderList(), and XanNode::mutex.

Referenced by xanNodeNew().

Here is the call graph for this function:

static XanList * xanNodeToPreOrderList ( XanNode node  )  [inline, static]

Definition at line 1848 of file xanlib.c.

References _xanNodeToPreOrderList(), and XanNode::mutex.

Referenced by xanNodeNew().

Here is the call graph for this function:

static void xanPipeDeleteItem ( XanPipe pipe,
XanListItem item 
) [inline, static]

Definition at line 1574 of file xanlib.c.

References _xanPipeDeleteItem(), and XanPipe::itemsMutex.

Referenced by xanPipeNew().

Here is the call graph for this function:

static void * xanPipeGet ( XanPipe pipe  )  [inline, static]

Definition at line 1523 of file xanlib.c.

References _xanListData(), _xanListDeleteItem(), _xanListFirst(), XanList::first, XanPipe::items, XanPipe::itemsCond, XanPipe::itemsMutex, XanList::length, and XanList::next.

Referenced by xanPipeNew().

Here is the call graph for this function:

static int xanPipeIsEmpty ( XanPipe pipe  )  [inline, static]

Definition at line 1511 of file xanlib.c.

References _xanPipeIsEmpty(), and XanPipe::itemsMutex.

Referenced by xanPipeNew().

Here is the call graph for this function:

static void xanPipeLock ( XanPipe pipe  )  [inline, static]

Definition at line 1680 of file xanlib.c.

References XanPipe::itemsMutex.

Referenced by xanPipeNew().

static XanListItem * xanPipeMoveToEnd ( XanPipe pipe,
void *  item 
) [inline, static]

Definition at line 1564 of file xanlib.c.

References _xanPipeMoveToEnd(), and XanPipe::itemsMutex.

Referenced by xanPipeNew().

Here is the call graph for this function:

XanPipe* xanPipeNew ( void *(*)(size_t size)  allocFunction,
void(*)(void *addr)  freeFunction 
)

Make a new pipe.

Make a new pipe.

Parameters:
allocFunction This function is called each time the pipe needs to allocate new memory; if it is NULL, then the pipe will use the malloc function.
freeFunction This function is called each time the pipe needs to free memory; if it is NULL, then the pipe will use the free function.
Returns:
Return the new pipe.

Definition at line 1470 of file xanlib.c.

References _xanPipeDeleteItem(), _xanPipeDestroyPipe(), _xanPipeGet(), _xanPipeIsEmpty(), _xanPipeMoveToEnd(), _xanPipePut(), _xanPipePutAtEnd(), XanPipe::alloc, XanPipe::deleteItem, XanPipe::destroyPipe, XanPipe::free, XanPipe::get, XanPipe::isEmpty, XanPipe::items, XanPipe::itemsCond, XanPipe::itemsMutex, XanPipe::lock, XanPipe::moveToEnd, XanPipe::put, XanPipe::putAtEnd, XanPipe::synchDeleteItem, XanPipe::synchGet, XanPipe::synchIsEmpty, XanPipe::synchMoveToEnd, XanPipe::synchPut, XanPipe::synchPutAtEnd, XanPipe::unlock, xanListNew(), xanPipeDeleteItem(), xanPipeGet(), xanPipeIsEmpty(), xanPipeLock(), xanPipeMoveToEnd(), xanPipePut(), xanPipePutAtEnd(), and xanPipeUnlock().

Here is the call graph for this function:

static XanListItem * xanPipePut ( XanPipe pipe,
void *  item 
) [inline, static]

Definition at line 1591 of file xanlib.c.

References _xanPipePut(), and XanPipe::itemsMutex.

Referenced by xanPipeNew().

Here is the call graph for this function:

static XanListItem * xanPipePutAtEnd ( XanPipe pipe,
void *  item 
) [inline, static]

Definition at line 1581 of file xanlib.c.

References _xanPipePutAtEnd(), and XanPipe::itemsMutex.

Referenced by xanPipeNew().

Here is the call graph for this function:

static void xanPipeUnlock ( XanPipe pipe  )  [inline, static]

Definition at line 1688 of file xanlib.c.

References XanPipe::itemsMutex.

Referenced by xanPipeNew().

bool xanStackContains ( XanStack stack,
void *  element 
)

Definition at line 3182 of file xanlib.c.

References _xanListFind(), and XanStack::internalList.

Referenced by xanStackSynchContains().

Here is the call graph for this function:

static int xanStackGetSize ( XanStack stack  )  [inline, static]

Definition at line 3169 of file xanlib.c.

References _xanStackGetSize(), and XanStack::mutex.

Referenced by xanStackNew().

Here is the call graph for this function:

XanStack* xanStackNew ( void *(*)(size_t size)  allocFunction,
void(*)(void *addr)  freeFunction,
void *(*)(void *data)  cloneFunction 
)
static void * xanStackPop ( XanStack stack  )  [inline, static]

Definition at line 3156 of file xanlib.c.

References _xanStackPop(), and XanStack::mutex.

Referenced by xanStackNew().

Here is the call graph for this function:

static void xanStackPush ( XanStack stack,
void *  newElement 
) [inline, static]

Definition at line 3230 of file xanlib.c.

References _xanStackPush(), and XanStack::mutex.

Referenced by xanStackNew().

Here is the call graph for this function:

bool xanStackSynchContains ( XanStack stack,
void *  element 
)

Definition at line 3198 of file xanlib.c.

References XanStack::mutex, and xanStackContains().

Here is the call graph for this function:

XanVar* xanVarNew ( void *(*)(size_t size)  allocFunction,
void(*)(void *addr)  freeFunction 
)

Make a new variable.

Make a new variable.

Parameters:
allocFunction This function is called each time the variable needs to allocate new memory; if it is NULL, then the variable will use the malloc function.
freeFunction This function is called each time the variable needs to free memory; if it is NULL, then the variable will use the free function.
Returns:
Return the new variable.

Definition at line 1386 of file xanlib.c.

References _varRead(), _varWrite(), XanVar::alloc, XanVar::data, XanVar::destroyVarAndData, XanVar::free, XanVar::lock, XanVar::mutex, XanVar::read, XanVar::synchRead, XanVar::synchWrite, XanVar::unlock, varDestroyVarAndData(), varLock(), varRead(), varUnlock(), varWrite(), and XanVar::write.

Here is the call graph for this function:


Variable Documentation

const size_t primes[] [static]
Initial value:
 {
53, 97, 193, 389,
769, 1543, 3079, 6151,
12289, 24593, 49157, 98317,
196613, 393241, 786433, 1572869,
3145739, 6291469, 12582917, 25165843,
50331653, 100663319, 201326611, 402653189,
805306457, 1610612741
}

Definition at line 36 of file xanlib.c.

Referenced by _xanHashTableExpand(), and xanHashTableNew().

Generated on Mon Apr 26 15:54:46 2010 for xanlib by  doxygen 1.6.3