#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>
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 XanListItem * | xanListAppend (XanList *list, void *data) |
static XanListItem * | _xanListAppend (XanList *list, void *data) |
static XanListItem * | xanListInsert (XanList *list, void *data) |
static XanListItem * | _xanListInsert (XanList *list, void *data) |
static XanListItem * | xanListInsertBefore (XanList *list, XanListItem *prev, void *data) |
static XanListItem * | _xanListInsertBefore (XanList *list, XanListItem *prev, void *data) |
static XanListItem * | xanListInsertAfter (XanList *list, XanListItem *prev, void *data) |
static XanListItem * | _xanListInsertAfter (XanList *list, XanListItem *prev, void *data) |
static XanListItem * | xanListMoveToBegin (XanList *list, XanListItem *item) |
static XanListItem * | _xanListMoveToBegin (XanList *list, XanListItem *item) |
static XanListItem * | xanListFirst (XanList *list) |
static XanListItem * | _xanListFirst (XanList *list) |
static XanListItem * | xanListLast (XanList *list) |
static XanListItem * | _xanListLast (XanList *list) |
static XanListItem * | xanListFind (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 XanListItem * | xanListNext (XanList *list, XanListItem *item) |
static XanListItem * | _xanListNext (XanList *list, XanListItem *item) |
static XanListItem * | xanListPrev (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 XanList * | xanListCloneList (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 XanListItem * | xanListGetElementFromPositionNumber (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 XanListItem * | xanPipePut (XanPipe *pipe, void *item) |
static XanListItem * | _xanPipePut (XanPipe *pipe, void *item) |
static XanListItem * | xanPipePutAtEnd (XanPipe *pipe, void *item) |
static XanListItem * | _xanPipePutAtEnd (XanPipe *pipe, void *item) |
static XanListItem * | xanPipeMoveToEnd (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 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 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 XanNode * | xanNodeCloneTree (XanNode *node) |
static XanNode * | _xanNodeCloneTree (XanNode *node) |
static void | xanNodeDeleteChildren (XanNode *node, XanNode *child) |
static void | _xanNodeDeleteChildren (XanNode *node, XanNode *child) |
static XanList * | xanNodeGetChildrens (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 XanList * | xanNodeToPreOrderList (XanNode *node) |
static XanList * | _xanNodeToPreOrderList (XanNode *node) |
static XanList * | xanNodeToPostOrderList (XanNode *node) |
static XanList * | _xanNodeToPostOrderList (XanNode *node) |
static XanList * | xanNodeToInOrderList (XanNode *node) |
static XanList * | _xanNodeToInOrderList (XanNode *node) |
static XanNode * | xanNodeFind (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 XanList * | xanHashTableToList (XanHashTable *table) |
static XanList * | _xanHashTableToList (XanHashTable *table) |
static XanList * | xanHashTableToSlotList (XanHashTable *table) |
static XanList * | _xanHashTableToSlotList (XanHashTable *table) |
static int | xanHashTableElementsInside (XanHashTable *table) |
static int | _xanHashTableElementsInside (XanHashTable *table) |
static XanHashTable * | xanHashTableCloneHashTable (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) |
XanList * | xanListNew (void *(*allocFunction)(size_t size), void(*freeFunction)(void *addr), void *(*cloneFunction)(void *addr)) |
Make a new list. | |
XanVar * | xanVarNew (void *(*allocFunction)(size_t size), void(*freeFunction)(void *addr)) |
Make a new variable. | |
XanPipe * | xanPipeNew (void *(*allocFunction)(size_t size), void(*freeFunction)(void *addr)) |
Make a new pipe. | |
XanStack * | xanStackNew (void *(*allocFunction)(size_t size), void(*freeFunction)(void *addr), void *(*cloneFunction)(void *data)) |
XanNode * | xanNodeNew (void *(*allocFunction)(size_t size), void(*freeFunction)(void *addr), void *(*cloneFunction)(void *data)) |
Make a new node. | |
XanHashTable * | xanHashTableNew (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. | |
XanList * | XanHashTable_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 () |
XanBitSet * | XanBitSet_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 | |
XanBitSet * | XanBitSet_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 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().
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 ) |
Definition at line 3313 of file xanlib.c.
Referenced by XanBitSet_Alloc(), XanBitSet_ClearAll(), XanBitSet_Clone(), XanBitSet_Copy(), XanBitSet_Equal(), XanBitSet_Intersect(), XanBitSet_SetAll(), and XanBitSet_Subtract().
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] |
Definition at line 2582 of file xanlib.c.
References XanHashTable::alloc, XanHashTable::clone, XanHashTableItem::element, XanHashTableItem::elementID, XanHashTable::elementsInside, XanHashTable::equals, XanHashTable::free, XanHashTable::getCloneFunction, XanHashTable::hasFixedLength, XanHashTable::hash, XanHashTable::insert, XanHashTable::length, XanHashTableItem::next, XanHashTable::realloc, XanHashTable::setCloneFunction, XanHashTable::table, XanHashTableItem::used, and xanHashTableNew().
Referenced by xanHashTableCloneHashTable(), and xanHashTableNew().
static void _xanHashTableDelete | ( | XanHashTable * | table, | |
void * | key | |||
) | [inline, static] |
Definition at line 2820 of file xanlib.c.
References _xanHashTableImproveHash(), XanHashTable::currentLoadFactor, XanHashTableItem::element, XanHashTableItem::elementID, XanHashTable::equals, XanHashTable::free, XanHashTable::length, XanHashTableItem::next, print_err(), XanHashTable::size, XanHashTable::table, and XanHashTableItem::used.
Referenced by xanHashTableDelete(), and xanHashTableNew().
static void _xanHashTableDestroy | ( | XanHashTable * | table | ) | [inline, static] |
Definition at line 2964 of file xanlib.c.
References XanHashTable::free, XanHashTable::length, XanHashTableItem::next, XanHashTable::table, and XanHashTableItem::used.
Referenced by xanHashTableDestroy(), and xanHashTableNew().
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] |
Definition at line 2876 of file xanlib.c.
References _xanHashTableImproveHash(), XanHashTable::alloc, XanHashTable::currentLoadFactor, XanHashTableItem::element, XanHashTableItem::elementID, XanHashTable::free, XanHashTable::length, XanHashTableItem::next, XanHashTable::primeIndex, primes, XanHashTable::table, and XanHashTableItem::used.
Referenced by _xanHashTableInsert().
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] |
Definition at line 2954 of file xanlib.c.
References XanHashTable::hash.
Referenced by _xanHashTableDelete(), _xanHashTableExpand(), _xanHashTableInsert(), and _xanHashTableLookup().
static void _xanHashTableInsert | ( | XanHashTable * | table, | |
void * | key, | |||
void * | element | |||
) | [inline, static] |
Definition at line 2728 of file xanlib.c.
References _xanHashTableExpand(), _xanHashTableImproveHash(), _xanHashTableLookup(), XanHashTable::alloc, XanHashTable::currentLoadFactor, XanHashTableItem::element, XanHashTableItem::elementID, XanHashTable::hasFixedLength, HASHTABLE_DEFAULT_LOAD_FACTOR, XanHashTable::length, XanHashTableItem::next, print_err(), XanHashTable::size, XanHashTable::table, and XanHashTableItem::used.
Referenced by xanHashTableInsert(), and xanHashTableNew().
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] |
Definition at line 2785 of file xanlib.c.
References _xanHashTableImproveHash(), XanHashTableItem::element, XanHashTableItem::elementID, XanHashTable::equals, XanHashTable::length, XanHashTableItem::next, XanHashTable::table, and XanHashTableItem::used.
Referenced by _xanHashTableInsert(), xanHashTableLookup(), and xanHashTableNew().
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] |
Definition at line 2633 of file xanlib.c.
References _xanListInsert(), XanHashTable::alloc, XanHashTableItem::element, XanHashTable::free, XanHashTable::length, XanHashTableItem::next, XanHashTable::table, XanHashTableItem::used, and xanListNew().
Referenced by xanHashTableNew(), and xanHashTableToList().
static XanList * _xanHashTableToSlotList | ( | XanHashTable * | table | ) | [inline, static] |
Definition at line 2687 of file xanlib.c.
References _xanListInsert(), XanHashTable::alloc, XanHashTableItem::element, XanHashTable::free, XanHashTable::length, XanHashTableItem::next, XanHashTable::table, XanHashTableItem::used, and xanListNew().
Referenced by xanHashTableNew(), and xanHashTableToSlotList().
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] |
Definition at line 598 of file xanlib.c.
References XanList::alloc, XanListItem::data, XanList::firstItem, XanList::lastItem, XanList::len, XanListItem::next, PDEBUG, and XanListItem::prev.
Referenced by _xanListAppendList(), _xanListCloneList(), _xanListInsertAfter(), _xanNodeAddChildren(), _xanNodeAddNewChildren(), _xanPipePut(), internalInOrderListHelpFunction(), internalPostOrderListHelpFunction(), internalPreOrderListHelpFunction(), xanListAppend(), and xanListNew().
Definition at line 581 of file xanlib.c.
References _xanListAppend(), _xanListData(), _xanListFirst(), and _xanListNext().
Referenced by xanListAppendList(), and xanListNew().
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().
Definition at line 1232 of file xanlib.c.
References _xanListFind(), _xanListFirst(), _xanListNext(), XanListItem::data, and XanList::len.
Referenced by xanListContainsTheSameElements(), and xanListNew().
static void * _xanListData | ( | XanList * | list, | |
XanListItem * | item | |||
) | [inline, static] |
Definition at line 1037 of file xanlib.c.
References XanListItem::data.
Referenced by _xanListAppendList(), _xanListDelete(), _xanListDeleteAll(), _xanListDeleteClones(), _xanListEqualsInstancesNumber(), _xanListFind(), _xanListShareSomeElements(), _xanNodeGetNextChildren(), _xanPipeGet(), _xanStackPop(), xanListData(), xanListNew(), and xanPipeGet().
static void _xanListDelete | ( | XanList * | list, | |
void * | data | |||
) | [inline, static] |
Definition at line 1321 of file xanlib.c.
References _xanListData(), _xanListFind(), _xanListNext(), _xanListPrev(), XanList::firstItem, XanList::free, XanList::lastItem, XanList::len, XanListItem::next, XanListItem::prev, and print_err().
Referenced by _xanNodeDeleteChildren(), xanListDelete(), and xanListNew().
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().
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().
static void _xanListDeleteItem | ( | XanList * | list, | |
XanListItem * | item | |||
) | [inline, static] |
Definition at line 1181 of file xanlib.c.
References _xanListNext(), _xanListPrev(), XanList::data, XanList::find, XanList::firstItem, XanList::free, XanList::lastItem, XanList::len, XanListItem::next, and XanListItem::prev.
Referenced by _xanListDeleteClones(), _xanListEmptyOutList(), _xanPipeDeleteItem(), _xanPipeGet(), _xanStackPop(), xanListDeleteItem(), xanListNew(), and xanPipeGet().
static void _xanListDestroy | ( | XanList * | list | ) | [inline, static] |
Definition at line 952 of file xanlib.c.
References _xanListFirst(), _xanListNext(), and XanList::free.
Referenced by _xanNodeDestroyNode(), _xanNodeDestroyTree(), _xanNodeDestroyTreeAndData(), _xanPipeDestroyPipe(), _xanStackDestroyStack(), xanListDestroy(), and xanListNew().
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().
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().
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().
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().
static XanListItem * _xanListFirst | ( | XanList * | list | ) | [inline, static] |
Definition at line 1018 of file xanlib.c.
References XanList::firstItem.
Referenced by _xanListAppendList(), _xanListCloneList(), _xanListContainsTheSameElements(), _xanListDeleteClones(), _xanListDestroy(), _xanListDestroyListAndData(), _xanListEmptyOutList(), _xanListEqualsInstancesNumber(), _xanListFind(), _xanListGetElementFromPositionNumber(), _xanListMoveToBegin(), _xanListShareSomeElements(), _xanNodeGetNextChildren(), _xanPipeGet(), _xanStackPop(), xanListFirst(), xanListNew(), and xanPipeGet().
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().
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] |
Definition at line 1064 of file xanlib.c.
References XanList::alloc, XanListItem::data, XanList::firstItem, XanList::lastItem, XanList::len, XanListItem::next, and XanListItem::prev.
Referenced by _xanHashTableToList(), _xanHashTableToSlotList(), _xanListInsertBefore(), _xanNodeCloneTree(), _xanPipePutAtEnd(), _xanStackPush(), XanHashTable_ToItemList(), xanListInsert(), and xanListNew().
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().
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().
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] |
Definition at line 814 of file xanlib.c.
References XanList::len.
Referenced by _xanNodeGetChildrens(), _xanPipeIsEmpty(), _xanStackGetSize(), _xanStackPop(), xanListLength(), and xanListNew().
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] |
Definition at line 823 of file xanlib.c.
References _xanListFirst(), XanList::data, XanList::find, XanList::firstItem, XanList::lastItem, XanList::len, XanList::length, XanListItem::next, and XanListItem::prev.
Referenced by _xanPipeMoveToEnd(), xanListMoveToBegin(), and xanListNew().
static XanListItem * _xanListNext | ( | XanList * | list, | |
XanListItem * | item | |||
) | [inline, static] |
Definition at line 1046 of file xanlib.c.
References XanListItem::next.
Referenced by _xanListAppendList(), _xanListCloneList(), _xanListContainsTheSameElements(), _xanListDelete(), _xanListDeleteAll(), _xanListDeleteClones(), _xanListDeleteItem(), _xanListDestroy(), _xanListDestroyListAndData(), _xanListEqualsInstancesNumber(), _xanListFind(), _xanListGetElementFromPositionNumber(), _xanListShareSomeElements(), _xanNodeGetNextChildren(), xanListNew(), and xanListNext().
static XanListItem * _xanListPrev | ( | XanList * | list, | |
XanListItem * | item | |||
) | [inline, static] |
Definition at line 1055 of file xanlib.c.
References XanListItem::prev.
Referenced by _xanListDelete(), _xanListDeleteAll(), _xanListDeleteItem(), xanListNew(), and xanListPrev().
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().
Definition at line 556 of file xanlib.c.
References _xanListData(), _xanListFirst(), and _xanListNext().
Referenced by xanListNew(), and xanListShareSomeElements().
static void _xanListUnlock | ( | XanList * | list | ) | [inline, static] |
Definition at line 907 of file xanlib.c.
References XanList::itemsMutex.
Referenced by xanListNew().
Definition at line 2293 of file xanlib.c.
References _xanListAppend(), _xanNodeDeleteChildren(), _xanNodeGetParent(), _xanNodeSetParent(), and XanNode::childrens.
Referenced by xanNodeAddChildren(), and xanNodeNew().
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().
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().
Definition at line 2279 of file xanlib.c.
References _xanListDelete(), _xanNodeSetParent(), XanNode::childrens, and XanNode::data.
Referenced by _xanNodeAddChildren(), xanNodeDeleteChildren(), and xanNodeNew().
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().
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().
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().
Definition at line 2151 of file xanlib.c.
References XanNode::data, and XanNode::getNextChildren.
Referenced by xanNodeFind(), and xanNodeNew().
Definition at line 2343 of file xanlib.c.
References _xanListCloneList(), _xanListLength(), and XanNode::childrens.
Referenced by xanNodeGetChildrens(), and xanNodeNew().
static void * _xanNodeGetData | ( | XanNode * | node | ) | [inline, static] |
Definition at line 2063 of file xanlib.c.
References XanNode::data.
Referenced by internalPreOrderListHelpFunction(), xanNodeGetData(), and xanNodeNew().
Definition at line 2245 of file xanlib.c.
References _xanListData(), _xanListFirst(), _xanListNext(), and XanNode::childrens.
Referenced by _xanNodeDestroyTree(), _xanNodeDestroyTreeAndData(), xanNodeGetNextChildren(), and xanNodeNew().
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().
Definition at line 2335 of file xanlib.c.
References XanNode::parent.
Referenced by _xanNodeAddChildren(), _xanNodeAddNewChildren(), _xanNodeDeleteChildren(), xanNodeNew(), and xanNodeSetParent().
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().
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().
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().
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().
static void _xanPipeDestroyPipe | ( | XanPipe * | pipe | ) | [inline, static] |
Definition at line 1719 of file xanlib.c.
References _xanListDestroy(), and XanPipe::items.
Referenced by xanPipeNew().
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().
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().
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().
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().
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().
static void _xanStackDestroyStack | ( | XanStack * | stack | ) | [inline, static] |
Definition at line 3210 of file xanlib.c.
References _xanListDestroy(), and XanStack::internalList.
Referenced by xanStackNew().
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().
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().
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().
Definition at line 3128 of file xanlib.c.
References _xanListAppend(), XanNode::getData, XanNode::getNextChildren, and internalPreOrderListHelpFunction().
Referenced by _xanNodeToInOrderList().
Definition at line 3106 of file xanlib.c.
References _xanListAppend(), XanNode::getData, and XanNode::getNextChildren.
Referenced by _xanNodeToPostOrderList().
Definition at line 3084 of file xanlib.c.
References _xanListAppend(), _xanNodeGetData(), and XanNode::getNextChildren.
Referenced by _xanNodeToPreOrderList(), and internalInOrderListHelpFunction().
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 | |||
) |
void libxanCompilationTime | ( | char * | buffer, | |
int | bufferLength | |||
) |
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.
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().
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.
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().
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] |
static void * varRead | ( | XanVar * | var | ) | [inline, static] |
Definition at line 1440 of file xanlib.c.
References _varRead(), and XanVar::mutex.
Referenced by xanVarNew().
static void varUnlock | ( | XanVar * | var | ) | [inline, static] |
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().
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 | |||
) |
clone src and return it
Definition at line 3357 of file xanlib.c.
References XanBitSet::data, XanBitSet::length, WORDS_NECESSARY, and XanBitSet_Alloc().
Definition at line 3364 of file xanlib.c.
References XanBitSet::data, XanBitSet::length, and WORDS_NECESSARY.
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 | ) |
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().
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().
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.
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 | |||
) |
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().
static XanHashTable * xanHashTableCloneHashTable | ( | XanHashTable * | table | ) | [inline, static] |
Definition at line 2453 of file xanlib.c.
References _xanHashTableCloneHashTable(), and XanHashTable::mutex.
Referenced by xanHashTableNew().
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().
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().
static int xanHashTableElementsInside | ( | XanHashTable * | table | ) | [inline, static] |
Definition at line 2467 of file xanlib.c.
References _xanHashTableElementsInside(), and XanHashTable::mutex.
Referenced by xanHashTableNew().
static void * xanHashTableGetCloneFunction | ( | XanHashTable * | table | ) | [inline, static] |
Definition at line 2440 of file xanlib.c.
References _xanHashTableGetCloneFunction(), and XanHashTable::mutex.
Referenced by xanHashTableNew().
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().
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().
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().
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().
static XanList * xanHashTableToList | ( | XanHashTable * | table | ) | [inline, static] |
Definition at line 2493 of file xanlib.c.
References _xanHashTableToList(), and XanHashTable::mutex.
Referenced by xanHashTableNew().
static XanList * xanHashTableToSlotList | ( | XanHashTable * | table | ) | [inline, static] |
Definition at line 2480 of file xanlib.c.
References _xanHashTableToSlotList(), and XanHashTable::mutex.
Referenced by xanHashTableNew().
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().
Definition at line 296 of file xanlib.c.
References _xanListAppendList(), and XanList::itemsMutex.
Referenced by xanListNew().
Definition at line 718 of file xanlib.c.
References _xanListCloneList(), and XanList::itemsMutex.
Referenced by xanListNew().
Definition at line 430 of file xanlib.c.
References _xanListContainsTheSameElements(), and XanList::itemsMutex.
Referenced by xanListNew().
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().
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().
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().
static void xanListDeleteClones | ( | XanList * | list | ) | [inline, static] |
Definition at line 270 of file xanlib.c.
References _xanListDeleteClones(), and XanList::itemsMutex.
Referenced by xanListNew().
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().
static void xanListDestroy | ( | XanList * | list | ) | [inline, static] |
Definition at line 518 of file xanlib.c.
References _xanListDestroy(), and XanList::itemsMutex.
Referenced by xanListNew().
static void xanListDestroyListAndData | ( | XanList * | list | ) | [inline, static] |
Definition at line 508 of file xanlib.c.
References _xanListDestroyListAndData(), and XanList::itemsMutex.
Referenced by xanListNew().
static void xanListEmptyOutList | ( | XanList * | list | ) | [inline, static] |
Definition at line 499 of file xanlib.c.
References _xanListEmptyOutList(), and XanList::itemsMutex.
Referenced by xanListNew().
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().
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().
static XanListItem * xanListFirst | ( | XanList * | list | ) | [inline, static] |
Definition at line 394 of file xanlib.c.
References _xanListFirst(), and XanList::itemsMutex.
Referenced by xanListNew().
static void * xanListGetCloneFunction | ( | XanList * | list | ) | [inline, static] |
Definition at line 761 of file xanlib.c.
References _xanListGetCloneFunction(), and XanList::itemsMutex.
Referenced by xanListNew().
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().
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().
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().
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().
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().
static XanListItem * xanListLast | ( | XanList * | list | ) | [inline, static] |
Definition at line 380 of file xanlib.c.
References _xanListLast(), and XanList::itemsMutex.
Referenced by xanListNew().
static int xanListLength | ( | XanList * | list | ) | [inline, static] |
Definition at line 800 of file xanlib.c.
References _xanListLength(), and XanList::itemsMutex.
Referenced by xanListNew().
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().
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);
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. |
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().
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().
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().
Definition at line 282 of file xanlib.c.
References _xanListShareSomeElements(), and XanList::itemsMutex.
Referenced by xanListNew().
Definition at line 2019 of file xanlib.c.
References _xanNodeAddChildren(), and XanNode::mutex.
Referenced by xanNodeNew().
Definition at line 2030 of file xanlib.c.
References _xanNodeAddNewChildren(), and XanNode::mutex.
Referenced by xanNodeNew().
Definition at line 1946 of file xanlib.c.
References _xanNodeCloneTree(), and XanNode::mutex.
Referenced by xanNodeNew().
Definition at line 2008 of file xanlib.c.
References _xanNodeDeleteChildren(), and XanNode::mutex.
Referenced by xanNodeNew().
static void xanNodeDestroyTree | ( | XanNode * | node | ) | [inline, static] |
Definition at line 1903 of file xanlib.c.
References _xanNodeDestroyTree(), and XanNode::mutex.
Referenced by xanNodeNew().
static void xanNodeDestroyTreeAndData | ( | XanNode * | node | ) | [inline, static] |
Definition at line 1913 of file xanlib.c.
References _xanNodeDestroyTreeAndData(), and XanNode::mutex.
Referenced by xanNodeNew().
Definition at line 1876 of file xanlib.c.
References _xanNodeFind(), and XanNode::mutex.
Referenced by xanNodeNew().
Definition at line 1933 of file xanlib.c.
References _xanNodeGetChildrens(), and XanNode::mutex.
Referenced by xanNodeNew().
static void * xanNodeGetData | ( | XanNode * | node | ) | [inline, static] |
Definition at line 1959 of file xanlib.c.
References _xanNodeGetData(), and XanNode::mutex.
Referenced by xanNodeNew().
Definition at line 1995 of file xanlib.c.
References _xanNodeGetNextChildren(), and XanNode::mutex.
Referenced by xanNodeNew().
Definition at line 1982 of file xanlib.c.
References _xanNodeGetParent(), and XanNode::mutex.
Referenced by xanNodeNew().
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.
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. |
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().
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().
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().
Definition at line 2043 of file xanlib.c.
References _xanNodeSetParent(), and XanNode::mutex.
Referenced by xanNodeNew().
Definition at line 1889 of file xanlib.c.
References _xanNodeToInOrderList(), and XanNode::mutex.
Referenced by xanNodeNew().
Definition at line 1862 of file xanlib.c.
References _xanNodeToPostOrderList(), and XanNode::mutex.
Referenced by xanNodeNew().
Definition at line 1848 of file xanlib.c.
References _xanNodeToPreOrderList(), and XanNode::mutex.
Referenced by xanNodeNew().
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().
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().
static int xanPipeIsEmpty | ( | XanPipe * | pipe | ) | [inline, static] |
Definition at line 1511 of file xanlib.c.
References _xanPipeIsEmpty(), and XanPipe::itemsMutex.
Referenced by xanPipeNew().
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().
XanPipe* xanPipeNew | ( | void *(*)(size_t size) | allocFunction, | |
void(*)(void *addr) | freeFunction | |||
) |
Make a new pipe.
Make a new pipe.
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. |
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().
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().
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().
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().
static int xanStackGetSize | ( | XanStack * | stack | ) | [inline, static] |
Definition at line 3169 of file xanlib.c.
References _xanStackGetSize(), and XanStack::mutex.
Referenced by xanStackNew().
XanStack* xanStackNew | ( | void *(*)(size_t size) | allocFunction, | |
void(*)(void *addr) | freeFunction, | |||
void *(*)(void *data) | cloneFunction | |||
) |
Definition at line 1758 of file xanlib.c.
References _xanStackDestroyStack(), _xanStackGetSize(), _xanStackPop(), _xanStackPush(), XanStack::destroyStack, XanStack::getSize, XanStack::internalList, XanStack::mutex, XanStack::pop, XanStack::push, XanStack::synchGetSize, XanStack::synchPop, XanStack::synchPush, xanListNew(), xanStackGetSize(), xanStackPop(), and xanStackPush().
static void * xanStackPop | ( | XanStack * | stack | ) | [inline, static] |
Definition at line 3156 of file xanlib.c.
References _xanStackPop(), and XanStack::mutex.
Referenced by xanStackNew().
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().
bool xanStackSynchContains | ( | XanStack * | stack, | |
void * | element | |||
) |
Definition at line 3198 of file xanlib.c.
References XanStack::mutex, and xanStackContains().
XanVar* xanVarNew | ( | void *(*)(size_t size) | allocFunction, | |
void(*)(void *addr) | freeFunction | |||
) |
Make a new variable.
Make a new variable.
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. |
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.
const size_t primes[] [static] |
{ 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().