gwenhywfar 5.10.2
path.h
Go to the documentation of this file.
1/***************************************************************************
2 begin : Tue Sep 09 2003
3 copyright : (C) 2003-2010 by Martin Preuss
4 email : martin@libchipcard.de
5
6 ***************************************************************************
7 * *
8 * This library is free software; you can redistribute it and/or *
9 * modify it under the terms of the GNU Lesser General Public *
10 * License as published by the Free Software Foundation; either *
11 * version 2.1 of the License, or (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16 * Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public *
19 * License along with this library; if not, write to the Free Software *
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
21 * MA 02111-1307 USA *
22 * *
23 ***************************************************************************/
24
25
26#ifndef GWENHYWFAR_PATH_H
27#define GWENHYWFAR_PATH_H
28
30#include <gwenhywfar/types.h>
31#include <gwenhywfar/buffer.h>
32
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
55
66#define GWEN_PATH_FLAGS_PATHMUSTEXIST 0x00000001
70#define GWEN_PATH_FLAGS_PATHMUSTNOTEXIST 0x00000002
71
78#define GWEN_PATH_FLAGS_PATHCREATE 0x00000004
79
84#define GWEN_PATH_FLAGS_NAMEMUSTEXIST 0x00000008
85
89#define GWEN_PATH_FLAGS_NAMEMUSTNOTEXIST 0x00000010
90
96#define GWEN_PATH_FLAGS_CREATE_GROUP 0x00000020
97
103#define GWEN_PATH_FLAGS_CREATE_VAR 0x00000040
104
111#define GWEN_PATH_FLAGS_VARIABLE 0x00000080
112
113
121#define GWEN_PATH_FLAGS_ESCAPE 0x00000100
122
124#define GWEN_PATH_FLAGS_UNESCAPE 0x00000100
125
126/* be more tolerant, don't escape common characters such as '.' */
127#define GWEN_PATH_FLAGS_TOLERANT_ESCAPE 0x00000200
128
133#define GWEN_PATH_FLAGS_CONVERT_LAST 0x00000400
134
142#define GWEN_PATH_FLAGS_CHECKROOT 0x00000800
143
148#define GWEN_PATH_FLAGS_NO_IDX 0x00001000
149
153#define GWEN_PATH_FLAGS_RFU1 0x00002000
154
155
159#define GWEN_PATH_FLAGS_INTERNAL 0x0000c000
160
166#define GWEN_PATH_FLAGS_LAST 0x00004000
167
174#define GWEN_PATH_FLAGS_ROOT 0x00008000
175
180typedef void *(*GWEN_PATHHANDLERPTR)(const char *entry,
181 void *data,
182 uint32_t flags);
183
184typedef void *(*GWEN_PATHIDXHANDLERPTR)(const char *entry,
185 void *data,
186 int idx,
187 uint32_t flags);
188
189
203void *GWEN_Path_Handle(const char *path,
204 void *data,
205 uint32_t flags,
206 GWEN_PATHHANDLERPTR elementFunction);
207
209void *GWEN_Path_HandleWithIdx(const char *path,
210 void *data,
211 uint32_t flags,
212 GWEN_PATHIDXHANDLERPTR elementFunction);
213
214
222int GWEN_Path_Convert(const char *path,
223 GWEN_BUFFER *buffer,
224 uint32_t flags);
225
226
228int GWEN_Path_GetPathBetween(const char *path1, const char *path2, GWEN_BUFFER *diffBuf);
229 /* defgroup */
231
232
233#ifdef __cplusplus
234}
235#endif
236
237
238#endif /* GWENHYWFAR_PATH_H */
239
struct GWEN_BUFFER GWEN_BUFFER
A dynamically resizeable text buffer.
Definition: buffer.h:38
#define GWENHYWFAR_API
Definition: gwenhywfarapi.h:67
GWENHYWFAR_API int GWEN_Path_Convert(const char *path, GWEN_BUFFER *buffer, uint32_t flags)
GWENHYWFAR_API int GWEN_Path_GetPathBetween(const char *path1, const char *path2, GWEN_BUFFER *diffBuf)
void *(* GWEN_PATHHANDLERPTR)(const char *entry, void *data, uint32_t flags)
Definition: path.h:180
GWENHYWFAR_API void * GWEN_Path_HandleWithIdx(const char *path, void *data, uint32_t flags, GWEN_PATHIDXHANDLERPTR elementFunction)
GWENHYWFAR_API void * GWEN_Path_Handle(const char *path, void *data, uint32_t flags, GWEN_PATHHANDLERPTR elementFunction)
void *(* GWEN_PATHIDXHANDLERPTR)(const char *entry, void *data, int idx, uint32_t flags)
Definition: path.h:184