ccd_node_t

ccd_node_t

Synopsis

void                ccd_init                            (ccd_node_class_t const *node_class,
                                                         ccd_function_t const *vtable);
void                ccd_shutdown                        (void);
typedef             ccd_node_t;
                    ccd_node_class_t;
ccd_node_t*         (*ccd_node_get_container_f)         (ccd_node_t const *self);
ccd_node_t*         (*ccd_node_get_base_style_f)        (ccd_node_t const *self);
const char*         (*ccd_node_get_id_f)                (ccd_node_t const *self);
const char*         (*ccd_node_get_type_f)              (ccd_node_t const *self);
const char*         (*ccd_node_get_class_f)             (ccd_node_t const *self);
const char*         (*ccd_node_get_pseudo_class_f)      (ccd_node_t const *self);
char*               (*ccd_node_get_attribute_f)         (ccd_node_t const *self,
                                                         char const *name);
void                (*ccd_node_release_f)               (ccd_node_t *self);

Description

Details

ccd_init ()

void                ccd_init                            (ccd_node_class_t const *node_class,
                                                         ccd_function_t const *vtable);

Initialize the CCD library before making any calls to it.

node_class :

dispatch table as described at ccd_node_class_t.

vtable :


ccd_shutdown ()

void                ccd_shutdown                        (void);

Shut down the CCD library.


ccd_node_t

typedef void * ccd_node_t;

Stack-allocatable struct representing a document node. Used for querying the ccd_stylesheet_t.

Memory management: Unless specified otherwise, objects of this kind are under the responsibility of the libccd consumer.


ccd_node_class_t

typedef struct {
	ccd_node_is_a_f			is_a;
	ccd_node_get_container_f	get_container;
	ccd_node_get_base_style_f	get_base_style;
	ccd_node_get_id_f		get_id;
	ccd_node_get_type_f		get_type;
	ccd_node_get_class_f		get_class;
	ccd_node_get_pseudo_class_f	get_pseudo_class;
	ccd_node_get_attribute_f	get_attribute;
	ccd_node_release_f		release;
} ccd_node_class_t;

Dispatch table a CCD consumer has to fill so the selection engine can retrieve information about the document the document.

The implemented dispatch table needs to be passed to ccd_init.


ccd_node_get_container_f ()

ccd_node_t*         (*ccd_node_get_container_f)         (ccd_node_t const *self);

Hook function to query the container of a ccd_node_t.

self :

a ccd_node_t.

Returns :

newly allocated container node or NULL.

ccd_node_get_base_style_f ()

ccd_node_t*         (*ccd_node_get_base_style_f)        (ccd_node_t const *self);

Hook function to query the name of the style a ccd_node_t derives from.

self :

a ccd_node_t.

Returns :

base style or NULL. The returned value must be valid until it is released.

ccd_node_get_id_f ()

const char*         (*ccd_node_get_id_f)                (ccd_node_t const *self);

Hook function to query the ID of a ccd_node_t.

self :

a ccd_node_t.

Returns :

node ID or NULL. The returned value must be valid until the current stylesheet query returns.

ccd_node_get_type_f ()

const char*         (*ccd_node_get_type_f)              (ccd_node_t const *self);

Hook function to query the type name of a ccd_node_t.

self :

a ccd_node_t.

Returns :

node type name or NULL. The returned value must be valid until the current stylesheet query returns.

ccd_node_get_class_f ()

const char*         (*ccd_node_get_class_f)             (ccd_node_t const *self);

Hook function to query the class name of a ccd_node_t.

self :

a ccd_node_t.

Returns :

node class name or NULL. The returned value must be valid until the current stylesheet query returns.

ccd_node_get_pseudo_class_f ()

const char*         (*ccd_node_get_pseudo_class_f)      (ccd_node_t const *self);

Hook function to query the pseudo-class name of a ccd_node_t.

self :

a ccd_node_t.

Returns :

node pseudo-class name or NULL. The returned value must be valid until the current stylesheet query returns.

ccd_node_get_attribute_f ()

char*               (*ccd_node_get_attribute_f)         (ccd_node_t const *self,
                                                         char const *name);

Hook function to query a ccd_node_t's attributes.

self :

a ccd_node_t.

name :

attribute name.

Returns :

attribute value or NULL. The returned value must be valid until the current stylesheet query returns.

ccd_node_release_f ()

void                (*ccd_node_release_f)               (ccd_node_t *self);

Hook function to deallocate a ccd_node_t instance.

self :

a ccd_node_t.