29 #define DISABLE_DEBUGLOG 32 #include "gwenhywfar/debug.h" 33 #include "gwenhywfar/misc.h" 34 #include "gwenhywfar/text.h" 62 unsigned int origflags;
70 while (*path && isspace((
int)*path))
75 while (*path && (*path==
'/' || *path==
'\\')) {
93 while (*path && !(*path==
'/' || *path==
'\\'))
100 while (*path && (*path==
'/' || *path==
'\\'))
185 if (elementFunction) {
212 unsigned int origflags;
220 while (*path && isspace((
int)*path))
225 while (*path && (*path==
'/' || *path==
'\\')) {
246 while (*path && !(*path==
'/' || *path==
'\\'))
267 if (sscanf(p,
"%d", &x)!=1) {
281 while (*path && (*path==
'/' || *path==
'\\'))
366 if (elementFunction) {
void * GWEN_Path_Handle(const char *path, void *data, uint32_t flags, GWEN_PATHHANDLERPTR elementFunction)
#define GWEN_PATH_FLAGS_ESCAPE
char * GWEN_Buffer_GetStart(const GWEN_BUFFER *bf)
int GWEN_Buffer_AllocRoom(GWEN_BUFFER *bf, uint32_t size)
#define GWEN_PATH_FLAGS_CONVERT_LAST
void GWEN_Buffer_SetStep(GWEN_BUFFER *bf, uint32_t step)
#define GWEN_PATH_FLAGS_TOLERANT_ESCAPE
int GWEN_Text_EscapeToBufferTolerant(const char *src, GWEN_BUFFER *buf)
#define GWEN_PATH_FLAGS_INTERNAL
void *(* GWEN_PATHIDXHANDLERPTR)(const char *entry, void *data, int idx, uint32_t flags)
int GWEN_Path_Convert(const char *path, GWEN_BUFFER *buffer, uint32_t flags)
GWEN_BUFFER * GWEN_Buffer_new(char *buffer, uint32_t size, uint32_t used, int take)
int GWEN_Text_UnescapeToBufferTolerant(const char *src, GWEN_BUFFER *buf)
char * GWEN_Buffer_GetPosPointer(const GWEN_BUFFER *bf)
void GWEN_Buffer_Reset(GWEN_BUFFER *bf)
#define GWEN_PATH_FLAGS_LAST
#define GWEN_PATH_FLAGS_ROOT
#define DBG_DEBUG(dbg_logger, format, args...)
#define GWEN_PATH_FLAGS_UNESCAPE
#define GWEN_PATH_FLAGS_VARIABLE
int GWEN_Text_EscapeToBuffer(const char *src, GWEN_BUFFER *buf)
void *(* GWEN_PATHHANDLERPTR)(const char *entry, void *data, uint32_t flags)
int GWEN_Buffer_AppendByte(GWEN_BUFFER *bf, char c)
void GWEN_Buffer_free(GWEN_BUFFER *bf)
struct GWEN_BUFFER GWEN_BUFFER
A dynamically resizeable text buffer.
int GWEN_Text_UnescapeToBuffer(const char *src, GWEN_BUFFER *buf)
#define GWEN_PATH_FLAGS_CHECKROOT
#define DBG_ERROR(dbg_logger, format, args...)
static void * GWEN_Path_AppendPathElement(const char *entry, void *data, unsigned int flags)
#define GWEN_PATH_FLAGS_NO_IDX
void * GWEN_Path_HandleWithIdx(const char *path, void *data, uint32_t flags, GWEN_PATHIDXHANDLERPTR elementFunction)
int GWEN_Buffer_AppendString(GWEN_BUFFER *bf, const char *buffer)