29 #define DISABLE_DEBUGLOG
32 #include "gwenhywfar/debug.h"
33 #include "gwenhywfar/misc.h"
34 #include "gwenhywfar/text.h"
44 unsigned int origflags;
52 while (*path && isspace((
int)*path))
57 while (*path && (*path==
'/' || *path==
'\\')) {
75 while (*path && !(*path==
'/' || *path==
'\\'))
82 while (*path && (*path==
'/' || *path==
'\\'))
112 ((flags & GWEN_PATH_FLAGS_LAST) &&
167 if (elementFunction) {
193 unsigned int origflags;
201 while (*path && isspace((
int)*path))
206 while (*path && (*path==
'/' || *path==
'\\')) {
228 while (*path && !(*path==
'/' || *path==
'\\'))
247 if (sscanf(p,
"%d", &x)!=1) {
261 while (*path && (*path==
'/' || *path==
'\\'))
291 ((flags & GWEN_PATH_FLAGS_LAST) &&
346 if (elementFunction) {
370 unsigned int flags) {
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
void * GWEN_Path_AppendPathElement(const char *entry, void *data, unsigned int flags)
int GWEN_Text_EscapeToBufferTolerant(const char *src, GWEN_BUFFER *buf)
#define GWEN_PATH_FLAGS_INTERNAL
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)
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...)
#define GWEN_PATH_FLAGS_NO_IDX
void * GWEN_Path_HandleWithIdx(const char *path, void *data, uint32_t flags, GWEN_PATHIDXHANDLERPTR elementFunction)
void *(* GWEN_PATHIDXHANDLERPTR)(const char *entry, void *data, int idx, uint32_t flags)
void *(* GWEN_PATHHANDLERPTR)(const char *entry, void *data, uint32_t flags)
int GWEN_Buffer_AppendString(GWEN_BUFFER *bf, const char *buffer)