fastapi.h File Reference

#include "types.h"

Include dependency graph for fastapi.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  fast_cv_t
struct  fast_pmap_t
struct  fast_buffer_t
struct  fast_codec_error_t
struct  fast_codec_t

Defines

#define _fastapi_h_   1
#define STR_ARGS(_x)   _x, sizeof (_x)
#define TAG_MAX_SLOT   0xff
#define TAG_MAX_TID   0xf
#define TAG_MAX_OP   0xf
#define TAG_MAX_TYPE   0xf
#define TAG_SHIFT_SLOT   0
#define TAG_SHIFT_TID   12
#define TAG_SHIFT_OP   24
#define TAG_SHIFT_TYPE   28
#define MAKE_TAG(type, op, tid, slot)
#define MAX_TAG   64
#define MAX_TID   4
#define MAX_PMAP_BYTES   8
#define MAX_PMAP_BITS   (7 * MAX_PMAP_BYTES)
#define MAX_MSG_SIZE   2048
#define FAST_CODEC_MAGIC   0xC0DEC

Typedefs

typedef unsigned int fast_tag_t

Enumerations

enum  fast_op_t { FAST_OP_NONE = 0, FAST_OP_COPY, FAST_OP_INCR, FAST_OP_DELTA }
enum  fast_type_t { FAST_TYPE_NULL = 0, FAST_TYPE_U32, FAST_TYPE_I32, FAST_TYPE_STR }
enum  fast_error_t {
  FAST_ERR_NONE = 0, FAST_ERR_CODEC = -1, FAST_ERR_SIZE = -2, FAST_ERR_VALUE = -3,
  FAST_ERR_TAG_OP = -4, FAST_ERR_TAG_TYPE = -5, FAST_ERR_CALL_SEQ = -6, FAST_ERR_IO = -7
}

Functions

fast_codec_tfast_create_codec (void)
 Create and initialize the codec.
int fast_destroy_codec (fast_codec_t *codec)
 Destroy the codec and release associated memory.
void fast_reset_state (fast_codec_t *codec, fast_tag_t tag)
 Reset the codec state for a specific tag.
int fast_set_codec_input (fast_codec_t *codec, FILE *fptr)
 Set the input FILE stream for a codec.
int fast_set_codec_output (fast_codec_t *codec, FILE *fptr)
 Set the output FILE stream for a codec.
fast_tag_t fast_make_tag (fast_op_t, fast_type_t, u32 tid, u32 slot)
 Make a FAST tag.
int fast_decode_new_msg (fast_codec_t *codec, fast_tag_t tag)
 Decode the first tag of a new message.
int fast_decode_end_msg (fast_codec_t *codec, fast_tag_t tag)
 Complete the decoding of a message.
int fast_decode_i32 (fast_codec_t *codec, fast_tag_t tag, i32 *data)
 Decode a 32-bit signed integer.
int fast_decode_u32 (fast_codec_t *codec, fast_tag_t tag, u32 *data)
 Decode a 32-bit unsigned integer.
int fast_decode_str (fast_codec_t *codec, fast_tag_t tag, u8 *data, int size)
 Decode an ASCII String.
int fast_encode_new_msg (fast_codec_t *codec, fast_tag_t tag)
 Encode the first tag of a new message.
int fast_encode_end_msg (fast_codec_t *codec, fast_tag_t tag)
 Complete the encoding of a message.
int fast_encode_i32 (fast_codec_t *codec, fast_tag_t tag, i32 data)
 Encode a 32-bit signed integer.
int fast_encode_u32 (fast_codec_t *codec, fast_tag_t tag, u32 data)
 Encode a 32-bit unsigned integer.
int fast_encode_str (fast_codec_t *codec, fast_tag_t tag, u8 *data, int size)
 Encode an ASCII String.
int fast_print_error (fast_codec_t *codec, FILE *fptr)
 Format and print the last reported codec error to a human readable string to a FILE stream.
const char * fast_error_string (fast_codec_t *codec)
 Convert the last reported codec error to a human readable string.
u32 fast_ascii_to_u32 (u8 *data, int size)
 Convert a u8 byte arrray of characters to a u32.


Define Documentation

#define _fastapi_h_   1
 

Definition at line 21 of file fastapi.h.

#define FAST_CODEC_MAGIC   0xC0DEC
 

Examples:
fast_test.c.

Definition at line 132 of file fastapi.h.

Referenced by check_codec(), fast_create_codec(), and fast_destroy_codec().

#define MAKE_TAG type,
op,
tid,
slot   ) 
 

Value:

(((type) << TAG_SHIFT_TYPE) | ((op)   << TAG_SHIFT_OP) | \
    ((tid)  << TAG_SHIFT_TID)  | ((slot) << TAG_SHIFT_SLOT))
Examples:
decode.c, encode.c, and fast_test.c.

Definition at line 72 of file fastapi.h.

#define MAX_MSG_SIZE   2048
 

Definition at line 83 of file fastapi.h.

#define MAX_PMAP_BITS   (7 * MAX_PMAP_BYTES)
 

Examples:
fast_test.c.

Definition at line 82 of file fastapi.h.

Referenced by reset_pmap(), and set_pmap().

#define MAX_PMAP_BYTES   8
 

Definition at line 81 of file fastapi.h.

Referenced by flush_group(), and parse_pmap().

#define MAX_TAG   64
 

Definition at line 78 of file fastapi.h.

#define MAX_TID   4
 

Definition at line 79 of file fastapi.h.

#define STR_ARGS _x   )     _x, sizeof (_x)
 

Examples:
arca.c.

Definition at line 25 of file fastapi.h.

#define TAG_MAX_OP   0xf
 

Definition at line 64 of file fastapi.h.

Referenced by get_tag_op().

#define TAG_MAX_SLOT   0xff
 

Definition at line 62 of file fastapi.h.

Referenced by get_tag_slot().

#define TAG_MAX_TID   0xf
 

Definition at line 63 of file fastapi.h.

Referenced by get_tag_tid().

#define TAG_MAX_TYPE   0xf
 

Definition at line 65 of file fastapi.h.

Referenced by get_tag_type().

#define TAG_SHIFT_OP   24
 

Definition at line 69 of file fastapi.h.

Referenced by get_tag_op().

#define TAG_SHIFT_SLOT   0
 

Definition at line 67 of file fastapi.h.

Referenced by get_tag_slot().

#define TAG_SHIFT_TID   12
 

Definition at line 68 of file fastapi.h.

Referenced by get_tag_tid().

#define TAG_SHIFT_TYPE   28
 

Definition at line 70 of file fastapi.h.

Referenced by get_tag_type().


Typedef Documentation

typedef unsigned int fast_tag_t
 

Examples:
fast_test.c.

Definition at line 85 of file fastapi.h.


Enumeration Type Documentation

enum fast_error_t
 

Enumerator:
FAST_ERR_NONE 
FAST_ERR_CODEC 
FAST_ERR_SIZE 
FAST_ERR_VALUE 
FAST_ERR_TAG_OP 
FAST_ERR_TAG_TYPE 
FAST_ERR_CALL_SEQ 
FAST_ERR_IO 

Definition at line 47 of file fastapi.h.

enum fast_op_t
 

Enumerator:
FAST_OP_NONE 
FAST_OP_COPY 
FAST_OP_INCR 
FAST_OP_DELTA 

Definition at line 29 of file fastapi.h.

enum fast_type_t
 

Enumerator:
FAST_TYPE_NULL 
FAST_TYPE_U32 
FAST_TYPE_I32 
FAST_TYPE_STR 

Definition at line 38 of file fastapi.h.


Generated on Thu Feb 9 13:11:34 2006 for fastapi by doxygen 1.4.6-NO    FAST ProtocolSM