stringlist2.c File Reference

#include <gwenhywfar/gwenhywfarapi.h>
#include <gwenhywfar/misc.h>
#include "stringlist2_p.h"
#include "debug.h"
#include <stdlib.h>
#include <assert.h>
#include <string.h>
Include dependency graph for stringlist2.c:

Go to the source code of this file.

Functions

GWEN_STRINGLIST2_ITERATORGWEN_StringList2__GetString (const GWEN_STRINGLIST2 *sl2, const char *s)
int GWEN_StringList2_AppendString (GWEN_STRINGLIST2 *sl2, const char *s, int take, GWEN_STRINGLIST2_INSERTMODE m)
void GWEN_StringList2_Dump (const GWEN_STRINGLIST2 *sl2)
GWEN_STRINGLIST2GWEN_StringList2_dup (GWEN_STRINGLIST2 *sl2)
GWEN_STRINGLIST2_ITERATORGWEN_StringList2_First (const GWEN_STRINGLIST2 *l)
void GWEN_StringList2_free (GWEN_STRINGLIST2 *sl2)
int GWEN_StringList2_HasString (const GWEN_STRINGLIST2 *sl2, const char *s)
int GWEN_StringList2_InsertString (GWEN_STRINGLIST2 *sl2, const char *s, int take, GWEN_STRINGLIST2_INSERTMODE m)
GWEN_STRINGLIST2_ITERATORGWEN_StringList2_Last (const GWEN_STRINGLIST2 *l)
GWEN_STRINGLIST2GWEN_StringList2_new ()
int GWEN_StringList2_RemoveString (GWEN_STRINGLIST2 *sl2, const char *s)
void GWEN_StringList2_SetSenseCase (GWEN_STRINGLIST2 *sl2, int i)
const char * GWEN_StringList2Iterator_Data (GWEN_STRINGLIST2_ITERATOR *li)
GWEN_REFPTRGWEN_StringList2Iterator_DataRefPtr (GWEN_STRINGLIST2_ITERATOR *li)
void GWEN_StringList2Iterator_free (GWEN_STRINGLIST2_ITERATOR *li)
unsigned int GWEN_StringList2Iterator_GetLinkCount (const GWEN_STRINGLIST2_ITERATOR *li)
const char * GWEN_StringList2Iterator_Next (GWEN_STRINGLIST2_ITERATOR *li)
const char * GWEN_StringList2Iterator_Previous (GWEN_STRINGLIST2_ITERATOR *li)

Function Documentation

GWEN_STRINGLIST2_ITERATOR* GWEN_StringList2__GetString ( const GWEN_STRINGLIST2 sl2,
const char *  s 
)

Definition at line 232 of file stringlist2.c.

References GWEN_ListIterator_DataRefPtr(), GWEN_ListIterator_NextRefPtr(), GWEN_RefPtr_GetData(), GWEN_StringList2_First(), and GWEN_StringList2Iterator_free().

Referenced by GWEN_StringList2_AppendString(), GWEN_StringList2_InsertString(), and GWEN_StringList2_RemoveString().

Here is the call graph for this function:

Here is the caller graph for this function:

int GWEN_StringList2_AppendString ( GWEN_STRINGLIST2 sl2,
const char *  s,
int  take,
GWEN_STRINGLIST2_INSERTMODE  m 
)

Appends a string.

Returns:
0 if not appended, !=0 if appended
Parameters:
take if true then the StringList takes over ownership of the string
checkDouble if true the the string will only be appended if it does not already exist

Definition at line 90 of file stringlist2.c.

References GWEN_List_GetRefPtrInfo(), GWEN_List_PushBackRefPtr(), GWEN_ListIterator_IncLinkCount(), GWEN_RefPtr_AddFlags(), GWEN_REFPTR_FLAGS_AUTODELETE, GWEN_RefPtr_new(), GWEN_StringList2__GetString(), GWEN_StringList2_IntertMode_AlwaysAdd, GWEN_StringList2_IntertMode_NoDouble, GWEN_StringList2_IntertMode_Reuse, and GWEN_StringList2Iterator_free().

Referenced by GWEN_XML_AddNameSpace().

Here is the call graph for this function:

Here is the caller graph for this function:

void GWEN_StringList2_Dump ( const GWEN_STRINGLIST2 sl2  ) 
GWEN_STRINGLIST2* GWEN_StringList2_dup ( GWEN_STRINGLIST2 sl2  ) 

Definition at line 71 of file stringlist2.c.

References GWEN_List_dup(), and GWEN_NEW_OBJECT.

Here is the call graph for this function:

GWEN_STRINGLIST2_ITERATOR* GWEN_StringList2_First ( const GWEN_STRINGLIST2 l  ) 

Definition at line 283 of file stringlist2.c.

References GWEN_List_First().

Referenced by GWEN_StringList2__GetString(), GWEN_StringList2_Dump(), GWEN_StringList2_HasString(), GWEN_XML_FindNameSpace(), GWEN_XML_FindNameSpaceByName(), and GWEN_XML_FindNameSpaceByPrefix().

Here is the call graph for this function:

Here is the caller graph for this function:

void GWEN_StringList2_free ( GWEN_STRINGLIST2 sl2  ) 

Definition at line 62 of file stringlist2.c.

References GWEN_FREE_OBJECT, and GWEN_List_free().

Referenced by GWEN_XMLNode_NormalizeNameSpaces().

Here is the call graph for this function:

Here is the caller graph for this function:

int GWEN_StringList2_HasString ( const GWEN_STRINGLIST2 sl2,
const char *  s 
)

Checks whether the given string already exists within in the string list.

Returns:
!=0 if found, 0 otherwise

Definition at line 194 of file stringlist2.c.

References GWEN_StringList2_First(), GWEN_StringList2Iterator_Data(), GWEN_StringList2Iterator_free(), and GWEN_StringList2Iterator_Next().

Here is the call graph for this function:

int GWEN_StringList2_InsertString ( GWEN_STRINGLIST2 sl2,
const char *  s,
int  take,
GWEN_STRINGLIST2_INSERTMODE  m 
)

Inserts a string.

Returns:
0 if not inserted, !=0 if inserted
Parameters:
take if true then the StringList takes over ownership of the string
checkDouble if true the the string will only be appended if it does not already exist

Definition at line 132 of file stringlist2.c.

References GWEN_List_GetRefPtrInfo(), GWEN_List_PushFrontRefPtr(), GWEN_ListIterator_IncLinkCount(), GWEN_RefPtr_AddFlags(), GWEN_REFPTR_FLAGS_AUTODELETE, GWEN_RefPtr_new(), GWEN_StringList2__GetString(), GWEN_StringList2_IntertMode_AlwaysAdd, GWEN_StringList2_IntertMode_NoDouble, GWEN_StringList2_IntertMode_Reuse, and GWEN_StringList2Iterator_free().

Here is the call graph for this function:

GWEN_STRINGLIST2_ITERATOR* GWEN_StringList2_Last ( const GWEN_STRINGLIST2 l  ) 

Definition at line 290 of file stringlist2.c.

References GWEN_List_Last().

Here is the call graph for this function:

GWEN_STRINGLIST2* GWEN_StringList2_new (  ) 

Definition at line 45 of file stringlist2.c.

References GWEN_List_new(), GWEN_List_SetRefPtrInfo(), GWEN_NEW_OBJECT, GWEN_RefPtrInfo_free(), GWEN_RefPtrInfo_new(), and GWEN_RefPtrInfo_SetFreeFn().

Referenced by GWEN_XMLNode_NormalizeNameSpaces().

Here is the call graph for this function:

Here is the caller graph for this function:

int GWEN_StringList2_RemoveString ( GWEN_STRINGLIST2 sl2,
const char *  s 
)

Removes a given string from the stringlist.

Returns:
0 if not found, !=0 if found and removed

Definition at line 174 of file stringlist2.c.

References GWEN_List_Erase(), GWEN_ListIterator_GetLinkCount(), GWEN_StringList2__GetString(), and GWEN_StringList2Iterator_free().

Here is the call graph for this function:

void GWEN_StringList2_SetSenseCase ( GWEN_STRINGLIST2 sl2,
int  i 
)

Normally this group of functions ignores cases when comparing two strings. You can change this behaviour here.

Parameters:
sl2 string list
i if 0 then cases are ignored

Definition at line 83 of file stringlist2.c.

const char* GWEN_StringList2Iterator_Data ( GWEN_STRINGLIST2_ITERATOR li  ) 

Definition at line 315 of file stringlist2.c.

References GWEN_ListIterator_Data().

Referenced by GWEN_StringList2_Dump(), GWEN_StringList2_HasString(), GWEN_XML_FindNameSpace(), GWEN_XML_FindNameSpaceByName(), and GWEN_XML_FindNameSpaceByPrefix().

Here is the call graph for this function:

Here is the caller graph for this function:

GWEN_REFPTR* GWEN_StringList2Iterator_DataRefPtr ( GWEN_STRINGLIST2_ITERATOR li  ) 

Definition at line 323 of file stringlist2.c.

References GWEN_ListIterator_DataRefPtr().

Here is the call graph for this function:

void GWEN_StringList2Iterator_free ( GWEN_STRINGLIST2_ITERATOR li  ) 
unsigned int GWEN_StringList2Iterator_GetLinkCount ( const GWEN_STRINGLIST2_ITERATOR li  ) 

Definition at line 331 of file stringlist2.c.

References GWEN_ListIterator_GetLinkCount().

Referenced by GWEN_StringList2_Dump().

Here is the call graph for this function:

Here is the caller graph for this function:

const char* GWEN_StringList2Iterator_Next ( GWEN_STRINGLIST2_ITERATOR li  ) 

Definition at line 309 of file stringlist2.c.

References GWEN_ListIterator_Next().

Referenced by GWEN_StringList2_Dump(), GWEN_StringList2_HasString(), GWEN_XML_FindNameSpace(), GWEN_XML_FindNameSpaceByName(), and GWEN_XML_FindNameSpaceByPrefix().

Here is the call graph for this function:

Here is the caller graph for this function:

const char* GWEN_StringList2Iterator_Previous ( GWEN_STRINGLIST2_ITERATOR li  ) 

Definition at line 303 of file stringlist2.c.

References GWEN_ListIterator_Previous().

Here is the call graph for this function:

Generated on Mon Jul 5 22:55:52 2010 for gwenhywfar by  doxygen 1.6.3