aboutsummaryrefslogtreecommitdiffstats
path: root/src/reader.c
AgeCommit message (Collapse)AuthorFilesLines
2023-12-02[WIP] Move SerdEnv mutation from writer to readerDavid Robillard1-0/+3
Writing having side-effects seems questionable in general, and this prepares things for expanding URIs in the reader.
2023-12-02Leave statement caret at the start of literalsDavid Robillard1-4/+13
This allows a precise location to be reported for errors within literals, by adding the offset of the error in the literal to the caret. This will be used to report nice errors for things like regular expressions and supported XSD datatypes.
2023-12-02[WIP] Add extensible logging APIDavid Robillard1-2/+5
2023-12-02[WIP] Add support for reading and writing variablesDavid Robillard1-0/+1
[WIP] Command line option, move later? This adds a reader flag and serdi option for extending a syntax with support for SPARQL-like variables, for storing things like patterns or simple queries.
2023-12-02Simplify input stream APIDavid Robillard1-64/+41
2023-12-02Separate Turtle and TriG reading codeDavid Robillard1-5/+30
2023-12-02Factor out NQuads readerDavid Robillard1-2/+4
2023-12-02Factor out NTriples readerDavid Robillard1-3/+39
2023-12-02Make r_err take a single line without trailing newlineDavid Robillard1-2/+2
Towards having an actual logging (rather than printing) mechanism.
2023-12-02Add assertions for all non-null pointers in the public APIDavid Robillard1-0/+14
2023-12-02Be precise about the meaning of node "length" and "size"David Robillard1-7/+9
2023-12-02Align nodes on the reader stackDavid Robillard1-2/+2
2023-12-02Replace serd_reader_set_strict() with SerdReaderFlagsDavid Robillard1-7/+2
2023-12-02Handle read errors more preciselyDavid Robillard1-1/+16
2023-12-02Split up serd_internal.hDavid Robillard1-1/+1
2023-12-02Add a set of limits to the worldDavid Robillard1-2/+2
The idea here is to remove the burden of passing things around like stack sizes (where most users don't care and will be happy with a reasonably large default) and keeping the call sites to things like serd_reader_new() clean. The cost is a bit more state, so it's both more powerful and more potentially flaky, since changing the limits has action at a distance that isn't clear from the call site. I think it's worth it for the cleaner API in the common case, and the much better forward compatibility.
2023-12-02Simplify statement flagsDavid Robillard1-1/+1
2023-12-02Add SerdStatementDavid Robillard1-2/+6
2023-12-02Add SerdCaretDavid Robillard1-13/+18
2023-12-02Remove serd_reader_set_default_graph()David Robillard1-22/+7
2023-12-02Move fopen wrapper to worldDavid Robillard1-1/+1
2023-12-02Move error handling to worldDavid Robillard1-1/+2
2023-12-02Add SerdWorld for shared library stateDavid Robillard1-11/+4
2023-12-02Improve reader error handlingDavid Robillard1-0/+4
2023-12-02Zero node padding before passing to reader sinksDavid Robillard1-0/+4
2023-12-02Simplify stack management by popping in bulk at higher levelsDavid Robillard1-27/+7
Since all memory used by the reader is POD in the stack, there is no benefit to forcing code to explicitly pop everything pushed to the stack, since any function can record an offset and pop back down to it regardless of what its callers pushed if it knows that it does not need those items. This is slightly more efficient (due to avoiding many pop calls), but also more resilient since "leaks" at deeper levels of recursion get nuked by some caller regardless of what was pushed. This should help prevent future regressions like f6437f606 (Fix memory consumption when reading documents).
2023-12-02Use a fixed-size reader stackDavid Robillard1-35/+49
2023-12-02Simplify reader interfaceDavid Robillard1-117/+49
2023-12-02Add SerdSink interface and hide implementationsDavid Robillard1-36/+15
2023-12-02Bring read/write interface closer to the C standardDavid Robillard1-4/+4
2023-12-02Merge datatype/language into nodeDavid Robillard1-8/+2
This moves closer to the sord API, and is more convenient in most cases.
2023-12-02Simplify URI API and implementationDavid Robillard1-1/+1
2023-12-02Make nodes opaqueDavid Robillard1-22/+20
2023-12-02Use more human-readable status codesDavid Robillard1-4/+4
2023-12-02Split up public API headerDavid Robillard1-0/+4
2023-12-02Remove "get" from accessor namesDavid Robillard1-1/+1
2023-12-02Rename function types for consistencyDavid Robillard1-13/+13
2023-12-02Rename SerdType to SerdNodeTypeDavid Robillard1-9/+9
The old name will be even more ambiguous with the increased scope.
2023-12-02Use char* for strings in public APIDavid Robillard1-23/+22
The constant casting just makes user code a mess, for no benefit.
2023-12-02Remove useless character countingDavid Robillard1-5/+5
2023-05-03Make serd_reader_read_chunk() work with NQuadsDavid Robillard1-1/+3
2023-05-03Remove redundant wrapper functionDavid Robillard1-7/+1
2023-02-04Fix clang and clang-tidy warnings on WindowsDavid Robillard1-1/+1
2022-11-25Always handle the return value of eat_byte_safe()David Robillard1-3/+3
2022-08-31Adopt REUSE machine-readable licensing standardDavid Robillard1-15/+2
2021-05-31Make most function parameters constDavid Robillard1-56/+68
More const never hurts in general, but in particular this allows the compiler to make better nullability deductions, which reduces the amount of manual nullability casting required.
2021-05-31Fix include orderDavid Robillard1-1/+2
2021-01-10Add missing includesDavid Robillard1-0/+2
2021-01-02Use email address instead of website for attributionDavid Robillard1-1/+1
2020-12-31Format all code with clang-formatDavid Robillard1-213/+216