SourceForge.net Logo
Public Attributes | List of all members
XQC_Expression_s Struct Reference

The XQC_Expression struct represents a prepared query, and allows the user to execute that query any number of times. More...

#include <xqc.h>

Public Attributes

XQC_Error(* create_context )(const XQC_Expression *expression, XQC_DynamicContext **context)
 Creates a dynamic context suitable for use in the execute() function. More...
 
XQC_Error(* execute )(const XQC_Expression *expression, const XQC_DynamicContext *context, XQC_Sequence **sequence)
 Executes the query represented by the XQC_Expression object using the values in the XQC_DynamicContext if provided. More...
 
void *(* get_interface )(const XQC_Expression *expression, const char *name)
 Called to retrieve an implementation specific interface. More...
 
void(* free )(XQC_Expression *expression)
 Called to free the resources associated with the XQC_Expression. More...
 

Detailed Description

The XQC_Expression struct represents a prepared query, and allows the user to execute that query any number of times.

An XQC_Expression object is thread-safe and can be used by multiple threads of execution at the same time.

XQC_Expression objects are created by calling the XQC_Implementation::prepare(), XQC_Implementation::prepare_file() and XQC_Implementation::prepare_stream() functions. Once created, the user is responsible for freeing the object by calling the free() function. The XQC_Expression object should be freed before the XQC_Implementation object that created it.

Examples:
xqc-basic.c, and xqc-context-item.c.

Member Data Documentation

XQC_Error(* XQC_Expression_s::create_context)(const XQC_Expression *expression, XQC_DynamicContext **context)

Creates a dynamic context suitable for use in the execute() function.

The user is responsible for freeing the XQC_DynamicContext object returned by calling XQC_DynamicContext::free().

Parameters
expressionThe XQC_Expression that this function pointer is a member of.
[out]contextThe newly created XQC_DynamicContext object.
Return values
XQC_NO_ERROR
XQC_INTERNAL_ERROR
Examples:
xqc-context-item.c.
XQC_Error(* XQC_Expression_s::execute)(const XQC_Expression *expression, const XQC_DynamicContext *context, XQC_Sequence **sequence)

Executes the query represented by the XQC_Expression object using the values in the XQC_DynamicContext if provided.

An XQC_Sequence object is returned which can be used to examine the results of the query execution. The user is responsible for freeing the XQC_Sequence object returned by calling XQC_Sequence::free().

Parameters
expressionThe XQC_Expression that this function pointer is a member of.
contextThe dynamic context information to use when executing the query, or 0 to use the implementation defined default dynamic context.
[out]sequenceThe newly created XQC_Sequence object.
Return values
XQC_NO_ERROR
XQC_INTERNAL_ERROR
XQC_TYPE_ERROR
XQC_DYNAMIC_ERROR
Examples:
xqc-basic.c, and xqc-context-item.c.
void(* XQC_Expression_s::free)(XQC_Expression *expression)

Called to free the resources associated with the XQC_Expression.

Parameters
expressionThe XQC_Expression that this function pointer is a member of
Examples:
xqc-basic.c, and xqc-context-item.c.
void*(* XQC_Expression_s::get_interface)(const XQC_Expression *expression, const char *name)

Called to retrieve an implementation specific interface.

Parameters
expressionThe XQC_Expression that this function pointer is a member of.
nameThe name that identifies the interface to return
Returns
A pointer to the interface, or 0 if the name is not recognized by this implementation of XQC.

The documentation for this struct was generated from the following file: