rasqal.h | rasqal.h | |||
---|---|---|---|---|
/* -*- Mode: c; c-basic-offset: 2 -*- | /* -*- Mode: c; c-basic-offset: 2 -*- | |||
* | * | |||
* rasqal.h - Rasqal RDF Query library interfaces and definition | * rasqal.h - Rasqal RDF Query library interfaces and definition | |||
* | * | |||
* $Id: rasqal.h 12095 2007-04-22 06:49:06Z dajobe $ | * $Id: rasqal.h 13206 2007-11-15 21:48:27Z dajobe $ | |||
* | * | |||
* Copyright (C) 2003-2007, David Beckett http://purl.org/net/dajobe/ | * Copyright (C) 2003-2007, David Beckett http://purl.org/net/dajobe/ | |||
* Copyright (C) 2003-2005, University of Bristol, UK http://www.bristol.ac .uk/ | * Copyright (C) 2003-2005, University of Bristol, UK http://www.bristol.ac .uk/ | |||
* | * | |||
* This package is Free Software and part of Redland http://librdf.org/ | * This package is Free Software and part of Redland http://librdf.org/ | |||
* | * | |||
* It is licensed under the following three licenses as alternatives: | * It is licensed under the following three licenses as alternatives: | |||
* 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version | * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version | |||
* 2. GNU General Public License (GPL) V2 or any newer version | * 2. GNU General Public License (GPL) V2 or any newer version | |||
* 3. Apache License, V2.0 or any newer version | * 3. Apache License, V2.0 or any newer version | |||
skipping to change at line 39 | skipping to change at line 39 | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
extern "C" { | extern "C" { | |||
#endif | #endif | |||
/** | /** | |||
* RASQAL_API: | * RASQAL_API: | |||
* | * | |||
* Macro for wrapping API function call declarations. | * Macro for wrapping API function call declarations. | |||
* | * | |||
*/ | */ | |||
#ifdef WIN32 | #ifndef RASQAL_API | |||
# ifdef RASQAL_STATIC | # ifdef WIN32 | |||
# define RASQAL_API | # ifdef __GNUC__ | |||
# else | # undef _declspec | |||
# ifdef RASQAL_INTERNAL | # define _declspec(x) __declspec(x) | |||
# define RASQAL_API _declspec(dllexport) | # endif | |||
# ifdef RASQAL_STATIC | ||||
# define RASQAL_API | ||||
# else | # else | |||
# define RASQAL_API _declspec(dllimport) | # ifdef RASQAL_INTERNAL | |||
# define RASQAL_API _declspec(dllexport) | ||||
# else | ||||
# define RASQAL_API _declspec(dllimport) | ||||
# endif | ||||
# endif | # endif | |||
# else | ||||
# define RASQAL_API | ||||
# endif | # endif | |||
#else | ||||
# define RASQAL_API | ||||
#endif | #endif | |||
/* Use gcc 3.1+ feature to allow marking of deprecated API calls. | /* Use gcc 3.1+ feature to allow marking of deprecated API calls. | |||
* This gives a warning during compiling. | * This gives a warning during compiling. | |||
*/ | */ | |||
#if ( __GNUC__ == 3 && __GNUC_MINOR__ > 0 ) || __GNUC__ > 3 | #if ( __GNUC__ == 3 && __GNUC_MINOR__ > 0 ) || __GNUC__ > 3 | |||
#ifdef __APPLE_CC__ | #ifdef __APPLE_CC__ | |||
/* OSX gcc cpp-precomp is broken */ | /* OSX gcc cpp-precomp is broken */ | |||
#define RASQAL_DEPRECATED | #define RASQAL_DEPRECATED | |||
#else | #else | |||
skipping to change at line 88 | skipping to change at line 94 | |||
RASQAL_API | RASQAL_API | |||
extern const char * const rasqal_version_string; | extern const char * const rasqal_version_string; | |||
RASQAL_API | RASQAL_API | |||
extern const unsigned int rasqal_version_major; | extern const unsigned int rasqal_version_major; | |||
RASQAL_API | RASQAL_API | |||
extern const unsigned int rasqal_version_minor; | extern const unsigned int rasqal_version_minor; | |||
RASQAL_API | RASQAL_API | |||
extern const unsigned int rasqal_version_release; | extern const unsigned int rasqal_version_release; | |||
RASQAL_API | RASQAL_API | |||
extern const unsigned int rasqal_version_decimal; | extern const unsigned int rasqal_version_decimal; | |||
RAPTOR_API | RASQAL_API | |||
extern const char * const rasqal_license_string; | extern const char * const rasqal_license_string; | |||
RAPTOR_API | RASQAL_API | |||
extern const char * const rasqal_home_url_string; | extern const char * const rasqal_home_url_string; | |||
/* Public structures */ | /* Public structures */ | |||
/** | /** | |||
* rasqal_query: | * rasqal_query: | |||
* | * | |||
* Rasqal query class. | * Rasqal query class. | |||
*/ | */ | |||
typedef struct rasqal_query_s rasqal_query; | typedef struct rasqal_query_s rasqal_query; | |||
skipping to change at line 286 | skipping to change at line 292 | |||
RASQAL_LITERAL_STRING, | RASQAL_LITERAL_STRING, | |||
RASQAL_LITERAL_BOOLEAN, | RASQAL_LITERAL_BOOLEAN, | |||
RASQAL_LITERAL_INTEGER, | RASQAL_LITERAL_INTEGER, | |||
RASQAL_LITERAL_DOUBLE, | RASQAL_LITERAL_DOUBLE, | |||
/* deprecated */ | /* deprecated */ | |||
RASQAL_LITERAL_FLOATING = RASQAL_LITERAL_DOUBLE, | RASQAL_LITERAL_FLOATING = RASQAL_LITERAL_DOUBLE, | |||
RASQAL_LITERAL_FLOAT, | RASQAL_LITERAL_FLOAT, | |||
RASQAL_LITERAL_DECIMAL, | RASQAL_LITERAL_DECIMAL, | |||
RASQAL_LITERAL_DATETIME, | RASQAL_LITERAL_DATETIME, | |||
/* internal */ | /* internal */ | |||
RASQAL_LITERAL_FIRST_XSD = RASQAL_LITERAL_BOOLEAN, | RASQAL_LITERAL_FIRST_XSD = RASQAL_LITERAL_STRING, | |||
/* internal */ | /* internal */ | |||
RASQAL_LITERAL_LAST_XSD = RASQAL_LITERAL_DATETIME, | RASQAL_LITERAL_LAST_XSD = RASQAL_LITERAL_DATETIME, | |||
RASQAL_LITERAL_PATTERN, | RASQAL_LITERAL_PATTERN, | |||
RASQAL_LITERAL_QNAME, | RASQAL_LITERAL_QNAME, | |||
RASQAL_LITERAL_VARIABLE, | RASQAL_LITERAL_VARIABLE, | |||
/* internal */ | /* internal */ | |||
RASQAL_LITERAL_LAST= RASQAL_LITERAL_VARIABLE | RASQAL_LITERAL_LAST= RASQAL_LITERAL_VARIABLE | |||
} rasqal_literal_type; | } rasqal_literal_type; | |||
/** | /** | |||
* rasqal_xsd_decimal: | ||||
* | ||||
* Rasqal XSD Decimal class. | ||||
*/ | ||||
typedef struct rasqal_xsd_decimal_s rasqal_xsd_decimal; | ||||
/** | ||||
* rasqal_literal: | * rasqal_literal: | |||
* @usage: Usage count. | * @usage: Usage count. | |||
* @type: Type of literal. | * @type: Type of literal. | |||
* @string: String form of literal for literal types UTF-8 string, pattern, qname, blank, double, float, decimal, datetime. | * @string: String form of literal for literal types UTF-8 string, pattern, qname, blank, double, float, decimal, datetime. | |||
* @string_len: Length of @string. | * @string_len: Length of @string. | |||
* @value: Alternate value content. | * @value: Alternate value content. | |||
* @language: Language for string literal type. | * @language: Language for string literal type. | |||
* @datatype: Datatype for string literal type. | * @datatype: Datatype for string literal type. | |||
* @flags: Flags for literal types | * @flags: Flags for literal types | |||
* | * | |||
skipping to change at line 326 | skipping to change at line 339 | |||
union { | union { | |||
/* integer and boolean types */ | /* integer and boolean types */ | |||
int integer; | int integer; | |||
/* double and float */ | /* double and float */ | |||
double floating; | double floating; | |||
/* uri (can be temporarily NULL if a qname, see flags below) */ | /* uri (can be temporarily NULL if a qname, see flags below) */ | |||
raptor_uri* uri; | raptor_uri* uri; | |||
/* variable */ | /* variable */ | |||
rasqal_variable* variable; | rasqal_variable* variable; | |||
/* decimal */ | ||||
rasqal_xsd_decimal* decimal; | ||||
} value; | } value; | |||
/* for string */ | /* for string */ | |||
const char *language; | const char *language; | |||
raptor_uri *datatype; | raptor_uri *datatype; | |||
/* various flags for literal types: | /* various flags for literal types: | |||
* pattern regex flags | * pattern regex flags | |||
* string datatype of qname | * string datatype of qname | |||
* uri qname of URI not yet expanded (temporary) | * uri qname of URI not yet expanded (temporary) | |||
*/ | */ | |||
const unsigned char *flags; | const unsigned char *flags; | |||
/* parent XSD type if any or RASQAL_LITERAL_UNKNOWN */ | ||||
rasqal_literal_type parent_type; | ||||
}; | }; | |||
/** | /** | |||
* rasqal_op: | * rasqal_op: | |||
* @RASQAL_EXPR_AND: Expression for AND(A, B) | * @RASQAL_EXPR_AND: Expression for AND(A, B) | |||
* @RASQAL_EXPR_OR: Expression for OR(A, B) | * @RASQAL_EXPR_OR: Expression for OR(A, B) | |||
* @RASQAL_EXPR_EQ: Expression for A equals B | * @RASQAL_EXPR_EQ: Expression for A equals B | |||
* @RASQAL_EXPR_NEQ: Expression for A not equals B. | * @RASQAL_EXPR_NEQ: Expression for A not equals B. | |||
* @RASQAL_EXPR_LT: Expression for A less than B. | * @RASQAL_EXPR_LT: Expression for A less than B. | |||
* @RASQAL_EXPR_GT: Expression for A greather than B. | * @RASQAL_EXPR_GT: Expression for A greather than B. | |||
skipping to change at line 380 | skipping to change at line 398 | |||
* @RASQAL_EXPR_ISURI: Expression for SPARQL ISURI(A). | * @RASQAL_EXPR_ISURI: Expression for SPARQL ISURI(A). | |||
* @RASQAL_EXPR_ISBLANK: Expression for SPARQL ISBLANK(A). | * @RASQAL_EXPR_ISBLANK: Expression for SPARQL ISBLANK(A). | |||
* @RASQAL_EXPR_ISLITERAL: Expression for SPARQL ISLITERAL(A). | * @RASQAL_EXPR_ISLITERAL: Expression for SPARQL ISLITERAL(A). | |||
* @RASQAL_EXPR_CAST: Expression for cast literal A to type B. | * @RASQAL_EXPR_CAST: Expression for cast literal A to type B. | |||
* @RASQAL_EXPR_ORDER_COND_ASC: Expression for SPARQL order condition ascen ding. | * @RASQAL_EXPR_ORDER_COND_ASC: Expression for SPARQL order condition ascen ding. | |||
* @RASQAL_EXPR_ORDER_COND_DESC: Expression for SPARQL order condition desc ending. | * @RASQAL_EXPR_ORDER_COND_DESC: Expression for SPARQL order condition desc ending. | |||
* @RASQAL_EXPR_GROUP_COND_ASC: Expression for LAQRS group condition ascend ing. | * @RASQAL_EXPR_GROUP_COND_ASC: Expression for LAQRS group condition ascend ing. | |||
* @RASQAL_EXPR_GROUP_COND_DESC: Expression for LAQRS group condition desce nding. | * @RASQAL_EXPR_GROUP_COND_DESC: Expression for LAQRS group condition desce nding. | |||
* @RASQAL_EXPR_COUNT: Expression for LAQRS select COUNT() | * @RASQAL_EXPR_COUNT: Expression for LAQRS select COUNT() | |||
* @RASQAL_EXPR_VARSTAR: Expression for LAQRS select Variable * | * @RASQAL_EXPR_VARSTAR: Expression for LAQRS select Variable * | |||
* @RASQAL_EXPR_SAMETERM: Expression for SPARQL sameTerm | ||||
* @RASQAL_EXPR_UNKNOWN: Internal | * @RASQAL_EXPR_UNKNOWN: Internal | |||
* @RASQAL_EXPR_LAST: Internal | * @RASQAL_EXPR_LAST: Internal | |||
* | * | |||
* Rasqal expression operators. A mixture of unary, binary and | * Rasqal expression operators. A mixture of unary, binary and | |||
* tertiary operators (string matches). Also includes casting and | * tertiary operators (string matches). Also includes casting and | |||
* two ordering operators from ORDER BY in SPARQL. | * two ordering operators from ORDER BY in SPARQL. | |||
*/ | */ | |||
typedef enum { | typedef enum { | |||
/* internal */ | /* internal */ | |||
RASQAL_EXPR_UNKNOWN, | RASQAL_EXPR_UNKNOWN, | |||
skipping to change at line 428 | skipping to change at line 447 | |||
RASQAL_EXPR_ISLITERAL, | RASQAL_EXPR_ISLITERAL, | |||
RASQAL_EXPR_CAST, | RASQAL_EXPR_CAST, | |||
RASQAL_EXPR_ORDER_COND_ASC, | RASQAL_EXPR_ORDER_COND_ASC, | |||
RASQAL_EXPR_ORDER_COND_DESC, | RASQAL_EXPR_ORDER_COND_DESC, | |||
RASQAL_EXPR_LANGMATCHES, | RASQAL_EXPR_LANGMATCHES, | |||
RASQAL_EXPR_REGEX, | RASQAL_EXPR_REGEX, | |||
RASQAL_EXPR_GROUP_COND_ASC, | RASQAL_EXPR_GROUP_COND_ASC, | |||
RASQAL_EXPR_GROUP_COND_DESC, | RASQAL_EXPR_GROUP_COND_DESC, | |||
RASQAL_EXPR_COUNT, | RASQAL_EXPR_COUNT, | |||
RASQAL_EXPR_VARSTAR, | RASQAL_EXPR_VARSTAR, | |||
RASQAL_EXPR_SAMETERM, | ||||
/* internal */ | /* internal */ | |||
RASQAL_EXPR_LAST= RASQAL_EXPR_VARSTAR | RASQAL_EXPR_LAST= RASQAL_EXPR_SAMETERM | |||
} rasqal_op; | } rasqal_op; | |||
/** | /** | |||
* rasqal_expression: | * rasqal_expression: | |||
* | * | |||
* expression (arg1), unary op (arg1), binary op (arg1,arg2), | * expression (arg1), unary op (arg1), binary op (arg1,arg2), | |||
* literal or variable | * literal or variable | |||
*/ | */ | |||
struct rasqal_expression_s { | struct rasqal_expression_s { | |||
int usage; /* reference count - 1 for itself */ | int usage; /* reference count - 1 for itself */ | |||
skipping to change at line 829 | skipping to change at line 849 | |||
rasqal_data_graph* rasqal_new_data_graph(raptor_uri* uri, raptor_uri* name_ uri, int flags); | rasqal_data_graph* rasqal_new_data_graph(raptor_uri* uri, raptor_uri* name_ uri, int flags); | |||
RASQAL_API | RASQAL_API | |||
void rasqal_free_data_graph(rasqal_data_graph* dg); | void rasqal_free_data_graph(rasqal_data_graph* dg); | |||
RASQAL_API | RASQAL_API | |||
void rasqal_data_graph_print(rasqal_data_graph* dg, FILE* fh); | void rasqal_data_graph_print(rasqal_data_graph* dg, FILE* fh); | |||
/** | /** | |||
* rasqal_compare_flags: | * rasqal_compare_flags: | |||
* @RASQAL_COMPARE_NOCASE: String comparisons are case independent. | * @RASQAL_COMPARE_NOCASE: String comparisons are case independent. | |||
* @RASQAL_COMPARE_XQUERY: XQuery comparsion rules apply. | * @RASQAL_COMPARE_XQUERY: XQuery comparsion rules apply. | |||
* @RASQAL_COMPARE_RDF: RDF Term comparsion rules apply. | ||||
* @RASQAL_COMPARE_URI: Allow comparison of URIs | ||||
* | * | |||
* Flags for rasqal_expression_evaluate() or rasqal_literal_compare(). | * Flags for rasqal_expression_evaluate() or rasqal_literal_compare(). | |||
*/ | */ | |||
typedef enum { | typedef enum { | |||
RASQAL_COMPARE_NOCASE = 1, | RASQAL_COMPARE_NOCASE = 1, | |||
RASQAL_COMPARE_XQUERY = 2 | RASQAL_COMPARE_XQUERY = 2, | |||
RASQAL_COMPARE_RDF = 4, | ||||
RASQAL_COMPARE_URI = 8 | ||||
} rasqal_compare_flags; | } rasqal_compare_flags; | |||
/* Expression class */ | /* Expression class */ | |||
RASQAL_API | RASQAL_API | |||
rasqal_expression* rasqal_new_0op_expression(rasqal_op op); | rasqal_expression* rasqal_new_0op_expression(rasqal_op op); | |||
RASQAL_API | RASQAL_API | |||
rasqal_expression* rasqal_new_1op_expression(rasqal_op op, rasqal_expressio n* arg); | rasqal_expression* rasqal_new_1op_expression(rasqal_op op, rasqal_expressio n* arg); | |||
RASQAL_API | RASQAL_API | |||
rasqal_expression* rasqal_new_2op_expression(rasqal_op op, rasqal_expressio n* arg1, rasqal_expression* arg2); | rasqal_expression* rasqal_new_2op_expression(rasqal_op op, rasqal_expressio n* arg1, rasqal_expression* arg2); | |||
RASQAL_API | RASQAL_API | |||
skipping to change at line 899 | skipping to change at line 923 | |||
* | * | |||
* Return value: 0 to truncate the visit | * Return value: 0 to truncate the visit | |||
*/ | */ | |||
typedef int (*rasqal_expression_visit_fn)(void *user_data, rasqal_expressio n *e); | typedef int (*rasqal_expression_visit_fn)(void *user_data, rasqal_expressio n *e); | |||
RASQAL_API | RASQAL_API | |||
int rasqal_expression_visit(rasqal_expression* e, rasqal_expression_visit_f n fn, void *user_data); | int rasqal_expression_visit(rasqal_expression* e, rasqal_expression_visit_f n fn, void *user_data); | |||
/* Literal class */ | /* Literal class */ | |||
RASQAL_API | RASQAL_API | |||
rasqal_literal* rasqal_new_integer_literal(rasqal_literal_type type, int in teger); | rasqal_literal* rasqal_new_integer_literal(rasqal_literal_type type, int in teger); | |||
RASQAL_API | ||||
rasqal_literal* rasqal_new_typed_literal(rasqal_literal_type type, const un | ||||
signed char* string); | ||||
RASQAL_API RASQAL_DEPRECATED | RASQAL_API RASQAL_DEPRECATED | |||
rasqal_literal* rasqal_new_floating_literal(double f); | rasqal_literal* rasqal_new_floating_literal(double f); | |||
RASQAL_API | RASQAL_API | |||
rasqal_literal* rasqal_new_double_literal(double d); | rasqal_literal* rasqal_new_double_literal(double d); | |||
RASQAL_API | RASQAL_API | |||
rasqal_literal* rasqal_new_float_literal(float f); | ||||
RASQAL_API | ||||
rasqal_literal* rasqal_new_uri_literal(raptor_uri* uri); | rasqal_literal* rasqal_new_uri_literal(raptor_uri* uri); | |||
RASQAL_API | RASQAL_API | |||
rasqal_literal* rasqal_new_pattern_literal(const unsigned char *pattern, co nst char *flags); | rasqal_literal* rasqal_new_pattern_literal(const unsigned char *pattern, co nst char *flags); | |||
RASQAL_API | RASQAL_API | |||
rasqal_literal* rasqal_new_string_literal(const unsigned char *string, cons t char *language, raptor_uri *datatype, const unsigned char *datatype_qname ); | rasqal_literal* rasqal_new_string_literal(const unsigned char *string, cons t char *language, raptor_uri *datatype, const unsigned char *datatype_qname ); | |||
RASQAL_API | RASQAL_API | |||
rasqal_literal* rasqal_new_simple_literal(rasqal_literal_type type, const u nsigned char *string); | rasqal_literal* rasqal_new_simple_literal(rasqal_literal_type type, const u nsigned char *string); | |||
RASQAL_API | RASQAL_API | |||
rasqal_literal* rasqal_new_boolean_literal(int value); | rasqal_literal* rasqal_new_boolean_literal(int value); | |||
RASQAL_API | RASQAL_API | |||
rasqal_literal* rasqal_new_variable_literal(rasqal_variable *variable); | rasqal_literal* rasqal_new_variable_literal(rasqal_variable *variable); | |||
RASQAL_API | RASQAL_API | |||
rasqal_literal* rasqal_new_decimal_literal(const unsigned char *decimal); | rasqal_literal* rasqal_new_decimal_literal(const unsigned char *string); | |||
RASQAL_API | ||||
rasqal_literal* rasqal_new_decimal_literal_from_decimal(const unsigned char | ||||
*string, rasqal_xsd_decimal* decimal); | ||||
RASQAL_API | RASQAL_API | |||
rasqal_literal* rasqal_new_literal_from_literal(rasqal_literal* l); | rasqal_literal* rasqal_new_literal_from_literal(rasqal_literal* l); | |||
RASQAL_API | RASQAL_API | |||
void rasqal_free_literal(rasqal_literal* l); | void rasqal_free_literal(rasqal_literal* l); | |||
RASQAL_API | RASQAL_API | |||
void rasqal_literal_print(rasqal_literal* l, FILE* fh); | void rasqal_literal_print(rasqal_literal* l, FILE* fh); | |||
RASQAL_API | RASQAL_API | |||
void rasqal_literal_print_type(rasqal_literal* l, FILE* fh); | void rasqal_literal_print_type(rasqal_literal* l, FILE* fh); | |||
RASQAL_API | RASQAL_API | |||
rasqal_variable* rasqal_literal_as_variable(rasqal_literal* l); | rasqal_variable* rasqal_literal_as_variable(rasqal_literal* l); | |||
RASQAL_API | RASQAL_API | |||
const unsigned char* rasqal_literal_as_string(rasqal_literal* l); | const unsigned char* rasqal_literal_as_string(rasqal_literal* l); | |||
RASQAL_API | RASQAL_API | |||
const unsigned char* rasqal_literal_as_string_flags(rasqal_literal* l, int flags, int *error); | const unsigned char* rasqal_literal_as_string_flags(rasqal_literal* l, int flags, int *error); | |||
RASQAL_API | RASQAL_API | |||
rasqal_literal* rasqal_literal_as_node(rasqal_literal* l); | rasqal_literal* rasqal_literal_as_node(rasqal_literal* l); | |||
RASQAL_API | ||||
raptor_uri* rasqal_literal_datatype(rasqal_literal* l); | ||||
RASQAL_API | ||||
rasqal_literal* rasqal_literal_value(rasqal_literal* l); | ||||
RASQAL_API | RASQAL_API | |||
int rasqal_literal_compare(rasqal_literal* l1, rasqal_literal* l2, int flag s, int *error); | int rasqal_literal_compare(rasqal_literal* l1, rasqal_literal* l2, int flag s, int *error); | |||
RASQAL_API | RASQAL_API | |||
int rasqal_literal_equals(rasqal_literal* l1, rasqal_literal* l2); | int rasqal_literal_equals(rasqal_literal* l1, rasqal_literal* l2); | |||
RASQAL_API | RASQAL_API | |||
rasqal_prefix* rasqal_new_prefix(const unsigned char* prefix, raptor_uri* u ri); | rasqal_prefix* rasqal_new_prefix(const unsigned char* prefix, raptor_uri* u ri); | |||
RASQAL_API | RASQAL_API | |||
void rasqal_free_prefix(rasqal_prefix* p); | void rasqal_free_prefix(rasqal_prefix* p); | |||
skipping to change at line 981 | skipping to change at line 1015 | |||
void rasqal_variable_set_value(rasqal_variable* v, rasqal_literal* l); | void rasqal_variable_set_value(rasqal_variable* v, rasqal_literal* l); | |||
/* memory functions */ | /* memory functions */ | |||
RASQAL_API | RASQAL_API | |||
void rasqal_free_memory(void *ptr); | void rasqal_free_memory(void *ptr); | |||
RASQAL_API | RASQAL_API | |||
void* rasqal_alloc_memory(size_t size); | void* rasqal_alloc_memory(size_t size); | |||
RASQAL_API | RASQAL_API | |||
void* rasqal_calloc_memory(size_t nmemb, size_t size); | void* rasqal_calloc_memory(size_t nmemb, size_t size); | |||
/* decimal functions */ | ||||
RASQAL_API | ||||
rasqal_xsd_decimal* rasqal_new_xsd_decimal(void); | ||||
RASQAL_API | ||||
void rasqal_free_xsd_decimal(rasqal_xsd_decimal* dec); | ||||
RASQAL_API | ||||
int rasqal_xsd_decimal_set_string(rasqal_xsd_decimal* dec, const char* stri | ||||
ng); | ||||
RASQAL_API | ||||
double rasqal_xsd_decimal_get_double(rasqal_xsd_decimal* dec); | ||||
RASQAL_API | ||||
char* rasqal_xsd_decimal_as_string(rasqal_xsd_decimal* dec); | ||||
RASQAL_API | ||||
char* rasqal_xsd_decimal_as_counted_string(rasqal_xsd_decimal* dec, size_t* | ||||
len_p); | ||||
RASQAL_API | ||||
int rasqal_xsd_decimal_set_long(rasqal_xsd_decimal* dec, long l); | ||||
RASQAL_API | ||||
int rasqal_xsd_decimal_set_double(rasqal_xsd_decimal* dec, double d); | ||||
RASQAL_API | ||||
int rasqal_xsd_decimal_print(rasqal_xsd_decimal* dec, FILE* stream); | ||||
RASQAL_API | ||||
int rasqal_xsd_decimal_add(rasqal_xsd_decimal* result, rasqal_xsd_decimal* | ||||
a, rasqal_xsd_decimal* b); | ||||
RASQAL_API | ||||
int rasqal_xsd_decimal_subtract(rasqal_xsd_decimal* result, rasqal_xsd_deci | ||||
mal* a, rasqal_xsd_decimal* b); | ||||
RASQAL_API | ||||
int rasqal_xsd_decimal_multiply(rasqal_xsd_decimal* result, rasqal_xsd_deci | ||||
mal* a, rasqal_xsd_decimal* b); | ||||
RASQAL_API | ||||
int rasqal_xsd_decimal_divide(rasqal_xsd_decimal* result, rasqal_xsd_decima | ||||
l* a, rasqal_xsd_decimal* b); | ||||
RASQAL_API | ||||
int rasqal_xsd_decimal_negate(rasqal_xsd_decimal* result, rasqal_xsd_decima | ||||
l* a); | ||||
RASQAL_API | ||||
int rasqal_xsd_decimal_compare(rasqal_xsd_decimal* a, rasqal_xsd_decimal* b | ||||
); | ||||
RASQAL_API | ||||
int rasqal_xsd_decimal_equals(rasqal_xsd_decimal* a, rasqal_xsd_decimal* b) | ||||
; | ||||
RASQAL_API | ||||
int rasqal_xsd_decimal_is_zero(rasqal_xsd_decimal* d); | ||||
/* rasqal_engine.c */ | /* rasqal_engine.c */ | |||
/** | /** | |||
* rasqal_triple_parts: | * rasqal_triple_parts: | |||
* @RASQAL_TRIPLE_SUBJECT: Subject present in a triple. | * @RASQAL_TRIPLE_SUBJECT: Subject present in a triple. | |||
* @RASQAL_TRIPLE_PREDICATE: Predicate present in a triple. | * @RASQAL_TRIPLE_PREDICATE: Predicate present in a triple. | |||
* @RASQAL_TRIPLE_OBJECT: Object present in a triple. | * @RASQAL_TRIPLE_OBJECT: Object present in a triple. | |||
* @RASQAL_TRIPLE_ORIGIN: Origin present in a triple. | * @RASQAL_TRIPLE_ORIGIN: Origin/graph present in a triple. | |||
* @RASQAL_TRIPLE_GRAPH: Alias for RASQAL_TRIPLE_ORIGIN | ||||
* @RASQAL_TRIPLE_SPO: Subject, Predicate and Object present in a triple. | ||||
* @RASQAL_TRIPLE_SPOG: Subject, Predicate, Object, Graph present in a trip | ||||
le. | ||||
* | * | |||
* Flags for parts of a triple. | * Flags for parts of a triple. | |||
*/ | */ | |||
typedef enum { | typedef enum { | |||
RASQAL_TRIPLE_SUBJECT = 1, | RASQAL_TRIPLE_SUBJECT = 1, | |||
RASQAL_TRIPLE_PREDICATE= 2, | RASQAL_TRIPLE_PREDICATE= 2, | |||
RASQAL_TRIPLE_OBJECT = 4, | RASQAL_TRIPLE_OBJECT = 4, | |||
RASQAL_TRIPLE_ORIGIN = 8 | RASQAL_TRIPLE_ORIGIN = 8, | |||
RASQAL_TRIPLE_GRAPH = RASQAL_TRIPLE_ORIGIN, | ||||
RASQAL_TRIPLE_SPO = RASQAL_TRIPLE_SUBJECT | RASQAL_TRIPLE_PREDICATE | ||||
| RASQAL_TRIPLE_OBJECT, | ||||
RASQAL_TRIPLE_SPOG = RASQAL_TRIPLE_SPO | RASQAL_TRIPLE_GRAPH | ||||
} rasqal_triple_parts; | } rasqal_triple_parts; | |||
/** | /** | |||
* rasqal_triples_match: | * rasqal_triples_match: | |||
* @user_data: User data pointer for factory methods. | * @user_data: User data pointer for factory methods. | |||
* @bind_match: The [4]array (s,p,o,origin) bindings against the current tr iple match only touching triple parts given. Returns parts that were bound or 0 on failure. | * @bind_match: The [4]array (s,p,o,origin) bindings against the current tr iple match only touching triple parts given. Returns parts that were bound or 0 on failure. | |||
* @next_match: Move to next match. | * @next_match: Move to next match. | |||
* @is_end: Check for end of triple match - return non-0 if is end. | * @is_end: Check for end of triple match - return non-0 if is end. | |||
* @finish: Finish triples match and destroy any allocated memory. | * @finish: Finish triples match and destroy any allocated memory. | |||
* | * | |||
End of changes. 23 change blocks. | ||||
18 lines changed or deleted | 107 lines changed or added | |||