libcsem  0.2
csem_tree.h File Reference
#include "csem_list.h"

Go to the source code of this file.

Defines

#define CSEM_NS_C_BEGIN
#define CSEM_NS_C_END

Typedefs

typedef CSEM_NS_C_BEGIN enum
CSEM_NODE_TYPE 
CSEM_NODE_TYPE
 Types of the tree nodes.
typedef struct CSEM_Document CSEM_Document
 Root node of the tree.
typedef struct CSEM_Node CSEM_Node
 Abstract node of the tree nodes.

Enumerations

enum  CSEM_NODE_TYPE {
  CSEM_NODE_TYPE_NONE = 0, CSEM_NODE_TYPE_DOCUMENT, CSEM_NODE_TYPE_ITEM, CSEM_NODE_TYPE_PROPERTY,
  CSEM_NODE_TYPE_ID
}
 Types of the tree nodes. More...

Functions

CSEM_Error CSEM_Node_Create (CSEM_Node **node, CSEM_NODE_TYPE type, void *obj, CSEM_Node *parent)
 Create a node.
CSEM_NODE_TYPE CSEM_Node_GetType (CSEM_Node *node)
 Get node type.
CSEM_NodeCSEM_Node_GetParent (CSEM_Node *node)
 Get parent node.
void * CSEM_Node_GetObject (CSEM_Node *node)
 Get content object related to the specified node.
void CSEM_Node_Dispose (CSEM_Node *node)
 Dispose the node.
CSEM_Error CSEM_Document_Create (CSEM_Document **document)
 Create document node.
void CSEM_Document_Dispose (CSEM_Document *document)
 Dispose document node.
CSEM_ListCSEM_Document_GetChildren (CSEM_Document *doc)
 Get child nodes.
CSEM_Error CSEM_Document_AppendChild (CSEM_Document *doc, CSEM_Node *child)
 Append the specified node as child node under the document node.

Define Documentation

#define CSEM_NS_C_BEGIN
#define CSEM_NS_C_END

Typedef Documentation

typedef struct CSEM_Document CSEM_Document

Root node of the tree.

typedef struct CSEM_Node CSEM_Node

Abstract node of the tree nodes.

Types of the tree nodes.


Enumeration Type Documentation

Types of the tree nodes.

Enumerator:
CSEM_NODE_TYPE_NONE 
CSEM_NODE_TYPE_DOCUMENT 

document node

CSEM_NODE_TYPE_ITEM 

item node

CSEM_NODE_TYPE_PROPERTY 

property node

CSEM_NODE_TYPE_ID 

id node for microdata


Function Documentation

Append the specified node as child node under the document node.

Parameters:
doc[in]document node
child[in]child node to be appended
Returns:
error node

Create document node.

Parameters:
document[out]create document node
Returns:
error code
void CSEM_Document_Dispose ( CSEM_Document document)

Dispose document node.

Parameters:
document[in]document node to be freed
Examples:
sample_micro_search.c, sample_micro_tree.c, sample_rdfa_search.c, and sample_rdfa_tree.c.

Get child nodes.

Parameters:
doc[in]document node
Returns:
child node list
Examples:
sample_micro_tree.c, and sample_rdfa_tree.c.
CSEM_Error CSEM_Node_Create ( CSEM_Node **  node,
CSEM_NODE_TYPE  type,
void *  obj,
CSEM_Node parent 
)

Create a node.

Parameters:
node[out]created node
type[in]node type
obj[in]content object related to the node
parent[in]parent node
Returns:
error code
void CSEM_Node_Dispose ( CSEM_Node node)

Dispose the node.

Parameters:
node[in]node to be freed
void* CSEM_Node_GetObject ( CSEM_Node node)

Get content object related to the specified node.

Parameters:
node[in]node
Examples:
sample_micro_tree.c, and sample_rdfa_tree.c.

Get parent node.

Parameters:
node[in]node
Returns:
parent node

Get node type.

Parameters:
node[in]node
Returns:
node type
Examples:
sample_micro_tree.c, and sample_rdfa_tree.c.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines