|  |  |  | Raptor RDF Syntax Parsing and Serializing Library Manual |  | 
|---|---|---|---|---|
| Top | Description | ||||
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 of location (or NULL) | 
| Filename of location (or NULL) | |
| Line number of location (or <0 for no line) | |
| Column number of location (or <0 for no column) | |
| 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.
raptor_init() MUST have been called before calling this function.
Use raptor_print_locator_v2() if using raptor_world APIs.
| 
 | stream to print to | 
| 
 | 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.
raptor_init() MUST have been called before calling this function.
Use raptor_format_locator_v2() if using raptor_world APIs.
| 
 | buffer to store format | 
| 
 | size of buffer | 
| 
 | 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 | 
| 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 | 
| 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 | 
| 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 | 
| 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.
raptor_init() MUST have been called before calling this function.
Use raptor_locator_uri_v2() if using raptor_world APIs.
| 
 | locator | 
| Returns : | string URI, or NULL if there is no URI available |