libopc
Data Structures | Typedefs | Enumerations | Functions
helper.h File Reference
#include <mce/config.h>

Go to the source code of this file.

Data Structures

struct  MCE_QNAME_LEVEL
 
struct  MCE_SKIP_ITEM
 
struct  MCE_QNAME_LEVEL_SET
 
struct  MCE_SKIP_STACK
 
struct  MCE_CONTEXT
 

Typedefs

typedef struct MCE_QNAME_LEVEL mceQNameLevel_t
 
typedef enum MCE_SKIP_STATE_ENUM mceSkipState_t
 
typedef struct MCE_SKIP_ITEM mceSkipItem_t
 
typedef struct MCE_QNAME_LEVEL_SET mceQNameLevelSet_t
 
typedef struct MCE_SKIP_STACK mceSkipStack_t
 
typedef enum MCE_ERROR_ENUM mceError_t
 
typedef struct MCE_CONTEXT mceCtx_t
 

Enumerations

enum  MCE_SKIP_STATE_ENUM { MCE_SKIP_STATE_IGNORE, MCE_SKIP_STATE_ALTERNATE_CONTENT, MCE_SKIP_STATE_CHOICE_MATCHED }
 
enum  MCE_ERROR_ENUM {
  MCE_ERROR_NONE, MCE_ERROR_XML, MCE_ERROR_MUST_UNDERSTAND, MCE_ERROR_VALIDATION,
  MCE_ERROR_MEMORY
}
 

Functions

pbool_t mceQNameLevelAdd (mceQNameLevelSet_t *qname_level_set, const xmlChar *ns, const xmlChar *ln, puint32_t level)
 
mceQNameLevel_tmceQNameLevelLookup (mceQNameLevelSet_t *qname_level_set, const xmlChar *ns, const xmlChar *ln, pbool_t ignore_ln)
 
pbool_t mceQNameLevelCleanup (mceQNameLevelSet_t *qname_level_set, puint32_t level)
 
pbool_t mceSkipStackPush (mceSkipStack_t *skip_stack, puint32_t level_start, puint32_t level_end, mceSkipState_t state)
 
void mceSkipStackPop (mceSkipStack_t *skip_stack)
 
mceSkipItem_tmceSkipStackTop (mceSkipStack_t *skip_stack)
 
pbool_t mceSkipStackSkip (mceSkipStack_t *skip_stack, puint32_t level)
 
pbool_t mceCtxInit (mceCtx_t *ctx)
 
pbool_t mceCtxCleanup (mceCtx_t *ctx)
 
pbool_t mceCtxUnderstandsNamespace (mceCtx_t *ctx, const xmlChar *ns)
 
pbool_t mceCtxSuspendProcessing (mceCtx_t *ctx, const xmlChar *ns, const xmlChar *ln)
 

Detailed Description

Helper functions needed by mce/textreader.h and mce/textwriter.h to implement MCE:

Typedef Documentation

typedef struct MCE_CONTEXT mceCtx_t

Holds all information to do MCE preprocessing.

Tiple (ns, ln, level).

Either represents a set of (ns, ln, level) triples.

typedef struct MCE_SKIP_ITEM mceSkipItem_t

Represents an intervall of levels which are "skipped" i.e. ignored.

The skip stack.

Function Documentation

pbool_t mceCtxCleanup ( mceCtx_t ctx)

Cleanup, i.e. release all resourced from the mceCtx_t ctx.

pbool_t mceCtxInit ( mceCtx_t ctx)

Initialize the mceCtx_t ctx.

pbool_t mceCtxSuspendProcessing ( mceCtx_t ctx,
const xmlChar *  ns,
const xmlChar *  ln 
)

Register the namespace in ctx.

pbool_t mceCtxUnderstandsNamespace ( mceCtx_t ctx,
const xmlChar *  ns 
)

Register the namespace in ctx.

pbool_t mceQNameLevelAdd ( mceQNameLevelSet_t qname_level_set,
const xmlChar *  ns,
const xmlChar *  ln,
puint32_t  level 
)

Add a new tiple (ns, ln, level) to the triple set qname_level_set. The ns_sub string is optional and will not be touched.

pbool_t mceQNameLevelCleanup ( mceQNameLevelSet_t qname_level_set,
puint32_t  level 
)

Remove all triples (ns, ln, level) where the level greater or equal to level.

mceQNameLevel_t* mceQNameLevelLookup ( mceQNameLevelSet_t qname_level_set,
const xmlChar *  ns,
const xmlChar *  ln,
pbool_t  ignore_ln 
)

Lookup a tiple (ns, ln, level) via ns and ln. If ignore_ln is PTRUE then the first tiple matching ns will be returned.

void mceSkipStackPop ( mceSkipStack_t skip_stack)

Pop the intervall (ns, ln, level) from the stack qname_level_array.

pbool_t mceSkipStackPush ( mceSkipStack_t skip_stack,
puint32_t  level_start,
puint32_t  level_end,
mceSkipState_t  state 
)

Push a new skip intervall (level_start, level_end, state) on the stack skip_stack.

pbool_t mceSkipStackSkip ( mceSkipStack_t skip_stack,
puint32_t  level 
)

Returns TRUE, if the level is in the top skip intervall.

mceSkipItem_t* mceSkipStackTop ( mceSkipStack_t skip_stack)

Returns top item or NULL.