gwenhywfar 4.0.3

path.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  begin       : Tue Sep 09 2003
00003  copyright   : (C) 2003-2010 by Martin Preuss
00004  email       : martin@libchipcard.de
00005 
00006  ***************************************************************************
00007  *                                                                         *
00008  *   This library is free software; you can redistribute it and/or         *
00009  *   modify it under the terms of the GNU Lesser General Public            *
00010  *   License as published by the Free Software Foundation; either          *
00011  *   version 2.1 of the License, or (at your option) any later version.    *
00012  *                                                                         *
00013  *   This library is distributed in the hope that it will be useful,       *
00014  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00015  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00016  *   Lesser General Public License for more details.                       *
00017  *                                                                         *
00018  *   You should have received a copy of the GNU Lesser General Public      *
00019  *   License along with this library; if not, write to the Free Software   *
00020  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston,                 *
00021  *   MA  02111-1307  USA                                                   *
00022  *                                                                         *
00023  ***************************************************************************/
00024 
00025 
00026 #ifndef GWENHYWFAR_PATH_H
00027 #define GWENHYWFAR_PATH_H
00028 
00029 #include <gwenhywfar/gwenhywfarapi.h>
00030 #include <gwenhywfar/types.h>
00031 #include <gwenhywfar/buffer.h>
00032 
00033 
00034 #ifdef __cplusplus
00035 extern "C" {
00036 #endif
00037 
00055 
00066 #define GWEN_PATH_FLAGS_PATHMUSTEXIST          0x00000001
00067 
00070 #define GWEN_PATH_FLAGS_PATHMUSTNOTEXIST       0x00000002
00071 
00078 #define GWEN_PATH_FLAGS_PATHCREATE             0x00000004
00079 
00084 #define GWEN_PATH_FLAGS_NAMEMUSTEXIST          0x00000008
00085 
00089 #define GWEN_PATH_FLAGS_NAMEMUSTNOTEXIST       0x00000010
00090 
00096 #define GWEN_PATH_FLAGS_CREATE_GROUP            0x00000020
00097 
00103 #define GWEN_PATH_FLAGS_CREATE_VAR              0x00000040
00104 
00111 #define GWEN_PATH_FLAGS_VARIABLE                0x00000080
00112 
00113 
00121 #define GWEN_PATH_FLAGS_ESCAPE                  0x00000100
00122 
00124 #define GWEN_PATH_FLAGS_UNESCAPE                0x00000100
00125 
00126 /* be more tolerant, don't escape common characters such as '.' */
00127 #define GWEN_PATH_FLAGS_TOLERANT_ESCAPE         0x00000200
00128 
00133 #define GWEN_PATH_FLAGS_CONVERT_LAST            0x00000400
00134 
00142 #define GWEN_PATH_FLAGS_CHECKROOT               0x00000800
00143 
00148 #define GWEN_PATH_FLAGS_NO_IDX                  0x00001000
00149 
00153 #define GWEN_PATH_FLAGS_RFU1                    0x00002000
00154 
00155 
00159 #define GWEN_PATH_FLAGS_INTERNAL                0x0000c000
00160 
00166 #define GWEN_PATH_FLAGS_LAST                    0x00004000
00167 
00174 #define GWEN_PATH_FLAGS_ROOT                    0x00008000
00175 
00180 typedef void* (*GWEN_PATHHANDLERPTR)(const char *entry,
00181                                      void *data,
00182                                      uint32_t flags);
00183 
00184 typedef void* (*GWEN_PATHIDXHANDLERPTR)(const char *entry,
00185                                         void *data,
00186                                         int idx,
00187                                         uint32_t flags);
00188 
00189 
00202 GWENHYWFAR_API
00203   void *GWEN_Path_Handle(const char *path,
00204                          void *data,
00205                          uint32_t flags,
00206                          GWEN_PATHHANDLERPTR elementFunction);
00207 
00208 GWENHYWFAR_API
00209   void *GWEN_Path_HandleWithIdx(const char *path,
00210                                 void *data,
00211                                 uint32_t flags,
00212                                 GWEN_PATHIDXHANDLERPTR elementFunction);
00213 
00214 
00221 GWENHYWFAR_API
00222   int GWEN_Path_Convert(const char *path,
00223                         GWEN_BUFFER *buffer,
00224                         uint32_t flags);
00225 
00226  /* defgroup */
00228 
00229 
00230 #ifdef __cplusplus
00231 }
00232 #endif
00233 
00234 
00235 #endif /* GWENHYWFAR_PATH_H */
00236