Barracuda Application Server C/C++ Reference
NO
Miscellaneous library functions

Detailed Description

This header file contains functions that are used by the web-server.

The functions might also be useful for the code you design. Some of the functions are replacements for functions in the C Standard Library.

See also
Barracuda Introduction

Classes

struct  BaTm
 Represents the components of calendar time. More...
 
struct  BaTimeEx
 Extended BaTime with nano-seconds and timezone offset in minutes. More...
 

Typedefs

typedef S64 BaTime
 An arithmetic type representing calendar time with epoch of 1970-01-01 00:00:10 GMT – i.e. More...
 

Functions

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 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. More...
 
BA_API int baStrCaseCmp (const char *a, const char *b)
 Compare two strings, ignoring case.
 
BA_API int baStrnCaseCmp (const char *a, const char *b, size_t len)
 Compare two strings with max length 'len', ignoring case.
 
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. More...
 
BA_API int baB64Decode (unsigned char *outStr, int outStrSize, const char *b64EncStr)
 Decodes a B64 encoded string. More...
 
BA_API int baElideDotDot (char *str)
 Fix a path with ../ in it.
 
BA_API int baTime2tm (struct BaTm *tmP, BaTime t)
 Convert BaTime to a BaTm structure. More...
 
BA_API BaTime baTm2Time (struct BaTm *tmP)
 Convert a BaTm structure to BaTime. More...
 
BA_API int baISO8601ToTime (const char *str, size_t len, BaTimeEx *tex)
 Parse ISO860 time.
 
BA_API int baTime2ISO8601 (const BaTimeEx *tex, char *str, size_t len)
 Return ISO860 encoded string.
 

Typedef Documentation

◆ BaTime

typedef S64 BaTime

An arithmetic type representing calendar time with epoch of 1970-01-01 00:00:10 GMT – i.e.

+/- number of seconds since the epoch of 1970-01-01

See also
baTime2tm
baTm2Time

Function Documentation

◆ baB64Decode()

BA_API int baB64Decode ( unsigned char *  outStr,
int  outStrSize,
const char *  b64EncStr 
)

Decodes a B64 encoded string.

outStr and b64EncStr can be the same.

◆ baBSearch()

BA_API const void * baBSearch ( const void *  key,
const void *  base,
int  num,
int  size,
int(*)(const void *, const void *)  cmp 
)

Returns a pointer to an occurrence of key in the array pointed to by base.

If key is not found, the function returns NULL. If the array is not in ascending sort order or contains duplicate records with identical keys, the result is unpredictable.

◆ baParseDate()

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.

See also
BaTime

◆ baTime2tm()

BA_API int baTime2tm ( struct BaTm tmP,
BaTime  t 
)

Convert BaTime to a BaTm structure.

See also
BaTm
BaTime

◆ baTm2Time()

BA_API BaTime baTm2Time ( struct BaTm tmP)

Convert a BaTm structure to BaTime.

See also
BaTm
BaTime