30 #ifndef _XQUERY_C_API_H 31 #define _XQUERY_C_API_H 41 #define XQC_VERSION_NUMBER 1 108 unsigned int (*
read)(XQC_InputStream *stream,
void *buffer,
unsigned int length);
116 void (*
free)(XQC_InputStream *stream);
156 void (*error)(XQC_ErrorHandler *handler, XQC_Error
error,
const char *error_uri,
157 const char *error_localname,
const char *description, XQC_Sequence *error_object);
225 XQC_Error (*create_context)(XQC_Implementation *implementation, XQC_StaticContext **context);
244 XQC_Error (*prepare)(XQC_Implementation *implementation,
const char *string,
245 const XQC_StaticContext *context, XQC_Expression **expression);
266 XQC_Error (*prepare_file)(XQC_Implementation *implementation, FILE *file,
267 const XQC_StaticContext *context, XQC_Expression **expression);
290 XQC_Error (*prepare_stream)(XQC_Implementation *implementation, XQC_InputStream *stream,
291 const XQC_StaticContext *context, XQC_Expression **expression);
300 XQC_Error (*parse_document)(XQC_Implementation *implementation,
302 const char *string, XQC_Sequence **sequence);
304 XQC_Error (*parse_document_file)(XQC_Implementation *implementation,
305 FILE *file, XQC_Sequence **sequence);
307 XQC_Error (*parse_document_stream)(XQC_Implementation *implementation,
308 XQC_InputStream *stream, XQC_Sequence **sequence);
317 XQC_Error (*create_empty_sequence)(XQC_Implementation *implementation,
318 XQC_Sequence **sequence);
319 XQC_Error (*create_singleton_sequence)(XQC_Implementation *implementation,
320 XQC_ItemType type,
const char *value,
321 XQC_Sequence **sequence);
322 XQC_Error (*create_string_sequence)(XQC_Implementation *implementation,
323 const char *values[],
unsigned int count,
324 XQC_Sequence **sequence);
325 XQC_Error (*create_integer_sequence)(XQC_Implementation *implementation,
326 int values[],
unsigned int count,
327 XQC_Sequence **sequence);
328 XQC_Error (*create_double_sequence)(XQC_Implementation *implementation,
329 double values[],
unsigned int count,
330 XQC_Sequence **sequence);
343 void *(*get_interface)(
const XQC_Implementation *implementation,
const char *name);
351 void (*
free)(XQC_Implementation *implementation);
421 (*create_child_context)(XQC_StaticContext *context, XQC_StaticContext **child_context);
435 (*declare_ns)(XQC_StaticContext *context,
const char *prefix,
const char *uri);
449 (*get_ns_by_prefix)(XQC_StaticContext *context,
const char *prefix,
const char **result_ns);
461 (*set_default_element_and_type_ns)(XQC_StaticContext *context,
const char *uri);
472 (*get_default_element_and_type_ns)(XQC_StaticContext *context,
const char **uri);
484 (*set_default_function_ns)(XQC_StaticContext *context,
const char *uri);
496 (*get_default_function_ns)(XQC_StaticContext *context,
const char **uri);
508 (*set_xpath_compatib_mode)(XQC_StaticContext *context, XQC_XPath1Mode mode);
520 (*get_xpath_compatib_mode)(XQC_StaticContext *context, XQC_XPath1Mode* mode);
532 (*set_construction_mode)(XQC_StaticContext *context, XQC_ConstructionMode mode);
544 (*get_construction_mode)(XQC_StaticContext *context, XQC_ConstructionMode* mode);
556 (*set_ordering_mode)(XQC_StaticContext *context, XQC_OrderingMode mode);
568 (*get_ordering_mode)(XQC_StaticContext *context, XQC_OrderingMode* mode);
581 (*set_default_order_empty_sequences)(XQC_StaticContext *context, XQC_OrderEmptyMode mode);
594 (*get_default_order_empty_sequences)(XQC_StaticContext *context, XQC_OrderEmptyMode* mode);
606 (*set_boundary_space_policy)(XQC_StaticContext *context, XQC_BoundarySpaceMode mode);
618 (*get_boundary_space_policy)(XQC_StaticContext *context, XQC_BoundarySpaceMode* mode);
631 (*set_copy_ns_mode)(XQC_StaticContext *context, XQC_PreserveMode preserve, XQC_InheritMode inherit);
645 (*get_copy_ns_mode)(XQC_StaticContext *context, XQC_PreserveMode* preserve, XQC_InheritMode* inherit);
657 (*set_base_uri)(XQC_StaticContext *context,
const char *base_uri);
669 (*get_base_uri)(XQC_StaticContext *context,
const char **base_uri);
671 XQC_Error (*set_error_handler)(XQC_StaticContext *context, XQC_ErrorHandler *handler);
672 XQC_Error (*get_error_handler)(
const XQC_StaticContext *context, XQC_ErrorHandler **handler);
683 void *(*get_interface)(
const XQC_StaticContext *context,
const char *name);
691 void (*
free)(XQC_StaticContext *context);
720 XQC_Error (*create_context)(
const XQC_Expression *expression, XQC_DynamicContext **context);
738 XQC_Error (*execute)(
const XQC_Expression *expression,
const XQC_DynamicContext *context, XQC_Sequence **sequence);
749 void *(*get_interface)(
const XQC_Expression *expression,
const char *name);
757 void (*
free)(XQC_Expression *expression);
779 XQC_Error (*set_variable)(XQC_DynamicContext *context,
const char *uri,
const char *name,
780 XQC_Sequence *value);
782 XQC_Error (*get_variable)(
const XQC_DynamicContext *context,
const char *uri,
const char *name,
783 XQC_Sequence **value);
802 XQC_Error (*set_context_item)(XQC_DynamicContext *context, XQC_Sequence *value);
804 XQC_Error (*get_context_item)(
const XQC_DynamicContext *context, XQC_Sequence **value);
811 XQC_Error (*set_implicit_timezone)(XQC_DynamicContext *context,
int timezone);
812 XQC_Error (*get_implicit_timezone)(
const XQC_DynamicContext *context,
int *timezone);
814 XQC_Error (*set_error_handler)(XQC_DynamicContext *context, XQC_ErrorHandler *handler);
815 XQC_Error (*get_error_handler)(
const XQC_DynamicContext *context, XQC_ErrorHandler **handler);
826 void *(*get_interface)(
const XQC_DynamicContext *context,
const char *name);
834 void (*
free)(XQC_DynamicContext *context);
871 XQC_Error (*item_type)(
const XQC_Sequence *sequence, XQC_ItemType *type);
886 XQC_Error (*type_name)(
const XQC_Sequence *sequence,
const char **uri,
const char **name);
901 XQC_Error (*string_value)(
const XQC_Sequence *sequence,
const char **value);
915 XQC_Error (*integer_value)(
const XQC_Sequence *sequence,
int *value);
929 XQC_Error (*double_value)(
const XQC_Sequence *sequence,
double *value);
945 XQC_Error (*node_name)(
const XQC_Sequence *sequence,
const char **uri,
const char **name);
958 void *(*get_interface)(
const XQC_Sequence *sequence,
const char *name);
966 void (*
free)(XQC_Sequence *sequence);
XQC_ItemType
Definition: xqc.h:160
The implementation does not implement that function.
Definition: xqc.h:64
The encoding of the query has not been recognized, or is not supported by the implementation.
Definition: xqc.h:69
XQC_ConstructionMode
Construction mode as defined in http://www.w3.org/TR/xquery/#static_context.
Definition: xqc.h:392
No error.
Definition: xqc.h:56
XQC_XPath1Mode
XPath 1.0 compatibility mode as defined in http://www.w3.org/TR/xquery/#static_context.
Definition: xqc.h:359
A dynamic error has occured while preparing or executing the query.
Definition: xqc.h:73
The ::XQC_StaticContext struct provides a way to specify values for the static context of the query t...
Definition: xqc.h:404
XQC_Error
The error enumeration used by all XQC functions to designate error condition.
Definition: xqc.h:55
XQC_PreserveMode
Preserve part of the Copy-namespace mode as defined in http://www.w3.org/TR/xquery/#static_context.
Definition: xqc.h:382
XQC_OrderEmptyMode
Default order for empty sequences as defined in http://www.w3.org/TR/xquery/#static_context.
Definition: xqc.h:370
An implementation specific error has occurred.
Definition: xqc.h:63
XQC_OrderingMode
Ordering mode as defined in http://www.w3.org/TR/xquery/#static_context.
Definition: xqc.h:364
The ::XQC_ErrorHandler struct is designed to be populated by users for the purpose of collecting more...
Definition: xqc.h:131
The ::XQC_Implementation struct provides factory functions for preparing queries. ...
Definition: xqc.h:207
void * user_data
Can be used for user specific purposes.
Definition: xqc.h:136
void(* error)(XQC_ErrorHandler *handler, XQC_Error error, const char *error_uri, const char *error_localname, const char *description, XQC_Sequence *error_object)
The function called when an error occurs.
Definition: xqc.h:156
A type error has occured while preparing or executing the query.
Definition: xqc.h:72
XQC_BoundarySpaceMode
Boundary-space policy as defined in http://www.w3.org/TR/xquery/#static_context.
Definition: xqc.h:387
A static error has occured while preparing the query.
Definition: xqc.h:71
XQC_InheritMode
Inherit part of the Copy-namespace mode as defined in http://www.w3.org/TR/xquery/#static_context.
Definition: xqc.h:376
The end of the XQC_Sequence has been reached.
Definition: xqc.h:57
The ::XQC_Expression struct represents a prepared query, and allows the user to execute that query an...
Definition: xqc.h:707
A serialization error has occured while serializing the output of a query.
Definition: xqc.h:74