stringlist.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  $RCSfile$
00003  -------------------
00004  cvs         : $Id: stringlist.h 1030 2006-04-07 09:53:56Z martin $
00005  begin       : Thu Apr 03 2003
00006  copyright   : (C) 2003 by Martin Preuss
00007  email       : martin@libchipcard.de
00008 
00009  ***************************************************************************
00010  *                                                                         *
00011  *   This library is free software; you can redistribute it and/or         *
00012  *   modify it under the terms of the GNU Lesser General Public            *
00013  *   License as published by the Free Software Foundation; either          *
00014  *   version 2.1 of the License, or (at your option) any later version.    *
00015  *                                                                         *
00016  *   This library is distributed in the hope that it will be useful,       *
00017  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00018  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00019  *   Lesser General Public License for more details.                       *
00020  *                                                                         *
00021  *   You should have received a copy of the GNU Lesser General Public      *
00022  *   License along with this library; if not, write to the Free Software   *
00023  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston,                 *
00024  *   MA  02111-1307  USA                                                   *
00025  *                                                                         *
00026  ***************************************************************************/
00027 
00028 #ifndef GWENHYWFAR_STRINGLIST_H
00029 #define GWENHYWFAR_STRINGLIST_H
00030 
00031 #include <gwenhywfar/gwenhywfarapi.h>
00032 
00033 
00034 #ifdef __cplusplus
00035 extern "C" {
00036 #endif
00037 
00038 
00039 typedef enum {
00041   GWEN_StringList_SortModeNoCase=0,
00043   GWEN_StringList_SortModeCase,
00046   GWEN_StringList_SortModeInt
00047 } GWEN_STRINGLIST_SORT_MODE;
00048 
00049 
00050 typedef struct GWEN_STRINGLISTENTRYSTRUCT GWEN_STRINGLISTENTRY;
00051 
00052 
00053 typedef struct GWEN_STRINGLISTSTRUCT GWEN_STRINGLIST;
00054 
00055 
00056 GWENHYWFAR_API GWEN_STRINGLIST *GWEN_StringList_new();
00057 GWENHYWFAR_API void GWEN_StringList_free(GWEN_STRINGLIST *sl);
00058 GWENHYWFAR_API
00059   GWEN_STRINGLIST *GWEN_StringList_dup(const GWEN_STRINGLIST *sl);
00060 GWENHYWFAR_API void GWEN_StringList_Clear(GWEN_STRINGLIST *sl);
00061 
00063 GWENHYWFAR_API
00064   unsigned int GWEN_StringList_Count(const GWEN_STRINGLIST *sl);
00065 
00066 GWENHYWFAR_API GWEN_STRINGLISTENTRY *GWEN_StringListEntry_new(const char *s,
00067                                                               int take);
00068 GWENHYWFAR_API void GWEN_StringListEntry_ReplaceString(GWEN_STRINGLISTENTRY *e,
00069                                                        const char *s,
00070                                                        int take);
00071 GWENHYWFAR_API void GWEN_StringListEntry_free(GWEN_STRINGLISTENTRY *sl);
00072 GWENHYWFAR_API void GWEN_StringList_AppendEntry(GWEN_STRINGLIST *sl,
00073                                                 GWEN_STRINGLISTENTRY *se);
00074 GWENHYWFAR_API void GWEN_StringList_RemoveEntry(GWEN_STRINGLIST *sl,
00075                                                 GWEN_STRINGLISTENTRY *se);
00076 GWENHYWFAR_API
00077   GWEN_STRINGLISTENTRY *GWEN_StringList_FirstEntry(const GWEN_STRINGLIST *sl);
00078 GWENHYWFAR_API
00079   GWEN_STRINGLISTENTRY *GWEN_StringListEntry_Next(const GWEN_STRINGLISTENTRY *se);
00080 
00081 GWENHYWFAR_API
00082   const char *GWEN_StringListEntry_Data(const GWEN_STRINGLISTENTRY *se);
00083 
00084 GWENHYWFAR_API
00085   void GWEN_StringListEntry_SetData(GWEN_STRINGLISTENTRY *se,
00086                                     const char *s);
00087 
00094 GWENHYWFAR_API
00095 void GWEN_StringList_SetSenseCase(GWEN_STRINGLIST *sl, int i);
00096 
00104 GWENHYWFAR_API
00105 void GWEN_StringList_SetIgnoreRefCount(GWEN_STRINGLIST *sl, int i);
00106 
00114 GWENHYWFAR_API int GWEN_StringList_AppendString(GWEN_STRINGLIST *sl,
00115                                                 const char *s,
00116                                                 int take,
00117                                                 int checkDouble);
00118 
00126 GWENHYWFAR_API int GWEN_StringList_InsertString(GWEN_STRINGLIST *sl,
00127                                                 const char *s,
00128                                                 int take,
00129                                                 int checkDouble);
00130 
00135 GWENHYWFAR_API int GWEN_StringList_RemoveString(GWEN_STRINGLIST *sl,
00136                                                 const char *s);
00137 
00143 GWENHYWFAR_API int GWEN_StringList_HasString(const GWEN_STRINGLIST *sl,
00144                                              const char *s);
00145 
00146 
00158 GWENHYWFAR_API
00159 void *GWEN_StringList_ForEach(const GWEN_STRINGLIST *l, 
00160                               void *(*func)(const char *s, void *u), 
00161                               void *user_data);
00162 
00164 GWENHYWFAR_API
00165 const char *GWEN_StringList_FirstString(const GWEN_STRINGLIST *l);
00166 
00167 GWENHYWFAR_API
00168 const char *GWEN_StringList_StringAt(const GWEN_STRINGLIST *l, int idx);
00169 
00170 
00182 GWENHYWFAR_API
00183 void GWEN_StringList_Sort(GWEN_STRINGLIST *l,
00184                           int ascending,
00185                           GWEN_STRINGLIST_SORT_MODE sortMode);
00186 
00187 #ifdef __cplusplus
00188 }
00189 #endif
00190 
00191 #endif
00192 
00193 

Generated on Tue May 1 12:56:30 2007 for gwenhywfar by  doxygen 1.5.1