## Prefixes Prefixes — XML QName-style prefixes made from a URI and a short text prefix. |

## Synopsis

                        rasqal_prefix;
    rasqal_prefix *     rasqal_new_prefix                   (rasqal_world *world,
                                                             const unsigned char *prefix,
                                                             raptor_uri *uri);
    void                rasqal_free_prefix                  (rasqal_prefix *p);
    int                 rasqal_prefix_print                 (rasqal_prefix *p,
                                                             FILE *fh);

## Description

Used inside a rasqal_query to declare syntax prefix abbreviations for URIs. Once a rasqal_query is constructed, these are for information only.

## Details

### rasqal_prefix

    typedef struct {
      rasqal_world* world;
      const char * prefix;
      raptor_uri* uri;
      int declared;
      int depth;
    } rasqal_prefix;

Namespace (prefix, uri) pair.

Includes internal flags used for marking when prefixes are declared and at what XML element depth when used in XML formats.

rasqal_world *`world`; | rasqal_world object
const char *`prefix`; | short prefix string
raptor_uri *`uri`; | URI associated with the prefix.
int `declared`; | Internal flag.
int `depth`; | Internal flag.

### rasqal_new_prefix ()

    rasqal_prefix *     rasqal_new_prefix                   (rasqal_world *world,
                                                             const unsigned char *prefix,
                                                             raptor_uri *uri);

Constructor - create a new rasqal_prefix. Takes ownership of prefix and uri.

`world` : | rasqal_world object
`prefix` : | Short prefix string to stand for URI (or NULL)
`uri` : | Name raptor_uri.
Returns : | a new rasqal_prefix or NULL on failure.

### rasqal_free_prefix ()

    void                rasqal_free_prefix                  (rasqal_prefix *p);

Destructor - destroy a rasqal_prefix object.

`p` : | rasqal_prefix object.

### rasqal_prefix_print ()

    int                 rasqal_prefix_print                 (rasqal_prefix *p,
                                                             FILE *fh);

Print a Rasqal prefix in a debug format.

The print debug format may change in any release.

`p` : | rasqal_prefix object.
`fh` : | The FILE* handle to print to.
Returns : | non-0 on failure