Modeler Extensions Framework

Functions

void clemext_host_trace (CLEMEXTHostHandle host, const char *text)
 
CLEMEXTStatus clemext_host_createNewDocument (CLEMEXTHostHandle host, const char *root_element_name, CLEMEXTXMLHandle *doc)
 
CLEMEXTStatus clemext_host_createDocumentFromContents (CLEMEXTHostHandle host, const char *contents, CLEMEXTXMLHandle *doc)
 
CLEMEXTStatus clemext_xml_disposeDocument (CLEMEXTXMLHandle doc)
 
CLEMEXTStatus clemext_xml_doc2string (CLEMEXTXMLHandle xml, char *buffer, size_t buffer_size, size_t *data_size)
 
CLEMEXTStatus clemext_xml_getName (CLEMEXTXMLHandle xml, char *buffer, size_t buffer_size, size_t *data_size)
 
CLEMEXTStatus clemext_xml_getAttribute (CLEMEXTXMLHandle xml, const char *name, char *buffer, size_t buffer_size, size_t *data_size)
 
CLEMEXTStatus clemext_xml_hasAttribute (CLEMEXTXMLHandle xml, const char *name, int *result)
 
CLEMEXTStatus clemext_xml_getElementIterator (CLEMEXTXMLHandle xml, const char *name, CLEMEXTXMLIteratorHandle *iterator)
 
CLEMEXTStatus clemext_xml_getTextIterator (CLEMEXTXMLHandle xml, CLEMEXTXMLIteratorHandle *iterator)
 
CLEMEXTStatus clemext_xml_addAttribute (CLEMEXTXMLHandle xml, const char *attribute_name, const char *attribute_value)
 
CLEMEXTStatus clemext_xml_removeAttribute (CLEMEXTXMLHandle xml, const char *attribute_name)
 
CLEMEXTStatus clemext_xml_addText (CLEMEXTXMLHandle xml, const char *data)
 
CLEMEXTStatus clemext_xml_addElement (CLEMEXTXMLHandle xml, const char *element_name, void **new_element)
 
CLEMEXTStatus clemext_xmliterator_hasMoreItems (CLEMEXTXMLIteratorHandle iterator, int *result)
 
CLEMEXTStatus clemext_xmliterator_nextItem (CLEMEXTXMLIteratorHandle iterator, void **item)
 
CLEMEXTStatus clemext_xmliterator_deleteCurrentItem (CLEMEXTXMLIteratorHandle iterator)
 
CLEMEXTStatus clemext_xmliterator_close (CLEMEXTXMLIteratorHandle iterator)
 
CLEMEXT_API CLEMEXTStatus clemext_peer_call (CLEMEXTPeerHandle peer, const char *fnName, void **in_buffers, void ***out_buffers, CLEMEXTErrorCode *errorCode)
 
CLEMEXTStatus clemext_node_attachJVM (CLEMEXTNodeHandle node, void **jni_env, const char *options, CLEMEXTErrorCode *errorCode)
 
CLEMEXTStatus clemext_node_detachJVM (CLEMEXTNodeHandle node, void *jni_env, CLEMEXTErrorCode *errorCode)
 

Detailed Description

Function Documentation

CLEMEXTStatus clemext_host_createDocumentFromContents ( CLEMEXTHostHandle  host,
const char *  contents,
CLEMEXTXMLHandle *  doc 
)
inline

Called by the module to create a new XML document by parsing a string containing the document contents

Parameters
hosta CLEMEXTHostHandle (as passed to the module by call clemext_initialise)
contentsthe string to parse to obtain the XML document
docreference to an CLEMEXTXMLHandle in which to the root element in the parsed doc
@return CLEMEXT status code

Definition at line 935 of file clemext.h.

CLEMEXTStatus clemext_host_createNewDocument ( CLEMEXTHostHandle  host,
const char *  root_element_name,
CLEMEXTXMLHandle *  doc 
)
inline

Called by the module to create a new XML document with a root element of the given name and return a pointer to that element

Parameters
hosta CLEMEXTHostHandle (as passed to the module by call clemext_initialise)
root_element_namethe name of the root element of the new doc
docreference to an CLEMEXTXMLHandle in which to the root element in the parsed doc
@return CLEMEXT status code

Definition at line 918 of file clemext.h.

void clemext_host_trace ( CLEMEXTHostHandle  host,
const char *  text 
)
inline

Called by the module to log some text to a tracing file maintained by clementine (enabled by setting "trace_extension, <N>" in config/options.cfg where N>0

Parameters
hosta CLEMEXTHostHandle (as passed to the module by call clemext_initialise)
texta const char * indicating the UTF-8 encoded text to trace

Definition at line 902 of file clemext.h.

CLEMEXTStatus clemext_node_attachJVM ( CLEMEXTNodeHandle  node,
void **  jni_env,
const char *  options,
CLEMEXTErrorCode errorCode 
)
inline

Definition at line 1231 of file clemext.h.

CLEMEXTStatus clemext_node_detachJVM ( CLEMEXTNodeHandle  node,
void *  jni_env,
CLEMEXTErrorCode errorCode 
)
inline

Definition at line 1251 of file clemext.h.

CLEMEXT_API CLEMEXTStatus clemext_peer_call ( CLEMEXTPeerHandle  peer,
const char *  fnName,
void **  in_buffers,
void ***  out_buffers,
CLEMEXTErrorCode errorCode 
)
CLEMEXTStatus clemext_xml_addAttribute ( CLEMEXTXMLHandle  xml,
const char *  attribute_name,
const char *  attribute_value 
)
inline

Called by the module to add an attribute to an XML element

Parameters
xmlthe element represented by its CLEMEXTXMLHandle
attribute_namethe name of the new attribute
attribute_valuethe value of the new attribute
Returns
status code

Definition at line 1087 of file clemext.h.

CLEMEXTStatus clemext_xml_addElement ( CLEMEXTXMLHandle  xml,
const char *  element_name,
void **  new_element 
)
inline

Called by the module to append a new empty element to the children of a parent element

Parameters
xmlthe parent element
element_namename of the child element to add
new_elementreference of a pointer to re-point to new element if success
Returns
status code

Definition at line 1135 of file clemext.h.

CLEMEXTStatus clemext_xml_addText ( CLEMEXTXMLHandle  xml,
const char *  data 
)
inline

Called by the module to set the character data for an XML element

Parameters
xmlthe element represented by its CLEMEXTXMLHandle
datathe value of the character data
Returns
status code

Definition at line 1118 of file clemext.h.

CLEMEXTStatus clemext_xml_disposeDocument ( CLEMEXTXMLHandle  doc)
inline

Called by the module to dispose and free XML data strucures associated with the associated element

NOTE: can only be executed on a root element returned by a call to either createNewDocument or createDocumentFromContents.

Parameters
docthe root element of an XML document represented by its CLEMEXTXMLHandle
Returns
CLEMEXT status code

Definition at line 953 of file clemext.h.

CLEMEXTStatus clemext_xml_doc2string ( CLEMEXTXMLHandle  xml,
char *  buffer,
size_t  buffer_size,
size_t *  data_size 
)
inline

Called by the module to convert an XML document to a string

Note: can only be called on a root element returned by a call to either createNewDocument or createDocumentFromContents.

Parameters
xmlthe root element represented by its CLEMEXTXMLHandle
bufferbuffer to receive the result
buffer_sizethe current size of the buffer in bytes
data_sizepointer to a value set to the number of bytes required to store the result in a buffer
Returns
CLEMEXT status code

Definition at line 972 of file clemext.h.

CLEMEXTStatus clemext_xml_getAttribute ( CLEMEXTXMLHandle  xml,
const char *  name,
char *  buffer,
size_t  buffer_size,
size_t *  data_size 
)
inline

Called by the module to return the value of a named attribute in an XML element

Note: if the named attribute does not exist an emptystring "" value is returned

Parameters
xmlthe element represented by its CLEMEXTXMLHandle
namethe name of the attribute
bufferbuffer to receive the result
buffer_sizethe current size of the buffer in bytes
data_sizepointer to a value set to the number of bytes required to store the result in a buffer
Returns
CLEMEXT status code

Definition at line 1013 of file clemext.h.

CLEMEXTStatus clemext_xml_getElementIterator ( CLEMEXTXMLHandle  xml,
const char *  name,
CLEMEXTXMLIteratorHandle *  iterator 
)
inline

Called by the module to open an iterator on the child elements of an element with a particular name

Parameters
xmlthe parent element represented by its CLEMEXTXMLHandle
namethe name of the child elements to iterate over
iteratorpointer to an iterator handle, on success set to point to the new iterator
See also
CLEMEXTXMLIteratorHandle
CLEMEXTXMLIterator
Returns
CLEMEXT status code

Definition at line 1052 of file clemext.h.

CLEMEXTStatus clemext_xml_getName ( CLEMEXTXMLHandle  xml,
char *  buffer,
size_t  buffer_size,
size_t *  data_size 
)
inline

Called by the module to return the name of the XML element

Parameters
xmlthe element represented by its CLEMEXTXMLHandle
bufferbuffer to receive the result
buffer_sizethe current size of the buffer in bytes
data_sizepointer to a value set to the number of bytes required to store the result in a buffer
Returns
CLEMEXT status code

Definition at line 991 of file clemext.h.

CLEMEXTStatus clemext_xml_getTextIterator ( CLEMEXTXMLHandle  xml,
CLEMEXTXMLIteratorHandle *  iterator 
)
inline

Called by the module to open an iterator on the character data contained within an element

Parameters
xmlthe parent element represented by its CLEMEXTXMLHandle
iteratorpointer to an iterator handle, on success set to point to the new iterator
See also
CLEMEXTXMLIteratorHandle
CLEMEXTXMLIterator
Returns
CLEMEXT status code

Definition at line 1071 of file clemext.h.

CLEMEXTStatus clemext_xml_hasAttribute ( CLEMEXTXMLHandle  xml,
const char *  name,
int *  result 
)
inline

Called by the module to check whether an element has a named attribute

Parameters
xmlthe element represented by its CLEMEXTXMLHandle
namethe name of the attribute to test
resultpointer to an integer which is set to 1 if the attribute is present, 0 otherwise
Returns
CLEMEXT status code

Definition at line 1032 of file clemext.h.

CLEMEXTStatus clemext_xml_removeAttribute ( CLEMEXTXMLHandle  xml,
const char *  attribute_name 
)
inline

Called by the module to remove an attribute from an XML element

Parameters
xmlthe element represented by its CLEMEXTXMLHandle
attribute_namethe name of the attribute to remove
Returns
status code

Definition at line 1103 of file clemext.h.

CLEMEXTStatus clemext_xmliterator_close ( CLEMEXTXMLIteratorHandle  iterator)
inline

Called by the module to close the iterator

Parameters
iteratorthe iterator (pointer to CLEMEXTXMLIterator pointer)
Returns
status code

Definition at line 1198 of file clemext.h.

CLEMEXTStatus clemext_xmliterator_deleteCurrentItem ( CLEMEXTXMLIteratorHandle  iterator)
inline

Called by the module to delete the last item returned by clemext_xmliterator_nextItem from its parent

See also
clemext_xmliterator_nextItem
Parameters
iteratorthe iterator (pointer to CLEMEXTXMLIterator pointer)
Returns
status code

Definition at line 1184 of file clemext.h.

CLEMEXTStatus clemext_xmliterator_hasMoreItems ( CLEMEXTXMLIteratorHandle  iterator,
int *  result 
)
inline

Called by the module to discover if the iterator has more items?

Parameters
iteratorthe iterator (pointer to CLEMEXTXMLIterator pointer)
resultpointer to integer set to 1 if more elements exist, 0 otherwise
Returns
status code

Definition at line 1151 of file clemext.h.

CLEMEXTStatus clemext_xmliterator_nextItem ( CLEMEXTXMLIteratorHandle  iterator,
void **  item 
)
inline

Called by the module to get the iterator's next item

Parameters
iteratorthe iterator (pointer to CLEMEXTXMLIterator pointer)
itempointer to a CLEMEXTXMLHandle to recieve the returned pointer (set to NULL if no more elements)
Returns
status code

Definition at line 1167 of file clemext.h.