Next: , Previous: , Up: C API   [Contents][Index]


5.25 libglb

5.25.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/glb/index.html.

5.25.2 API

Function: char * lw6glb_base64_encode_bin (lw6sys_context_t * sys_context, const char * buf, int size)

sys_context: global system context

buf: the data to encode

size: the size of data to encode

Encodes data into base64. Memory allocation is done automatically.

Return value: newly allocated string.

Function: char * lw6glb_base64_decode_bin (lw6sys_context_t * sys_context, int * size, const char * base64_str)

sys_context: global system context

size: the size of the decoded data

base64_str: the string to decode

Decodes data from base64. Memory allocation is done automatically. Note that this function only works for strings, other data might not be handled correctly.

Return value: newly allocated pointer, NULL on error.

Function: char * lw6glb_base64_encode_str (lw6sys_context_t * sys_context, const char * str)

sys_context: global system context

str: the string to encode

Encodes a string into base64.

Return value: newly allocated string.

Function: char * lw6glb_base64_decode_str (lw6sys_context_t * sys_context, const char * str)

sys_context: global system context

str: the string to decode

Decodes a string from base64.

Return value: newly allocated string, NULL on error.

Function: char * lw6glb_base64_encode_bin_prefix (lw6sys_context_t * sys_context, const char * buf, int size, const char * prefix)

sys_context: global system context

buf: the data to encode

size: the size of data to encode

prefix: a prefix string

Encodes data into base64. Memory allocation is done automatically. The encoded string will be prefixed with prefix.

Return value: newly allocated string.

Function: char * lw6glb_base64_decode_bin_prefix (lw6sys_context_t * sys_context, int * size, const char * base64_str, const char * prefix)

sys_context: global system context

size: the size of the decoded data

base64_str: the string to decode

prefix: a prefix string

Decodes data from base64. Memory allocation is done automatically. Note that this function only works for strings, other data might not be handled correctly. The encoded is expected to start with prefix prefix and then contain base64 data.

Return value: newly allocated pointer, NULL on error.

Function: char * lw6glb_base64_encode_str_prefix (lw6sys_context_t * sys_context, const char * str, const char * prefix)

sys_context: global system context

str: the string to encode

prefix: a prefix string

Encodes a string into base64. The encoded string will be prefixed with prefix.

Return value: newly allocated string.

Function: char * lw6glb_base64_decode_str_prefix (lw6sys_context_t * sys_context, const char * str, const char * prefix)

sys_context: global system context

str: the string to decode

prefix: a prefix string

Decodes a string from base64. The encoded is expected to start with prefix prefix and then contain base64 data.

Return value: newly allocated string, NULL on error.

Function: char * lw6glb_sha1_hmac_80_bin (lw6sys_context_t * sys_context, const char * key, int key_size, const char * buf, int buf_size)

sys_context: global system context

key: the key buffer key_size

buf: the data to analyse

buf_size: the size of data to analyse

Calculates an SHA-1 sum of buffer, using key to seed calc.

Return value: newly allocated string, containing 20 chars checksum.

Function: char * lw6glb_sha1_hmac_80_str (lw6sys_context_t * sys_context, const char * key, const char * str)

sys_context: global system context

key: a key (string)

str: the string to calculate the checksum for

Calculates an SHA-1 sum of a string, using key to seed calc.

Return value: newly allocated string, containing 20 chars checksum.

Function: u_int32_t lw6glb_sha1_hmac_32_bin (lw6sys_context_t * sys_context, const char * key, int key_size, const char * buf, int buf_size)

sys_context: global system context

key: the key buffer

key_size: the key buffer size

buf: the data to analyse

buf_size: the size of data to analyse

Calculates an SHA-1 sum of buffer, using key to seed calc.

Return value: a 32-bit unsigned integer

Function: u_int32_t lw6glb_sha1_hmac_32_str (lw6sys_context_t * sys_context, const char * key, const char * str)

sys_context: global system context

key: a key (string)

str: the string to calculate the checksum for

Calculates an SHA-1 sum of a string, using key to seed calc.

Return value: a 32-bit unsigned integer

Function: int lw6glb_test_register (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Registers all tests for the libglb module.

Return value: 1 if test is successfull, 0 on error.

Function: int lw6glb_test_run (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Runs the glb module test suite, testing most (if not all...) functions.

Return value: 1 if test is successfull, 0 on error.


Next: , Previous: , Up: C API   [Contents][Index]