12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- #ifndef _LSUP_TTL_PARSER_H
- #define _LSUP_TTL_PARSER_H
- #include "codec.h"
- // Parser interface. Required because Lemon doesn't export these in the header
- // automatically.
- /*
- void *TTLParseAlloc( void*(*malloc)(size_t));
- void TTLParseFree(void *pParser, void(*free)(void*) );
- void TTLParse(void *pParser, int tokenCode, uint8_t *token, ...);
- void TTLParseTrace(FILE *stream, char *zPrefix);
- */
- /** @brief Parse a single term.
- *
- * @param[in] rep N-Triples representation as a character string.
- *
- * @param[in] map Unused: there is no namespace prefixing in N-triples. Kept
- * for interface compatibility. May be NULL.
- *
- * @param[out] term Term to be created from the string.
- *
- * @return LSUP_OK on success, LSUP_VALUE_ERR if the string is not valid
- * N-Triples syntax for a IRI ref, Literal or BNode.
- */
- LSUP_rc
- LSUP_ttl_parse_term (const char *rep, const LSUP_NSMap *map, LSUP_Term **term);
- /** @brief Parse a N-Triples document from a file handle.
- *
- * @param[in] doc N-Triples document.
- *
- * @param[out] Pointer to a graph handle to be created. The new graph will have
- * a random UUID URN.
- *
- * @param[out] ct If not NULL it is populated with the number of triples
- * parsed. This may be more than the triples in the resulting graph.
- *
- * @return LSUP_OK on success, LSUP_VALUE_ERR if a parsing error was
- * encountered. TODO Add line/char info for parsing error
- */
- LSUP_rc
- LSUP_ttl_parse_doc (FILE *stream, LSUP_Graph **gr, size_t *ct, char **err);
- #endif
|