40#ifndef __httpServerLib_h
41#define __httpServerLib_h
43#include <TargConfig.h>
44#include <AllocatorIntf.h>
67#ifdef INL_baConvBin2Hex
69extern const char baBin2HexTable[];
73#define baConvBin2Hex(hexOutData, binIn) \
74 hexOutData[0] = baBin2HexTable[((U8)binIn) >> 4], \
75 hexOutData[1] = baBin2HexTable[((U8)binIn) & 0x0f]
79BA_API
void baConvBin2Hex(
void* hexOutData, U8 binIn);
84BA_API U8 baConvHex2Bin( U8 c );
85BA_API
void baConvU32ToHex(
void* to, U32 from);
86BA_API U32 baConvHexToU32(
const void* from);
99BA_API
const void*
baBSearch(
const void* key,
const void* base,
int num,
100 int size,
int (*cmp)(
const void*,
const void*));
110const char* baGetToken(
const char** str,
const char* set);
123 unsigned char* outStr,
int outStrSize,
const char* b64EncStr);
129BA_API
void baXmlUnescape(
char* f);
131#if defined(_WIN32) && !defined(NDEBUG)
134#define bIsspace(c) (c == ' ' || c == '\f' || c == '\n' || c == '\r' ||\
135 c == '\t' || c == '\v')
138#define httpEatWhiteSpace(ptr) while(bIsspace((U8)*ptr)) (ptr)++
139#define httpEatNonWhiteSpace(ptr) while(!bIsspace((U8)*ptr)) (ptr)++
140#define httpEatCharacters(ptr, delimiter) \
141 while(*ptr && *ptr != delimiter) (ptr)++
173BA_API U8 baDaysInMonth(U16 y, U16 m);
180BA_API
int baTime2tmEx(
const BaTimeEx* tex,
const BaBool local,
struct BaTm* tm);
188BA_API
int baTm2TimeEx(
struct BaTm* tm, BaBool local,
BaTimeEx* tex);
void * baRealloc(void *p, size_t size)
Returns pointer to newly-allocated space for an object of size "size", initialized,...
void * baMalloc(size_t size)
Returns pointer to uninitialized newly-allocated space for an object of size "size",...
void baFree(void *p)
Deallocates space to which it points.
BA_API int baElideDotDot(char *str)
Fix a path with ../ in it.
S64 BaTime
An arithmetic type representing calendar time with epoch of 1970-01-01 00:00:10 GMT – i....
Definition: GenPrimT.h:93
BA_API BaTime baParseDate(const char *str)
Parses the date string 'str' and returns the time with epoch of 1970-01-01 00:00:10 GMT.
BA_API int baB64Decode(unsigned char *outStr, int outStrSize, const char *b64EncStr)
Decodes a B64 encoded string.
BA_API char * baStrdup(const char *str)
Calls baMalloc to allocate storage space for a copy of str and then copies src to the allocated space...
BA_API int baISO8601ToTime(const char *str, size_t len, BaTimeEx *tex)
Parse ISO860 time.
BA_API BaTime baTm2Time(struct BaTm *tmP)
Convert a BaTm structure to BaTime.
BA_API int baStrCaseCmp(const char *a, const char *b)
Compare two strings, ignoring case.
BA_API const void * baBSearch(const void *key, const void *base, int num, int size, int(*cmp)(const void *, const void *))
Returns a pointer to an occurrence of key in the array pointed to by base.
BA_API int baTime2ISO8601(const BaTimeEx *tex, char *str, size_t len)
Return ISO860 encoded string.
BA_API int baStrnCaseCmp(const char *a, const char *b, size_t len)
Compare two strings with max length 'len', ignoring case.
BA_API int baTime2tm(struct BaTm *tmP, BaTime t)
Convert BaTime to a BaTm structure.
Extended BaTime with nano-seconds and timezone offset in minutes.
Definition: GenPrimT.h:98
Represents the components of calendar time.
Definition: BaServerLib.h:149
int tm_yday
days since January 1
Definition: BaServerLib.h:165
int tm_wday
days since Sunday [0,6]
Definition: BaServerLib.h:163
int tm_mon
months since January [0,11]
Definition: BaServerLib.h:159
int tm_sec
seconds after the minute [0,59]
Definition: BaServerLib.h:151
int tm_year
Years since 0000 (baTime2tmEx) or since 1900 (baTime2tm)
Definition: BaServerLib.h:161
int offset
Time zone offset in minutes.
Definition: BaServerLib.h:170
int tm_hour
hours since midnight [0,23]
Definition: BaServerLib.h:155
int tm_min
minutes after the hour [0,59]
Definition: BaServerLib.h:153
int tm_mday
day of the month [0,31]
Definition: BaServerLib.h:157
int nsec
Nano seconds.
Definition: BaServerLib.h:168