AVRO Handles
[Avro C API]


Data Structures

struct  AVRO

Defines

#define CHECK_ERROR(__status)   if(__status != AVRO_OK){ return __status; }
#define AVRO_GETBYTES(avro, addr, len)   (*(avro)->a_ops->a_getbytes)(avro, addr, len)
#define AVRO_PUTBYTES(avro, addr, len)   (*(avro)->a_ops->a_putbytes)(avro, addr, len)

Typedefs

typedef enum avro_op avro_op
typedef enum avro_status_t avro_status_t
typedef struct AVRO AVRO

Enumerations

enum  avro_op { AVRO_ENCODE = 0, AVRO_DECODE = 1 }
enum  avro_status_t { AVRO_OK = 0, AVRO_FAILURE = 1 }

Functions

avro_status_t avro_initialize (void)
avro_status_t avro_create_memory (AVRO *avro, apr_pool_t *pool, caddr_t addr, int64_t len, avro_op op)
avro_status_t avro_create_file (AVRO *avro, apr_pool_t *pool, apr_file_t *file, avro_op op)
avro_status_t avro_create_socket (AVRO *avro, apr_pool_t *pool, apr_socket_t *socket, avro_op op)

Enumeration Type Documentation

enum avro_op

Avro operation enum. Enum for discriminating whether an Avro handle is for encoding or decoding data.

Enumerator:
AVRO_ENCODE  Marks a handle as encoding Avro data
AVRO_DECODE  Marks a handle as decoding Avro data

Avro status enum. Enum used by Avro functions to return state.

Todo:
expand the number of states
Enumerator:
AVRO_OK  Function success
AVRO_FAILURE  Function failure


Function Documentation

avro_status_t avro_create_file ( AVRO avro,
apr_pool_t *  pool,
apr_file_t *  file,
avro_op  op 
)

Create a file-backed Avro handle

Parameters:
avro Pointer to the handle that will be initialized
pool Pool used for allocating dynamic data structures
file The file to read(decode) or write(encode) from
op Expresses the operation the handle should perform (e.g. encode, decode)
Returns:
The Avro status

avro_status_t avro_create_memory ( AVRO avro,
apr_pool_t *  pool,
caddr_t  addr,
int64_t  len,
avro_op  op 
)

Create a memory-backed Avro handle

Parameters:
avro Pointer to handle that will be initialized
pool Pool used for allocating dynamic data structures.
addr Address of the memory location for manipulating data
len Size of the memory to use
op Expressing the operation the handle should perform (e.g. encode, decode)
Returns:
The Avro status

avro_status_t avro_create_socket ( AVRO avro,
apr_pool_t *  pool,
apr_socket_t *  socket,
avro_op  op 
)

Create a socket-backed Avro handle

Parameters:
avro Pointer to the handle that will be initialized
pool Pool used for allocating dynamic data structures
socket The socket to read(decode) or write(encode) from
op Expresses the operation the handle should perform (e.g. encode, decode)
Returns:
The Avro status

avro_status_t avro_initialize ( void   ) 

Initialize the AVRO library

Returns:
The Avro status


Generated on Fri Oct 9 14:12:58 2009 for AVRO C API by  doxygen 1.5.8