Back to index

im-sdk  12.3.91
Classes | Defines | Typedefs | Enumerations | Functions | Variables
FrameMgr.h File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _XimFrame
union  ExtraDataRec
struct  _Chain
struct  _ChainMgr
struct  _ChainIter
struct  _FrameIter
struct  _FrameInst
struct  _Iter
struct  _FrameMgr
union  XimFrameTypeInfoRec
struct  XimFrameTypeInfoRec.counter

Defines

#define Bool   int
#define True   1
#define False   0
#define xim_externalref   extern
#define xim_externaldef
#define COUNTER_MASK   0x10
#define _FRAME(a)   {a, NULL}
#define _PTR(p)   {PTR_ITEM, (void *)p}
#define _PAD2(n)   {PADDING, (void*)((n)<<8|2)}
#define _PAD4(n)   {PADDING, (void*)((n)<<8|4)}
#define FmCounterByte   0
#define FmCounterNumber   1
#define _BYTE_COUNTER(type, offset)   {(COUNTER_MASK|type), (void*)((offset)<<8|FmCounterByte)}
#define _NUMBER_COUNTER(type, offset)   {(COUNTER_MASK|type), (void*)((offset)<<8|FmCounterNumber)}
#define _UNIT(n)   ((int)(n) & 0xff)
#define _NUMBER(n)   (((int)(n) >> 8) & 0xff)
#define Swap16(p, n)
#define Swap32(p, n)
#define NO_VALUE   -1
#define NO_VALID_FIELD   -2
#define IterGetIterCount(it)
#define IterFixIteration(it)   ((it)->allow_expansion = False)
#define IterSetStarter(it)   ((it)->start_counter = True)
#define ChainMgrInit(cm)   (cm)->top = (cm)->tail = NULL
#define ChainMgrFree(cm)
#define ChainIterInit(ci, cm)
#define ChainIterFree(ci)
#define FrameInstIsEnd(fi)   ((fi)->Fr_template[(fi)->cur_no].type == EOL)
#define FrameMgrPutToken(fm, obj)   _FrameMgrPutToken((fm), &(obj), sizeof(obj))
#define FrameMgrGetToken(fm, obj)   _FrameMgrGetToken((fm), &(obj), sizeof(obj))

Typedefs

typedef unsigned int CARD32
typedef unsigned short CARD16
typedef unsigned char CARD8
typedef struct _XimFrame XimFrameRec
typedef struct _XimFrameXimFrame
typedef struct _FrameMgrFrameMgr
typedef struct _IterIter
typedef struct _FrameInstFrameInst
typedef union ExtraDataRecExtraData
typedef struct _Chain ChainRec
typedef struct _ChainChain
typedef struct _ChainMgr ChainMgrRec
typedef struct _ChainMgrChainMgr
typedef struct _ChainIter ChainIterRec
typedef struct _ChainIterChainIter
typedef struct _FrameIter FrameIterRec
typedef struct _FrameIterFrameIter
typedef struct _FrameInst FrameInstRec
typedef void(* IterStartWatchProc )()
typedef struct _Iter IterRec
typedef struct _FrameMgr FrameMgrRec
typedef union XimFrameTypeInfoRecXimFrameTypeInfo

Enumerations

enum  XimFrameType {
  BIT8 = 0x1, BIT16 = 0x2, BIT32 = 0x3, BARRAY = 0x4,
  ITER = 0x5, POINTER = 0x6, PTR_ITEM = 0x7, PADDING = 0x8,
  EOL = 0x9, COUNTER_BIT8 = COUNTER_MASK|0x1, COUNTER_BIT16 = COUNTER_MASK|0x2, COUNTER_BIT32 = COUNTER_MASK|0x3,
  BIT8 = 0x1, BIT16 = 0x2, BIT32 = 0x3, BARRAY = 0x4,
  ITER = 0x5, POINTER = 0x6, PTR_ITEM = 0x7, PADDING = 0x8,
  EOL = 0x9, COUNTER_BIT8 = COUNTER_MASK|0x1, COUNTER_BIT16 = COUNTER_MASK|0x2, COUNTER_BIT32 = COUNTER_MASK|0x3
}
enum  FmStatus {
  FmSuccess, FmEOD, FmInvalidCall, FmBufExist,
  FmCannotCalc, FmNoMoreData, FmSuccess, FmEOD,
  FmInvalidCall, FmBufExist, FmCannotCalc, FmNoMoreData
}

Functions

static FrameInst FrameInstInit (XimFrame frame)
static void FrameInstFree (FrameInst fi)
static XimFrameType FrameInstGetNextType (FrameInst fi, XimFrameTypeInfo info)
static XimFrameType FrameInstPeekNextType (FrameInst fi, XimFrameTypeInfo info)
static FmStatus FrameInstSetSize (FrameInst fi, int num)
static FmStatus FrameInstSetIterCount (FrameInst fi, int num)
static int FrameInstGetTotalSize (FrameInst fi)
static void FrameInstReset (FrameInst fi)
static Iter IterInit (XimFrame frame, int count)
static void IterFree (Iter it)
static int FrameInstGetSize (FrameInst fi)
static int IterGetSize (Iter it)
static XimFrameType IterGetNextType (Iter it, XimFrameTypeInfo info)
static XimFrameType IterPeekNextType (Iter it, XimFrameTypeInfo info)
static FmStatus IterSetSize (Iter it, int num)
static FmStatus IterSetIterCount (Iter it, int num)
static int IterGetTotalSize (Iter it)
static void IterReset (Iter it)
static Bool IterIsLoopEnd (Iter it, Bool *myself)
static void IterSetStartWatch (Iter it, IterStartWatchProc proc, void *client_data)
static void _IterStartWatch (Iter it, void *client_data)
static ExtraData ChainMgrGetExtraData (ChainMgr cm, int frame_no)
static ExtraData ChainMgrSetData (ChainMgr cm, int frame_no, ExtraDataRec data)
static Bool ChainIterGetNext (ChainIter ci, int *frame_no, ExtraData d)
static int _FrameInstIncrement (XimFrame frame, int count)
static int _FrameInstDecrement (XimFrame frame, int count)
static int _FrameInstGetItemSize (FrameInst fi, int cur_no)
static Bool FrameInstIsIterLoopEnd (FrameInst fi)
static FrameIter _FrameMgrAppendIter (FrameMgr fm, Iter it, int end)
static FrameIter _FrameIterCounterIncr (FrameIter fitr, int i)
static void _FrameMgrRemoveIter (FrameMgr fm, FrameIter it)
static Bool _FrameMgrIsIterLoopEnd (FrameMgr fm)
static Bool _FrameMgrProcessPadding (FrameMgr fm, FmStatus *status)
static FrameMgr FrameMgrInit (frame, area, byte_swap) XimFrame frame
static void FrameMgrInitWithData (fm, frame, area, byte_swap) FrameMgr fm

Variables

void * area = (char *)area
Bool byte_swap = byte_swap
FrameMgr fm = new FrameMgrRec
fm frame = frame
fm fi = FrameInstInit(frame)
fm idx = 0
fm total_size = NO_VALUE
fm iters = NULL
void * data
int data_size
int barray_size
int count
int skip_count
FmStatusstatus
XimFrameTypeInfo info
Iter it
int end
int i
void * client_data
int num
Boolmyself
IterStartWatchProc proc
int frame_no
ExtraData d
int cur_no

Class Documentation

struct _XimFrame

Definition at line 148 of file FrameMgr.h.

Class Members
void * data
XimFrameType type
int type
union ExtraDataRec

Definition at line 188 of file FrameMgr.h.

Collaboration diagram for ExtraDataRec:
Class Members
FrameInst fi
Iter iter
int num
struct _Chain

Definition at line 194 of file FrameMgr.h.

Collaboration diagram for _Chain:
Class Members
ExtraDataRec d
int frame_no
struct _Chain * next
struct _ChainMgr

Definition at line 200 of file FrameMgr.h.

Collaboration diagram for _ChainMgr:
Class Members
Chain tail
Chain top
struct _ChainIter

Definition at line 205 of file FrameMgr.h.

Collaboration diagram for _ChainIter:
Class Members
Chain cur
struct _FrameIter

Definition at line 209 of file FrameMgr.h.

Collaboration diagram for _FrameIter:
Class Members
unsigned int counter
Bool counting
int end
Iter iter
struct _FrameIter * next
struct _FrameInst

Definition at line 217 of file FrameMgr.h.

Collaboration diagram for _FrameInst:
Class Members
ChainMgrRec cm
int cur_no
XimFrame Fr_template
XimFrame template
struct _Iter

Definition at line 229 of file FrameMgr.h.

Collaboration diagram for _Iter:
Class Members
Bool allow_expansion
void * client_data
ChainMgrRec cm
int cur_no
XimFrame Fr_template
int max_count
Bool start_counter
IterStartWatchProc start_watch_proc
XimFrame template
struct _FrameMgr

Definition at line 240 of file FrameMgr.h.

Collaboration diagram for _FrameMgr:
Class Members
char * area
Bool byte_swap
FrameInst fi
XimFrame frame
int idx
FrameIter iters
int total_size
union XimFrameTypeInfoRec

Definition at line 250 of file FrameMgr.h.

Class Members
struct XimFrameTypeInfoRec counter
struct XimFrameTypeInfoRec counter
int num
struct XimFrameTypeInfoRec.counter

Definition at line 252 of file FrameMgr.h.

Class Members
Bool is_byte_len
Iter iter

Define Documentation

#define _BYTE_COUNTER (   type,
  offset 
)    {(COUNTER_MASK|type), (void*)((offset)<<8|FmCounterByte)}

Definition at line 142 of file FrameMgr.h.

#define _FRAME (   a)    {a, NULL}

Definition at line 130 of file FrameMgr.h.

#define _NUMBER (   n)    (((int)(n) >> 8) & 0xff)

Definition at line 167 of file FrameMgr.h.

#define _NUMBER_COUNTER (   type,
  offset 
)    {(COUNTER_MASK|type), (void*)((offset)<<8|FmCounterNumber)}

Definition at line 145 of file FrameMgr.h.

#define _PAD2 (   n)    {PADDING, (void*)((n)<<8|2)}

Definition at line 136 of file FrameMgr.h.

#define _PAD4 (   n)    {PADDING, (void*)((n)<<8|4)}

Definition at line 137 of file FrameMgr.h.

#define _PTR (   p)    {PTR_ITEM, (void *)p}

Definition at line 131 of file FrameMgr.h.

#define _UNIT (   n)    ((int)(n) & 0xff)

Definition at line 166 of file FrameMgr.h.

#define Bool   int

Definition at line 80 of file FrameMgr.h.

#define ChainIterFree (   ci)

Definition at line 321 of file FrameMgr.h.

#define ChainIterInit (   ci,
  cm 
)
Value:
{\
    (ci)->cur = (cm)->top;\
}

Definition at line 317 of file FrameMgr.h.

#define ChainMgrFree (   cm)
Value:
{\
    Chain tmp, cur = (cm)->top;\
\
    while (cur) {\
       tmp = cur->next;\
        delete cur;\
       cur = tmp;\
    }\
}

Definition at line 308 of file FrameMgr.h.

#define ChainMgrInit (   cm)    (cm)->top = (cm)->tail = NULL

Definition at line 307 of file FrameMgr.h.

#define COUNTER_MASK   0x10

Definition at line 98 of file FrameMgr.h.

#define False   0

Definition at line 82 of file FrameMgr.h.

#define FmCounterByte   0

Definition at line 139 of file FrameMgr.h.

#define FmCounterNumber   1

Definition at line 140 of file FrameMgr.h.

#define FrameInstIsEnd (   fi)    ((fi)->Fr_template[(fi)->cur_no].type == EOL)

Definition at line 323 of file FrameMgr.h.

#define FrameMgrGetToken (   fm,
  obj 
)    _FrameMgrGetToken((fm), &(obj), sizeof(obj))
#define FrameMgrPutToken (   fm,
  obj 
)    _FrameMgrPutToken((fm), &(obj), sizeof(obj))
#define IterFixIteration (   it)    ((it)->allow_expansion = False)

Definition at line 303 of file FrameMgr.h.

#define IterGetIterCount (   it)
Value:
((it)->allow_expansion ? \
                           NO_VALUE : (it)->max_count)

Definition at line 300 of file FrameMgr.h.

#define IterSetStarter (   it)    ((it)->start_counter = True)

Definition at line 305 of file FrameMgr.h.

#define NO_VALID_FIELD   -2

Definition at line 260 of file FrameMgr.h.

#define NO_VALUE   -1

Definition at line 259 of file FrameMgr.h.

#define Swap16 (   p,
 
)
Value:
((p)->byte_swap ?       \
                    (((n) << 8 & 0xff00) | \
                     ((n) >> 8 & 0xff)     \
                    ) : n)

Definition at line 171 of file FrameMgr.h.

#define Swap32 (   p,
 
)
Value:
((p)->byte_swap ?            \
                    (((n) << 24 & 0xff000000) | \
                     ((n) <<  8 & 0xff0000) |   \
                     ((n) >>  8 & 0xff00) |     \
                     ((n) >> 24 & 0xff)         \
                    ) : n)

Definition at line 175 of file FrameMgr.h.

#define True   1

Definition at line 81 of file FrameMgr.h.

#define xim_externaldef

Definition at line 90 of file FrameMgr.h.

#define xim_externalref   extern

Definition at line 89 of file FrameMgr.h.


Typedef Documentation

typedef unsigned short CARD16

Definition at line 101 of file FrameMgr.h.

typedef unsigned int CARD32

Definition at line 100 of file FrameMgr.h.

typedef unsigned char CARD8

Definition at line 102 of file FrameMgr.h.

typedef struct _Chain * Chain
typedef struct _ChainIter * ChainIter
typedef struct _ChainIter ChainIterRec
typedef struct _ChainMgr * ChainMgr
typedef struct _ChainMgr ChainMgrRec
typedef struct _Chain ChainRec
typedef union ExtraDataRec * ExtraData
typedef struct _FrameInst* FrameInst

Definition at line 186 of file FrameMgr.h.

typedef struct _FrameInst FrameInstRec
typedef struct _FrameIter * FrameIter
typedef struct _FrameIter FrameIterRec
typedef struct _FrameMgr* FrameMgr

Definition at line 162 of file FrameMgr.h.

typedef struct _FrameMgr FrameMgrRec
typedef struct _Iter* Iter

Definition at line 184 of file FrameMgr.h.

typedef struct _Iter IterRec
typedef void(* IterStartWatchProc)()

Definition at line 223 of file FrameMgr.h.

typedef struct _XimFrame * XimFrame
typedef struct _XimFrame XimFrameRec

Enumeration Type Documentation

enum FmStatus
Enumerator:
FmSuccess 
FmEOD 
FmInvalidCall 
FmBufExist 
FmCannotCalc 
FmNoMoreData 
FmSuccess 
FmEOD 
FmInvalidCall 
FmBufExist 
FmCannotCalc 
FmNoMoreData 

Definition at line 153 of file FrameMgr.h.

Enumerator:
BIT8 
BIT16 
BIT32 
BARRAY 
ITER 
POINTER 
PTR_ITEM 
PADDING 
EOL 
COUNTER_BIT8 
COUNTER_BIT16 
COUNTER_BIT32 
BIT8 
BIT16 
BIT32 
BARRAY 
ITER 
POINTER 
PTR_ITEM 
PADDING 
EOL 
COUNTER_BIT8 
COUNTER_BIT16 
COUNTER_BIT32 

Definition at line 104 of file FrameMgr.h.

             {
    BIT8     = 0x1,       /* {CARD8* | INT8*} */
    BIT16    = 0x2,       /* {CARD16* | INT16*} */
    BIT32    = 0x3,       /* {CARD32* | INT32*} */
    BARRAY   = 0x4,       /* int*, void* */
    ITER     = 0x5,       /* int* */
    POINTER  = 0x6,       /* specifies next item is a PTR_ITEM */
    PTR_ITEM = 0x7,       /* specifies the item has a pointer */
    /* BOGUS - POINTER and PTR_ITEM
     *   In the current implementation, PTR_ITEM should be lead by
     *   POINTER.  But actually, it's just redundant logically.  Someone 
     *   may remove this redundancy and POINTER from the enum member but he
     *   should also modify the logic in FrameMgr program.
     */
    PADDING  = 0x8,       /* specifies that a padding is needed.
                         * This requires extra data in data field.
                         */
    EOL      = 0x9,       /* specifies the end of list */

    COUNTER_BIT8  = COUNTER_MASK|0x1,
    COUNTER_BIT16 = COUNTER_MASK|0x2,
    COUNTER_BIT32 = COUNTER_MASK|0x3

} XimFrameType;

Function Documentation

static int _FrameInstDecrement ( XimFrame  frame,
int  count 
) [static]
static int _FrameInstGetItemSize ( FrameInst  fi,
int  cur_no 
) [static]
static int _FrameInstIncrement ( XimFrame  frame,
int  count 
) [static]
static FrameIter _FrameIterCounterIncr ( FrameIter  fitr,
int  i 
) [static]
static FrameIter _FrameMgrAppendIter ( FrameMgr  fm,
Iter  it,
int  end 
) [static]
static Bool _FrameMgrIsIterLoopEnd ( FrameMgr  fm) [static]
static Bool _FrameMgrProcessPadding ( FrameMgr  fm,
FmStatus status 
) [static]
static void _FrameMgrRemoveIter ( FrameMgr  fm,
FrameIter  it 
) [static]
static void _IterStartWatch ( Iter  it,
void *  client_data 
) [static]
static Bool ChainIterGetNext ( ChainIter  ci,
int *  frame_no,
ExtraData  d 
) [static]

Here is the caller graph for this function:

static ExtraData ChainMgrGetExtraData ( ChainMgr  cm,
int  frame_no 
) [static]
static ExtraData ChainMgrSetData ( ChainMgr  cm,
int  frame_no,
ExtraDataRec  data 
) [static]
static void FrameInstFree ( FrameInst  fi) [static]

Definition at line 325 of file FrameMgr.h.

{
    ChainIterRec ci;
    int frame_no;
    ExtraDataRec d;

    ChainIterInit(&ci, &fi->cm);

    while (ChainIterGetNext(&ci, &frame_no, &d)) {
       int type;
       type = fi->Fr_template[frame_no].type;
       if (type == ITER) {
           if (d.iter)
              IterFree(d.iter);
       } else if (type == POINTER) {
           if (d.fi)
              FrameInstFree(d.fi);
       }
    }
    ChainIterFree(&ci);
    ChainMgrFree(&fi->cm);
    delete fi;
}

Here is the call graph for this function:

static XimFrameType FrameInstGetNextType ( FrameInst  fi,
XimFrameTypeInfo  info 
) [static]
static int FrameInstGetSize ( FrameInst  fi) [static]
static int FrameInstGetTotalSize ( FrameInst  fi) [static]
static FrameInst FrameInstInit ( XimFrame  frame) [static]
static Bool FrameInstIsIterLoopEnd ( FrameInst  fi) [static]
static XimFrameType FrameInstPeekNextType ( FrameInst  fi,
XimFrameTypeInfo  info 
) [static]
static void FrameInstReset ( FrameInst  fi) [static]
static FmStatus FrameInstSetIterCount ( FrameInst  fi,
int  num 
) [static]
static FmStatus FrameInstSetSize ( FrameInst  fi,
int  num 
) [static]
static FrameMgr FrameMgrInit ( frame  ,
area  ,
byte_swap   
) [static]
static void FrameMgrInitWithData ( fm  ,
frame  ,
area  ,
byte_swap   
) [static]
static void IterFree ( Iter  it) [static]

Here is the caller graph for this function:

static XimFrameType IterGetNextType ( Iter  it,
XimFrameTypeInfo  info 
) [static]
static int IterGetSize ( Iter  it) [static]
static int IterGetTotalSize ( Iter  it) [static]
static Iter IterInit ( XimFrame  frame,
int  count 
) [static]
static Bool IterIsLoopEnd ( Iter  it,
Bool myself 
) [static]
static XimFrameType IterPeekNextType ( Iter  it,
XimFrameTypeInfo  info 
) [static]
static void IterReset ( Iter  it) [static]
static FmStatus IterSetIterCount ( Iter  it,
int  num 
) [static]
static FmStatus IterSetSize ( Iter  it,
int  num 
) [static]
static void IterSetStartWatch ( Iter  it,
IterStartWatchProc  proc,
void *  client_data 
) [static]

Variable Documentation

void * area = (char *)area

Definition at line 355 of file FrameMgr.h.

Definition at line 694 of file FrameMgr.h.

Definition at line 356 of file FrameMgr.h.

void * client_data

Definition at line 1266 of file FrameMgr.h.

int count

Definition at line 710 of file FrameMgr.h.

int cur_no

Definition at line 2199 of file FrameMgr.h.

Definition at line 2102 of file FrameMgr.h.

Definition at line 435 of file FrameMgr.h.

int data_size

Definition at line 437 of file FrameMgr.h.

int end

Definition at line 1180 of file FrameMgr.h.

Definition at line 364 of file FrameMgr.h.

return fm = new FrameMgrRec

Definition at line 359 of file FrameMgr.h.

Definition at line 363 of file FrameMgr.h.

int * frame_no

Definition at line 2053 of file FrameMgr.h.

int i

Definition at line 1242 of file FrameMgr.h.

fm idx = 0

Definition at line 366 of file FrameMgr.h.

Definition at line 890 of file FrameMgr.h.

Definition at line 1154 of file FrameMgr.h.

Definition at line 369 of file FrameMgr.h.

Definition at line 1501 of file FrameMgr.h.

int num

Definition at line 1279 of file FrameMgr.h.

Definition at line 1939 of file FrameMgr.h.

Definition at line 738 of file FrameMgr.h.

Definition at line 814 of file FrameMgr.h.

Definition at line 368 of file FrameMgr.h.