![]() |
![]() |
![]() |
Raptor RDF Syntax Parsing and Serializing Library Manual | ![]() |
---|---|---|---|---|
raptor_locator; void raptor_print_locator (FILE *stream, raptor_locator *locator); int raptor_format_locator (char *buffer, size_t length, raptor_locator *locator); int raptor_locator_line (raptor_locator *locator); int raptor_locator_column (raptor_locator *locator); int raptor_locator_byte (raptor_locator *locator); const char* raptor_locator_file (raptor_locator *locator); const char* raptor_locator_uri (raptor_locator *locator);
A small structure that can be optionally filled in when errors, warnings or other messages are generated and returned to user code.
typedef struct { raptor_uri *uri; const char *file; int line; int column; int byte; } raptor_locator;
Location information for an error, warning or information message.
raptor_uri *uri ; |
URI of location (or NULL) |
const char *file ; |
Filename of location (or NULL) |
int line ; |
Line number of location (or <0 for no line) |
int column ; |
Column number of location (or <0 for no column) |
int byte ; |
Byte number of location (or <0 for no byte) |
void raptor_print_locator (FILE *stream, raptor_locator *locator);
Print a raptor locator to a stream.
stream : |
stream to print to |
locator : |
raptor_locator to print |
int raptor_format_locator (char *buffer, size_t length, raptor_locator *locator);
Format a raptor locator as a string.
If buffer is NULL or length is insufficient for the size of the locator, returns the number of additional bytes required in the buffer to write the locator.
buffer : |
buffer to store format |
length : |
size of buffer |
locator : |
raptor_locator to format |
Returns : | 0 on success, >0 if additional bytes required in buffer, <0 on failure |
int raptor_locator_line (raptor_locator *locator);
Get line number from locator.
locator : |
locator |
Returns : | integer line number, or -1 if there is no line number available |
int raptor_locator_column (raptor_locator *locator);
Get column number from locator.
locator : |
locator |
Returns : | integer column number, or -1 if there is no column number available |
int raptor_locator_byte (raptor_locator *locator);
Get the locator byte offset from locator.
locator : |
locator |
Returns : | integer byte number, or -1 if there is no byte offset available |
const char* raptor_locator_file (raptor_locator *locator);
Get file name from locator.
locator : |
locator |
Returns : | string file name, or NULL if there is no filename available |
const char* raptor_locator_uri (raptor_locator *locator);
Get URI from locator.
Returns a pointer to a shared string version of the URI in the locator. This must be copied if it is needed.
locator : |
locator |
Returns : | string URI, or NULL if there is no URI available |