libcsem  0.2
csem_rdfa_stream.h File Reference
#include "csem_list.h"
#include "csem_url.h"

Go to the source code of this file.

Defines

#define CSEM_NS_C_BEGIN
#define CSEM_NS_C_END

Typedefs

typedef typedefCSEM_NS_C_BEGIN
struct CSEM_RDFa_Handlers 
CSEM_RDFa_Handlers
 Handlers for RDFa-Lite streaming parser.
typedef CSEM_Bool(* CSEM_RDFa_ItemStart )(const void *userdata, const CSEM_Url *resource, const CSEM_List *types)
 Handler for start scope of an item.
typedef void(* CSEM_RDFa_ItemEnd )(const void *userdata)
 Handler for end scope of an item.
typedef CSEM_Bool(* CSEM_RDFa_PropStart )(const void *userdata, const char *propName, CSEM_Bool hasUrlValue)
 Handler for start scope of a property.
typedef void(* CSEM_RDFa_PropValue )(const void *userdata, const char *value, int len)
 Handler for property value.
typedef void(* CSEM_RDFa_PropEnd )(const void *userdata)
 Handler for end scope of a property.

Functions

CSEM_Error CSEM_RDFa_CreateHandler (CSEM_RDFa_Handlers **handler)
 Create a handler manager for RDFa Lite.
void CSEM_RDFa_DisposeHandler (CSEM_RDFa_Handlers *handler)
 Dispose a handler manager.
void CSEM_RDFa_SetItemStart (CSEM_RDFa_Handlers *handler, CSEM_RDFa_ItemStart itemStart)
 Set item start handler to the handler manager.
void CSEM_RDFa_SetItemEnd (CSEM_RDFa_Handlers *handler, CSEM_RDFa_ItemEnd itemEnd)
 Set item end handler to the handler manager.
void CSEM_RDFa_SetPropStart (CSEM_RDFa_Handlers *handler, CSEM_RDFa_PropStart propStart)
 Set property start handler to the handler manager.
void CSEM_RDFa_SetPropValue (CSEM_RDFa_Handlers *handler, CSEM_RDFa_PropValue propValue)
 Set property value handler to the handler manager.
void CSEM_RDFa_SetPropEnd (CSEM_RDFa_Handlers *handler, CSEM_RDFa_PropEnd propEnd)
 Set property end handler to the handler manager.

Define Documentation

#define CSEM_NS_C_BEGIN
#define CSEM_NS_C_END

Typedef Documentation

typedef typedefCSEM_NS_C_BEGIN struct CSEM_RDFa_Handlers CSEM_RDFa_Handlers

Handlers for RDFa-Lite streaming parser.

typedef void(* CSEM_RDFa_ItemEnd)(const void *userdata)

Handler for end scope of an item.

Parameters:
userdata[out]user data
typedef CSEM_Bool(* CSEM_RDFa_ItemStart)(const void *userdata, const CSEM_Url *resource, const CSEM_List *types)

Handler for start scope of an item.

Parameters:
userdata[out]user data
resource[out]item id
types[out]types of the item
Returns:
CSEM_TRUE if the passed RDFa on this event should be freed by library. If applications would like to keep it for further processing, return CSEM_FALSE.
typedef void(* CSEM_RDFa_PropEnd)(const void *userdata)

Handler for end scope of a property.

Parameters:
userdata[out]user data
typedef CSEM_Bool(* CSEM_RDFa_PropStart)(const void *userdata, const char *propName, CSEM_Bool hasUrlValue)

Handler for start scope of a property.

Parameters:
userdata[out]user data
propName[out]the property name TODO : support space separated names
hasUrlValue[out]CSEM_TRUE if the value type of the property is URL.
Returns:
CSEM_TRUE if the passed RDFa on this event should be freed by library. If applications would like to keep it for further processing, return CSEM_FALSE.
typedef void(* CSEM_RDFa_PropValue)(const void *userdata, const char *value, int len)

Handler for property value.

The values may be divided into pieces with multiple call back.

Parameters:
userdata[out]user data
value[out]property value
len[out]length of the value

Function Documentation

Create a handler manager for RDFa Lite.

Parameters:
handler[out]created handler manager
Returns:
error code
Examples:
sample_rdfa_stream.c.

Dispose a handler manager.

Parameters:
handler[in]handler manager to be freed
void CSEM_RDFa_SetItemEnd ( CSEM_RDFa_Handlers handler,
CSEM_RDFa_ItemEnd  itemEnd 
)

Set item end handler to the handler manager.

Parameters:
handler[in]handler manager
itemEnd[in]item end handler
Examples:
sample_rdfa_stream.c.
void CSEM_RDFa_SetItemStart ( CSEM_RDFa_Handlers handler,
CSEM_RDFa_ItemStart  itemStart 
)

Set item start handler to the handler manager.

Parameters:
handler[in]handler manager
itemStart[in]item start handler
Examples:
sample_rdfa_stream.c.
void CSEM_RDFa_SetPropEnd ( CSEM_RDFa_Handlers handler,
CSEM_RDFa_PropEnd  propEnd 
)

Set property end handler to the handler manager.

Parameters:
handler[in]handler manager
propEnd[in]property end handler
Examples:
sample_rdfa_stream.c.
void CSEM_RDFa_SetPropStart ( CSEM_RDFa_Handlers handler,
CSEM_RDFa_PropStart  propStart 
)

Set property start handler to the handler manager.

Parameters:
handler[in]handler manager
propStart[in]property start handler
Examples:
sample_rdfa_stream.c.
void CSEM_RDFa_SetPropValue ( CSEM_RDFa_Handlers handler,
CSEM_RDFa_PropValue  propValue 
)

Set property value handler to the handler manager.

Parameters:
handler[in]handler manager
propValue[in]property value handler
Examples:
sample_rdfa_stream.c.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines