Dealing with structure description


Defines

#define xf_offs(a, b)   ( (char *) (&((a)->b)) - (char *)(a) )
#define XF_TYPE_EMPTY   0x00
 default
#define XF_TYPE_STR   0x01
 String Type.
#define XF_TYPE_FP   0x02
 Floating Point Type.
#define XF_TYPE_LONG   0x03
 Long Integer Type.
#define XF_TYPE_INT   0x04
 Integer Type.
#define XF_TYPE_BYTE   0x05
 Byte Type.
#define XF_TYPE_BOOLEAN   0x06
 Boolean Type.
#define XF_TYPE_OBJECT   0x07
 Object Type.
#define XF_TYPE_VEC   0x08
 Vector Type i.e. variable number of elements.
#define XF_TYPE_UNION   0x09
 Union Type.
#define XF_TYPE_REC   0x0A
 Structured Type.
#define XF_TYPE_ARRAY   0x0B
 fixed length array

Typedefs

typedef xf_descr_list_s xf_descr_list_t
 Class to describe object classes.

Functions

xf_descr_list_txf_descr_list_new (int no, char *name)
 Constructor.
int xf_descr_list_add (xf_descr_list_t *pd, int idx, int type, int size, int offs, int noffs, xf_descr_list_t *pl)
 Add member to the description list of a class (structure).

Detailed Description

This module describe the methods to create and describe arbitrary C-structures

Define Documentation

#define xf_offs ( a,
 )     ( (char *) (&((a)->b)) - (char *)(a) )

makro for computing offset from structure to member


Typedef Documentation

typedef struct xf_descr_list_s xf_descr_list_t

Class to describe object classes.

This structure contains the list of members of a class (structure)


Function Documentation

int xf_descr_list_add ( xf_descr_list_t pd,
int  idx,
int  type,
int  size,
int  offs,
int  noffs,
xf_descr_list_t pl 
)

Add member to the description list of a class (structure).

Parameters:
pd Description to add member
idx Index position of member in object
type Type specifier of member
size Size of member
offs Offset in byte from object start to member
noffs Only for array, vector(list), union: offset to size or union member tag
pl Only for complex type member: description list of member
Returns:
  • 0: OK
  • else: Error

xf_descr_list_t* xf_descr_list_new ( int  no,
char *  name 
)

Constructor.

create empty list for members of a structured type

Parameters:
no number of members of object
name name of description list
Returns:
  • The description list of a structured type


Generated on 4 Mar 2014 for xfer by  doxygen 1.4.7