![]() |
![]() |
![]() |
Rasqal RDF Query Library Manual | ![]() |
---|---|---|---|---|
General library facilitiesGeneral library facilities — Startup and shutdown, memory handling, version checks and misc functions. |
extern const unsigned int rasqal_version_decimal; extern const unsigned int rasqal_version_major; extern const unsigned int rasqal_version_minor; extern const unsigned int rasqal_version_release; void rasqal_init (void); void rasqal_finish (void); enum rasqal_feature; int rasqal_language_name_check (const char *name); int rasqal_languages_enumerate (unsigned int counter, const char **name, const char **label, unsigned char **uri_string); void* rasqal_alloc_memory (size_t size); void* rasqal_calloc_memory (size_t nmemb, size_t size); void rasqal_free_memory (void *ptr); #define RASQAL_DEPRECATED
The functions in this section cover general library features such as startup and shutdown, checking the current library version and dealing with memory allocation and freeing. It also provides functions to enumerate and check the supported query languages, their names, labels and URI.
extern const unsigned int rasqal_version_decimal;
Library full version as a decimal integer.
See also rasqal_version_string.
extern const unsigned int rasqal_version_major;
Library major version number as a decimal integer.
extern const unsigned int rasqal_version_minor;
Library minor version number as a decimal integer.
extern const unsigned int rasqal_version_release;
Library release version number as a decimal integer.
void rasqal_init (void);
Initialise the rasqal library.
MUST be called before using any of the rasqal APIs.
void rasqal_finish (void);
Terminate the rasqal library.
Must be called to clean up any resources used by the library.
typedef enum { RASQAL_FEATURE_LAST } rasqal_feature;
Query features.
None currently defined.
int rasqal_language_name_check (const char *name);
Check name of a query language.
name : |
the query language name |
Returns : | non 0 if name is a known query language |
int rasqal_languages_enumerate (unsigned int counter, const char **name, const char **label, unsigned char **uri_string);
Get information on query languages.
counter : |
index into the list of syntaxes |
name : |
pointer to store the name of the syntax (or NULL) |
label : |
pointer to store syntax readable label (or NULL) |
uri_string : |
pointer to store syntax URI string (or NULL) |
Returns : | non 0 on failure of if counter is out of range |
void* rasqal_alloc_memory (size_t size);
Allocate memory inside rasqal.
Some systems require memory allocated in a library to
be deallocated in that library. This function allows
memory to be allocated inside the rasqal shared library
that can be freed inside rasqal either internally or via
rasqal_free_memory()
.
size : |
size of memory to allocate |
Returns : | the address of the allocated memory or NULL on failure |
void* rasqal_calloc_memory (size_t nmemb, size_t size);
Allocate zeroed array of items inside rasqal.
Some systems require memory allocated in a library to
be deallocated in that library. This function allows
memory to be allocated inside the rasqal shared library
that can be freed inside rasqal either internally or via
rasqal_free_memory()
.
nmemb : |
number of members |
size : |
size of item |
Returns : | the address of the allocated memory or NULL on failure |
void rasqal_free_memory (void *ptr);
Free memory allocated inside rasqal.
Some systems require memory allocated in a library to be deallocated in that library. This function allows memory allocated by rasqal to be freed.
ptr : |
memory pointer |