Data Block

Data Structures

struct  ast_datablock_t
 Datablock. More...
 
struct  ast_datablock_ex_t
 Extracted datablock. More...
 

Macros

#define AST_MAX_DATARECORDS   64
 

Functions

ast_datablock_t ast_datablock_decode (const unsigned char *const buffer, const size_t bufsize, const ast_uap_t uap)
 Datablock decode function. More...
 
ast_datablock_t ast_datablock_smart_decode (const unsigned char *const buffer, const size_t bufsize)
 Datablock smart decode function. More...
 
ast_datablock_t ast_datablock_encode (unsigned char *const buffer, const size_t bufsize, const ast_datablock_ex_t xdb)
 Datablock encode function. More...
 
ast_datablock_t ast_datablock_modify (unsigned char *const buffer, const size_t bufsize, const ast_datablock_t src, const ast_datarecord_modifier_t mod)
 

Detailed Description

Macro Definition Documentation

◆ AST_MAX_DATARECORDS

#define AST_MAX_DATARECORDS   64

Function Documentation

◆ ast_datablock_decode()

ast_datablock_t ast_datablock_decode ( const unsigned char *const  buffer,
const size_t  bufsize,
const ast_uap_t  uap 
)

Datablock decode function.

Parameters
bufferBuffer to read datablock data
bufsizeBuffer size
uapUser application profile (UAP) used to decode data

This function will read and check data against specified uap, and return decoded datablock. If data can be successfully decoded, the returned datablock will be marked as "valid". If any error occurs, the returned datablock will be marked as "invalid".

Examples
example.c.

◆ ast_datablock_encode()

ast_datablock_t ast_datablock_encode ( unsigned char *const  buffer,
const size_t  bufsize,
const ast_datablock_ex_t  xdb 
)

Datablock encode function.

Parameters
bufferBuffer to write encoded datablock data
bufsizeBuffer size
xdbExtracted datablock container
Returns
Encoded datablock

This function will check datarecords contained in xdb, encode them and write encoded data to buffer. If all datarecords are successfully encoded, the returned datablock will be marked as "valid". If any error occurs, the returned datablock will be marked as "invalid".

Examples
example.c.

◆ ast_datablock_modify()

ast_datablock_t ast_datablock_modify ( unsigned char *const  buffer,
const size_t  bufsize,
const ast_datablock_t  src,
const ast_datarecord_modifier_t  mod 
)
Examples
example.c.

◆ ast_datablock_smart_decode()

ast_datablock_t ast_datablock_smart_decode ( const unsigned char *const  buffer,
const size_t  bufsize 
)

Datablock smart decode function.

Parameters
bufferBuffer to read datablock data
bufsizeBuffer size

This function will read and decode data by using a automatically selected UAP, and return decoded datablock. If data can be successfully decoded, the returned datablock will be marked as "valid". If any error occurs, the returned datablock will be marked as "invalid".