aboutsummaryrefslogtreecommitdiffstats
path: root/include/serd
AgeCommit message (Collapse)AuthorFilesLines
2022-01-28Consolidate number support into a single "value" APIDavid Robillard1-124/+143
2022-01-28Remove datatype arguments from integer and base64 constructorsDavid Robillard1-14/+6
2022-01-28Add custom allocator supportDavid Robillard1-61/+201
2022-01-28Make environments and sinks part of the worldDavid Robillard1-8/+13
Although functions/components that require minimal pre-existing state are nice, these allocate memory and could potentially share resources. So, give them a pointer to a world which can be used to configure such things. In particular, this is working towards supporting custom allocators everywhere.
2022-01-28Fix handling of deferred write errors that happen when closingDavid Robillard1-4/+8
2022-01-28Use simpler names for I/O function typesDavid Robillard1-24/+27
2022-01-28Use more human-readable status codesDavid Robillard1-25/+28
2022-01-28Add "contextual" output optionDavid Robillard1-1/+10
This is mainly for developer or power-user cases, where one wants to look at some data for investigation or debugging. In such cases, it's common for the set of prefixes to be implicitly known (because they are baked in to the application, for example), so printing them just produces a large amount of redundant noise. That said, it can also be useful programmatically, because it allows several snippets to be written independently and ultimately concatenated (with a header to define the prefixes) without redundancy.
2022-01-28Simplify input stream APIDavid Robillard1-47/+70
More or less the same rationale as the previous commit, but for reading. This makes for nice symmetry with writing, at the cost of a slightly more annoying reader interface since the source doesn't know its block size or name.
2022-01-28Simplify output stream APIDavid Robillard1-52/+49
This makes the paging mechanism an internal detail once again. While it's conceptually elegant to simply have a single write interface and have the block dumper just be another implementation of that, unfortunately it is not practical. The inlining of serd_block_dumper_write() is a significant performance boost, because it avoids a non-inlinable function call of overhead per character. Compared to the SerdByteSink approach, this removes the burden and overhead of needing to dynamically allocate the structure itself.
2022-01-28Provide a full output stream implementation for SerdBufferDavid Robillard1-31/+46
Essentially replaces serd_buffer_sink_finish() with serd_buffer_close(), which makes writing to a buffer consistent with writing to a file or anything else.
2022-01-28Remove SERD_NO_INLINE_OBJECTSDavid Robillard1-2/+1
This seems like pointless complexity now, since it's easy to just write simply ordered statements yourself.
2022-01-28Put rdf:type properties first when pretty-printingDavid Robillard1-3/+11
This is a common convention in Turtle and TriG because the special "a" syntax for rdf type as the first property looks nice, makes things easier to read, and can be useful for streaming implementations because the type of the instance is known before reading its properties. Also significantly clean up the pretty-printing implementation in the process.
2022-01-28Make blank node prefixing automaticDavid Robillard1-25/+0
Though potentially useful, I don't think the complexity cost of the old interface (both to the implementation and to the user) is worth it. A special tool to transform blank node labels (for example with regular expressions) would be a better approach to this if it's ever needed in the future.
2022-01-28Split SERD_READ_VERBATIM into two more precise flagsDavid Robillard1-11/+20
Although the "verbatim" idea is nice and simple, more fine-grained control is necessary since these features (relative URI preservation and blank node label clash avoidance) are useful in different situations.
2022-01-28Add a reader flag to disable generated blank label avoidanceDavid Robillard1-0/+15
2022-01-28Add a close function to SerdByteSinkDavid Robillard1-4/+8
This simplifies everything by replacing special cases with a more general close function. A type is no longer stored in the structure, so the other constructors are now essentially syntactic sugar for the universal serd_byte_sink_new_function().
2022-01-28Expose serd_strncasecmp in public APIDavid Robillard1-0/+12
2022-01-28Preserve anonymous graph syntax in TriGDavid Robillard1-6/+7
2022-01-28Add version constants to public headerDavid Robillard1-0/+23
2022-01-28Make serd_writer_set_root_uri() take a string viewDavid Robillard1-2/+1
This is generally more convenient, and the node was just being copied anyway.
2022-01-28Simplify reader and writer flagsDavid Robillard1-9/+84
2022-01-14Add statement filteringDavid Robillard1-0/+35
2022-01-14Add support for converting literals to canonical formDavid Robillard1-0/+27
2022-01-14Add modelDavid Robillard1-1/+408
2022-01-14Avoid dynamic allocation when fetching interned nodesDavid Robillard1-14/+79
This is more or less a total rewrite of SerdNodes and the underlying ZixHash to make efficient use of the new node construction API.
2022-01-14Make StringView buffer non-nullableDavid Robillard1-2/+2
2022-01-14Expose low-level node construction APIDavid Robillard1-65/+322
2022-01-14Rename serd_new_simple_node() to serd_new_token()David Robillard1-5/+10
Things get confusing without a term for this concept (which is roughly "nodes that are not annoying to construct"), so "token" it is.
2022-01-14Preserve long or short quoting from input documentsDavid Robillard1-50/+45
2022-01-14Factor out serd_write_file_uri()David Robillard1-2/+25
2022-01-14Add serd_statement_matches()David Robillard1-0/+14
2022-01-14Add serd_node_compare()David Robillard1-0/+15
2022-01-14Add serd_node_from_syntax() and serd_node_to_syntax()David Robillard1-0/+48
2022-01-14Remove SERD_CURIE node datatype entirelyDavid Robillard1-34/+36
2022-01-14Expand URIs in readerDavid Robillard1-0/+3
This expands relative and prefixed URIs in the reader on the stack, rather than passing them to the caller to be dealt with. This pushes these context-full forms to the edge of the system as much as possible to minimise the headaches they can cause. Towards having stricter guarantees about nodes and eliminating the CURIE node type altogether.
2022-01-14Move SerdEnv mutation from writer to readerDavid Robillard1-5/+6
Writing having side-effects seems questionable in general, and this prepares things for expanding URIs in the reader.
2022-01-14Add extensible logging APIDavid Robillard1-23/+193
2022-01-13Add SERD_READ_EXACT_BLANKS flagDavid Robillard1-2/+3
This allows suppressing the blank node ID clashing mechanism to read blank IDs exactly as they appear in the input, even if they match the scheme used to generate blank node IDs internally.
2022-01-13Add support for parsing variablesDavid Robillard1-3/+14
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.
2022-01-13Make Reader always read from a ByteSourceDavid Robillard1-35/+86
2022-01-13Add serd_canonical_path()David Robillard1-0/+13
2022-01-13Make serd_uri_string_length() precise and add it to public APIDavid Robillard1-1/+15
2022-01-13Replace serd_reader_set_strict() with SerdReaderFlagsDavid Robillard1-11/+9
2022-01-13Handle read errors more preciselyDavid Robillard1-0/+1
2022-01-13Add serd_env_copy() and serd_env_equals()David Robillard1-0/+10
2022-01-13Make Writer always write to a ByteSinkDavid Robillard1-46/+72
2022-01-13Move I/O function prototypes to their own sectionDavid Robillard1-4/+10
2022-01-13Add empty syntax type for suppressing outputDavid Robillard1-8/+14
2022-01-13Replace SERD_WRITE_STRICT flag with SERD_WRITE_LAXDavid Robillard1-1/+1
The unset value for flags should represent the best default, which in this case is strict parsing. Lax parsing is the riskier opt-in option.