libgpac
Documentation of the core library of GPAC
odf_parse_common.h File Reference
#include <gpac/setup.h>
+ Include dependency graph for odf_parse_common.h:
+ This graph shows which files directly or indirectly include this file:

Macros

#define GET_U8(field)   { u32 d; if (strstr(val, "0x")) { ret += sscanf(val, "%x", &d); if (ret) field = (u8) d; } else { ret += sscanf(val, "%u", &d); if (ret) field = (u8) d; } }
 
#define GET_U16(field)   { u16 d; if (strstr(val, "0x")) { ret += sscanf(val, "%hx", &d); if (ret) field = d; } else { ret += sscanf(val, "%hu", &d); if (ret) field = d; } }
 
#define GET_S16(field)   { s16 d; if (strstr(val, "0x")) { ret += sscanf(val, "%hx", (u16*)&d); if (ret) field = d; } else { ret += sscanf(val, "%hd", &d); if (ret) field = d; } }
 
#define GET_U32(field)   { u32 d; if (strstr(val, "0x")) { ret += sscanf(val, "%x", &d); if (ret) field = d; } else { ret += sscanf(val, "%ud", &d); if (ret) field = d; } }
 
#define GET_S32(field)   { s32 d; if (strstr(val, "0x")) { ret += sscanf(val, "%x", (u32*)&d); if (ret) field = d; } else { ret += sscanf(val, "%d", &d); if (ret) field = d; } }
 
#define GET_BOOL(field)   { ret = 1; field = (!stricmp(val, "true") || !strcmp(val, "1")) ? GF_TRUE : GF_FALSE; }
 
#define GET_U64(field)   { u64 d; if (strstr(val, "0x")) { ret += sscanf(val, LLX, &d); if (ret) field = d; } else { ret += sscanf(val, LLU, &d); if (ret) field = d; } }
 
#define GET_DOUBLE(field)   { Float v; ret = 1; sscanf(val, "%f", &v); field = (Double) v;}
 
#define GET_STRING(field)
 

Macro Definition Documentation

◆ GET_U8

#define GET_U8 (   field)    { u32 d; if (strstr(val, "0x")) { ret += sscanf(val, "%x", &d); if (ret) field = (u8) d; } else { ret += sscanf(val, "%u", &d); if (ret) field = (u8) d; } }

◆ GET_U16

#define GET_U16 (   field)    { u16 d; if (strstr(val, "0x")) { ret += sscanf(val, "%hx", &d); if (ret) field = d; } else { ret += sscanf(val, "%hu", &d); if (ret) field = d; } }

◆ GET_S16

#define GET_S16 (   field)    { s16 d; if (strstr(val, "0x")) { ret += sscanf(val, "%hx", (u16*)&d); if (ret) field = d; } else { ret += sscanf(val, "%hd", &d); if (ret) field = d; } }

◆ GET_U32

#define GET_U32 (   field)    { u32 d; if (strstr(val, "0x")) { ret += sscanf(val, "%x", &d); if (ret) field = d; } else { ret += sscanf(val, "%ud", &d); if (ret) field = d; } }

◆ GET_S32

#define GET_S32 (   field)    { s32 d; if (strstr(val, "0x")) { ret += sscanf(val, "%x", (u32*)&d); if (ret) field = d; } else { ret += sscanf(val, "%d", &d); if (ret) field = d; } }

◆ GET_BOOL

#define GET_BOOL (   field)    { ret = 1; field = (!stricmp(val, "true") || !strcmp(val, "1")) ? GF_TRUE : GF_FALSE; }

◆ GET_U64

#define GET_U64 (   field)    { u64 d; if (strstr(val, "0x")) { ret += sscanf(val, LLX, &d); if (ret) field = d; } else { ret += sscanf(val, LLU, &d); if (ret) field = d; } }

◆ GET_DOUBLE

#define GET_DOUBLE (   field)    { Float v; ret = 1; sscanf(val, "%f", &v); field = (Double) v;}

◆ GET_STRING

#define GET_STRING (   field)
Value:
{ \
ret = 1;\
(field) = gf_strdup(val); \
if (field) { \
if (val[0] == '"') strcpy((field), val+1); \
if ((field)[strlen(field)-1] == '"') (field)[strlen(field)-1] = 0;\
}\
}
char * gf_strdup(const char *str)
Definition: alloc.c:168