General library facilities

## General library facilities General library facilities — Startup and shutdown, memory handling, version checks and misc functions. |

## Functions

void | rasqal_free_world ()
rasqal_world * | rasqal_new_world ()
int | rasqal_world_open ()
void | rasqal_world_set_log_handler ()
int | rasqal_world_set_warning_level ()
raptor_world * | rasqal_world_get_raptor ()
void | rasqal_world_set_raptor ()
const raptor_syntax_description * | rasqal_world_get_query_language_description ()
const raptor_syntax_description * | rasqal_world_get_query_results_format_description ()
char * | (*rasqal_generate_bnodeid_handler) ()
int | rasqal_world_set_generate_bnodeid_handler ()
int | rasqal_world_set_default_generate_bnodeid_parameters ()
const char * | rasqal_world_guess_query_results_format_name ()
int | rasqal_language_name_check ()
int | rasqal_languages_enumerate ()
void * | rasqal_alloc_memory ()
void * | rasqal_calloc_memory ()
void | rasqal_free_memory ()
rasqal_feature | rasqal_feature_from_uri ()
int | rasqal_feature_value_type ()
int | rasqal_features_enumerate ()
unsigned int | rasqal_get_feature_count ()

## Types and Values

typedef | rasqal_world
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
extern const char * const | rasqal_version_string
extern const char * const | rasqal_copyright_string
extern const char * const | rasqal_short_copyright_string
extern const char * const | rasqal_home_url_string
extern const char * const | rasqal_license_string
enum | rasqal_feature
#define | RASQAL_DEPRECATED
#define | RASQAL_VERSION
#define | RASQAL_VERSION_MAJOR
#define | RASQAL_VERSION_MINOR
#define | RASQAL_VERSION_RELEASE
#define | RASQAL_VERSION_STRING
#define | RASQAL_RAPTOR_VERSION

## Description

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.

## Functions

### rasqal_free_world ()

    void
    rasqal_free_world (rasqal_world *world);

### rasqal_new_world ()

    rasqal_world *
    rasqal_new_world (void);

#### Returns

### rasqal_world_open ()

    int
    rasqal_world_open (rasqal_world *world);

#### Returns

### rasqal_world_set_log_handler ()

    void
    rasqal_world_set_log_handler (rasqal_world *world,
                                  void *user_data,
                                  raptor_log_handler handler);

### rasqal_world_set_warning_level ()

    int
    rasqal_world_set_warning_level (rasqal_world *world,
                                    unsigned int warning_level);

#### Returns

### rasqal_world_get_raptor ()

    raptor_world *
    rasqal_world_get_raptor (rasqal_world *world);

#### Returns

### rasqal_world_set_raptor ()

    void
    rasqal_world_set_raptor (rasqal_world *world,
                             raptor_world *raptor_world_ptr);

### rasqal_world_get_query_language_description ()

    const raptor_syntax_description *
    rasqal_world_get_query_language_description
                                   (rasqal_world *world,
                                    unsigned int counter);

#### Returns

### rasqal_world_get_query_results_format_description ()

    const raptor_syntax_description *
    rasqal_world_get_query_results_format_description
                                   (rasqal_world *world,
                                    unsigned int counter);

#### Returns

### rasqal_generate_bnodeid_handler ()

    char *
    (*rasqal_generate_bnodeid_handler) (rasqal_world *world,
                                        void *user_data,
                                        unsigned char *user_bnodeid);

User handler used with `rasqal_world_set_generate_bnodeid_handler()` to set method for generating a blank node ID.

#### Parameters

world | world arg |
user_data | user data given to |
user_bnodeid | user blank node ID string passed in |

#### Returns

blank node ID string or NULL on failure.

### rasqal_world_set_generate_bnodeid_handler ()

    int
    rasqal_world_set_generate_bnodeid_handler
                                   (rasqal_world *world,
                                    void *user_data,
                                    rasqal_generate_bnodeid_handler handler);

#### Returns

### rasqal_world_set_default_generate_bnodeid_parameters ()

    int
    rasqal_world_set_default_generate_bnodeid_parameters
                                   (rasqal_world *world,
                                    char *prefix,
                                    int base);

#### Returns

### rasqal_world_guess_query_results_format_name ()

    const char *
    rasqal_world_guess_query_results_format_name
                                   (rasqal_world *world,
                                    raptor_uri *uri,
                                    const char *mime_type,
                                    const char *buffer,
                                    size_t len,
                                    const unsigned char *identifier);

#### Returns

### rasqal_language_name_check ()

    int
    rasqal_language_name_check (rasqal_world *world,
                                const char *name);

#### Returns

### rasqal_languages_enumerate ()

    int
    rasqal_languages_enumerate (rasqal_world *world,
                                unsigned int counter,
                                const char **name,
                                const char **label,
                                const unsigned char **uri_string);

`rasqal_languages_enumerate` is deprecated and should not be used in newly-written code.

#### Returns

### rasqal_alloc_memory ()

    void *
    rasqal_alloc_memory (size_t size);

#### Returns

### rasqal_calloc_memory ()

    void *
    rasqal_calloc_memory (size_t nmemb,
                          size_t size);

#### Returns

### rasqal_free_memory ()

    void
    rasqal_free_memory (void *ptr);

### rasqal_feature_from_uri ()

    rasqal_feature
    rasqal_feature_from_uri (rasqal_world *world,
                             raptor_uri *uri);

#### Returns

### rasqal_feature_value_type ()

    int
    rasqal_feature_value_type (const rasqal_feature feature);

#### Returns

### rasqal_features_enumerate ()

    int
    rasqal_features_enumerate (rasqal_world *world,
                               const rasqal_feature feature,
                               const char **name,
                               raptor_uri **uri,
                               const char **label);

#### Returns

### rasqal_get_feature_count ()

    unsigned int
    rasqal_get_feature_count (void);

#### Returns

## Types and Values

### rasqal_world

    rasqal_world* world;

Rasqal world class.

### rasqal_version_decimal

    extern const unsigned int rasqal_version_decimal;

Rasqal version as a decimal number.

Format: major * 10000 + minor * 100 + release

### rasqal_version_major

    extern const unsigned int rasqal_version_major;

Rasqal major version number.

### rasqal_version_minor

    extern const unsigned int rasqal_version_minor;

Rasqal minor version number.

### rasqal_version_release

    extern const unsigned int rasqal_version_release;

Rasqal release version number.

### rasqal_version_string

    extern const char * const rasqal_version_string;

Rasqal version as a string.

### rasqal_copyright_string

    extern const char * const rasqal_copyright_string;

Copyright string (multiple lines).

### rasqal_short_copyright_string

    extern const char * const rasqal_short_copyright_string;

Short copyright string (one line).

### rasqal_home_url_string

    extern const char * const rasqal_home_url_string;

Rasqal home page URL.

### rasqal_license_string

    extern const char * const rasqal_license_string;

Rasqal license string.

### enum rasqal_feature

Query features.

None currently defined.

#### Members

RASQAL_FEATURE_NO_NET | Deny network requests. |
RASQAL_FEATURE_RAND_SEED | Set `rand()` / `rand_r()` seed |
RASQAL_FEATURE_LAST | Internal. |

### RASQAL_DEPRECATED

    #define RASQAL_DEPRECATED __attribute__((deprecated))

When defined before a function, indicates that the function has been deprecated and may be replaced in a future release. With some versions of gcc this may give a compilation warning.

### RASQAL_VERSION

    #define RASQAL_VERSION 933

Rasqal library version number

Format: major * 10000 + minor * 100 + release

### RASQAL_VERSION_MAJOR

    #define RASQAL_VERSION_MAJOR 0

Rasqal library major version

### RASQAL_VERSION_MINOR

    #define RASQAL_VERSION_MINOR 9

Rasqal library minor version

### RASQAL_VERSION_RELEASE

    #define RASQAL_VERSION_RELEASE 33

Rasqal library release

### RASQAL_VERSION_STRING

    #define RASQAL_VERSION_STRING "0.9.33"

Rasqal library version string

### RASQAL_RAPTOR_VERSION

    #define RASQAL_RAPTOR_VERSION 20015

Version of Raptor that Rasqal was configured against.