opcode.h File Reference


Detailed Description

Implementation of opcode chains, that are used to drive the encoding and decoding process.

#include <dballe/core/vartable.h>

Go to the source code of this file.

Data Structures

struct  _bufrex_opcode
 List node containing an entry of a BUFR or CREX data descriptor section. More...

Typedefs

typedef _bufrex_opcodebufrex_opcode
 List node containing an entry of a BUFR or CREX data descriptor section.

Functions

void bufrex_opcode_delete (bufrex_opcode *entry)
 Delete a bufrex_opcode chain.
dba_err bufrex_opcode_append (bufrex_opcode *entry, dba_varcode value)
 Append an entry to an opcode chain.
dba_err bufrex_opcode_prepend (bufrex_opcode *dest, bufrex_opcode src)
 Duplicate an opcode chain and insert it before an existing bufrex_opcode.
dba_err bufrex_opcode_join (bufrex_opcode *op1, bufrex_opcode op2)
 Attach a bufrex_opcode chain to the end of another.
dba_err bufrex_opcode_pop (bufrex_opcode *chain, bufrex_opcode *head)
 Detach the first element from a bufrex_opcode list.
dba_err bufrex_opcode_pop_n (bufrex_opcode *chain, bufrex_opcode *head, int length)
 Detach the first `length' elements from a bufrex_opcode list.
void bufrex_opcode_print (bufrex_opcode chain, void *outstream)
 Print the contents of the given chain to the given output stream.


Function Documentation

dba_err bufrex_opcode_append ( bufrex_opcode entry,
dba_varcode  value 
)

Append an entry to an opcode chain.

Parameters:
entry opcode entry to append the entry to
value Value to append to the entry. See vartable.h
Returns:
The error indicator for the function

void bufrex_opcode_delete ( bufrex_opcode entry  ) 

Delete a bufrex_opcode chain.

Parameters:
entry The chain to be deleted. After the call, entry will be NULL.

dba_err bufrex_opcode_join ( bufrex_opcode op1,
bufrex_opcode  op2 
)

Attach a bufrex_opcode chain to the end of another.

Parameters:
op1 The first bufrex_opcode chain to be joined
op2 bufrex_opcode chain to be attached to the end of op1
Returns:
The error indicator for the function

dba_err bufrex_opcode_pop ( bufrex_opcode chain,
bufrex_opcode head 
)

Detach the first element from a bufrex_opcode list.

Parameters:
chain The bufrex_opcode chain whose first element is to be detached.
head Where will be stored the detached first element of the opcode list.
Returns:
The error indicator for the function

dba_err bufrex_opcode_pop_n ( bufrex_opcode chain,
bufrex_opcode head,
int  length 
)

Detach the first `length' elements from a bufrex_opcode list.

Parameters:
chain The bufrex_opcode chain whose first element is to be detached.
head Where will be stored the detached first element of the opcode list.
length Number of items to detach
Returns:
The error indicator for the function

dba_err bufrex_opcode_prepend ( bufrex_opcode dest,
bufrex_opcode  src 
)

Duplicate an opcode chain and insert it before an existing bufrex_opcode.

To insert a chain in a specific point of an existing chain, do this:

   DBA_RUN_OR_RETURN(bufrex_opcode_prepend(&(oldnode->next), newchain));

This can be used to duplicate opcode chains, as in:

   bufrex_opcode newchain = NULL;
   DBA_RUN_OR_RETURN(bufrex_opcode_prepend(&newchain, oldchain));

Parameters:
dest The bufrex_opcode before which the chain is to be copied
src The bufrex_opcode chain to copy
Returns:
The error indicator for the function

void bufrex_opcode_print ( bufrex_opcode  chain,
void *  outstream 
)

Print the contents of the given chain to the given output stream.

This function is used mainly for debugging purposes.

Parameters:
chain The bufrex_opcode chain to print
outstream The output stream (a FILE* variable) to print to. void* is used to avoid including stdio.h just for this debugging function.


Generated on Fri Jun 22 14:45:48 2007 for libdballe-db by  doxygen 1.5.2