XQC_ErrorHandler_s Struct Reference

The XQC_ErrorHandler struct is designed to be populated by users for the purpose of collecting more detailed error messages from an XQC implementation. More...

#include <zorba/zorbac.h>


Data Fields

void(* error )(XQC_ErrorHandler handler, XQUERY_ERROR error, const char *local_name, const char *description, const char *query_uri, unsigned int line, unsigned int column)
 The function is called when an error occurs.
void * user_data
 Can be used for user specific purposes.


Detailed Description

The XQC_ErrorHandler struct is designed to be populated by users for the purpose of collecting more detailed error messages from an XQC implementation.

An XQC_ErrorHandler can be set for a query using the XQC_Query::set_error_handler() function.

The XQC_ErrorHandler struct has no free() function pointer because the user remains responsible for freeing the resources associated with this struct.

Examples:

cerror.c.

Definition at line 2047 of file zorbac.h.


Field Documentation

void(* XQC_ErrorHandler_s::error)(XQC_ErrorHandler handler, XQUERY_ERROR error, const char *local_name, const char *description, const char *query_uri, unsigned int line, unsigned int column)

The function is called when an error occurs.

The function receives the components of the error as arguments. When this function returns, the implementation will exit query parsing or execution with the error enumeration value passed as an argument.

Parameters:
handler The XQC_ErrorHandler that this function pointer is a member of
error The error as a value of the XQUERY_ERROR enum.
local_name The local name of the error or an empty string if no local_name is given (e.g. for errors not defined in the spec).
description A detailed description of the error or an empty string if no description is available.
query_uri The uri of the query causing the error or an empty string if no uri is available for the query.
line The line number of the query where the error occured.
components The column number in the line in the query where the error occured.
Examples:
cerror.c.

void* XQC_ErrorHandler_s::user_data

Can be used for user specific purposes.

Definition at line 2074 of file zorbac.h.


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