aboutsummaryrefslogtreecommitdiffstats
path: root/src/env.c
AgeCommit message (Collapse)AuthorFilesLines
2021-03-08Add support for parsing variablesDavid Robillard1-0/+1
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.
2021-03-08WIP: Make serd_env_expand() always return a node if it is not relativeDavid Robillard1-6/+25
The old interface was potentially faster, because it avoided unnecessary copies, but was annoying to use and problematic because nodes that don't need expansion were indistinguishable from nodes that failed to expand (like those that use undefined namespace prefixes). In the grand scheme of things, the potential performance improvement isn't worth it, and unexpected unexpanded nodes causes deep nightmarish problems, so just make serd_env_expand() copy the input if it doesn't need expansion to make the API simpler and safer.
2021-03-08Make it possible to allocate nodes with CURIE datatypesDavid Robillard1-1/+1
2021-03-08Remove double allocation in serd_env_set_prefix()David Robillard1-6/+7
2021-03-08Remove double allocations in serd_env_expand()David Robillard1-6/+14
2021-03-08Split up node expansion codeDavid Robillard1-32/+53
2021-03-08Clean up Env tests and behaviourDavid Robillard1-7/+7
2021-03-08Make const Env functions tolerant of NULLDavid Robillard1-1/+9
This is convenient in places where you don't necessarily need an Env, since in this case these methods work the same as if with an empty Env.
2021-03-08Add serd_env_copy() and serd_env_equals()David Robillard1-0/+42
2021-03-08Replace multiple stream callbacks with SerdEventDavid Robillard1-2/+2
This makes plumbing easier since everything goes through the same "stream" and only one callback is required to handling everything. It's also more easily extensible in case more event types need to be added in the future.
2021-03-08Simplify SerdEnv APIDavid Robillard1-11/+34
2021-03-08Simplify literal construction APIDavid Robillard1-3/+2
2021-03-08Expand datatype of literal nodes in serd_env_expand_nodeDavid Robillard1-2/+14
2021-03-07Use consistent naming for function typesDavid Robillard1-1/+1
2021-03-07Simplify node construction APIDavid Robillard1-51/+31
2021-03-07Simplify URI API and implementationDavid Robillard1-15/+17
2021-03-07Remove SERD_NOTHING node typeDavid Robillard1-1/+0
2021-03-07Make nodes opaqueDavid Robillard1-51/+60
2021-03-07Shorten node constructor namesDavid Robillard1-3/+3
2021-03-07Remove "get" from accessor namesDavid Robillard1-1/+1
2021-03-07Rename SerdURI to SerdURIViewDavid Robillard1-7/+7
2021-03-07Rename SerdChunk to SerdStringViewDavid Robillard1-5/+5
2021-03-07Use char* for strings in public APIDavid Robillard1-12/+9
The constant casting just makes user code a mess, for no benefit.
2021-03-07Remove useless character countingDavid Robillard1-7/+2
2021-01-02Use email address instead of website for attributionDavid Robillard1-1/+1
2020-12-31Format all code with clang-formatDavid Robillard1-168/+165
2020-12-31Avoid "else" after "break" and "return"David Robillard1-2/+7
2020-11-13Fix test coverageDavid Robillard1-9/+7
2020-11-13Allow setting the base URI of an Env to NULLDavid Robillard1-2/+6
2020-11-11Add nonnull and nullable attributes to APIDavid Robillard1-0/+1
This will warn if NULL is passed to any nonnull-annotated parameter, and is also supported by sanitizers which can check for violations at runtime. Unfortunately, it is currently only supported by clang. GCC has a similar feature in the nonnull attribute, but this has a different syntax (it's a function attribute) and is more dangerous since it is used by the optimizer to assume a null pointer is undefined behavior. This one just warns and still allows code to handle the situation gracefully, which I think is more appropriate for a library API. Note that this optimization behavior is not some unlikely edge case: switching these attributes to the GCC one will break release builds.
2020-11-10Add const, pure, and malloc function attributesDavid Robillard1-1/+1
2020-08-16Ensure that all free methods tolerate NULLDavid Robillard1-0/+4
2020-08-14Fix Wswitch-enum warningsDavid Robillard1-6/+10
2020-08-14Avoid copying nodes when equivalent prefixes are setDavid Robillard1-3/+5
2020-06-21Clean up includesDavid Robillard1-2/+5
2019-10-27Fix integer conversion warningsDavid Robillard1-2/+2
2018-09-30Fix calloc argument orderDavid Robillard1-1/+1
2018-06-15Remove redundant SERD_API declarationsDavid Robillard1-10/+0
2018-06-10Remove syntax assumptions from SerdEnv implementationDavid Robillard1-24/+1
2018-05-27Clarify errors returned by serd_env_expand()David Robillard1-3/+3
2017-06-30Fix various clang-tidy issuesDavid Robillard1-16/+16
2016-09-18Fix memory errorDavid Robillard1-2/+3
Introduced in 443f470383dc3acba0fde7b705e8ff81a7c49595
2016-07-09Fix construction of URIs with UTF-8 charactersDavid Robillard1-3/+3
2014-08-08Use Markdown in doc comments for better source readability.David Robillard1-1/+1
git-svn-id: http://svn.drobilla.net/serd/trunk@471 490d8e77-9747-427b-9fa3-0b8f29cee8a0
2014-08-08Update copyright dates.David Robillard1-1/+1
git-svn-id: http://svn.drobilla.net/serd/trunk@467 490d8e77-9747-427b-9fa3-0b8f29cee8a0
2014-08-05Remove unnecessary include.David Robillard1-1/+0
git-svn-id: http://svn.drobilla.net/serd/trunk@464 490d8e77-9747-427b-9fa3-0b8f29cee8a0
2014-04-11Minor hardening.David Robillard1-6/+6
git-svn-id: http://svn.drobilla.net/serd/trunk@459 490d8e77-9747-427b-9fa3-0b8f29cee8a0
2012-08-08Fix warnings: -Wshadow -Wpointer-arith -Wcast-align -Wstrict-prototypes ↵David Robillard1-4/+3
-Wmissing-prototypes. git-svn-id: http://svn.drobilla.net/serd/trunk@374 490d8e77-9747-427b-9fa3-0b8f29cee8a0
2012-07-05Add error callback to reader and writer for custom error reporting.David Robillard1-1/+1
Add -q option to serdi to suppress all non-data output, e.g. errors. Resolves #815. git-svn-id: http://svn.drobilla.net/serd/trunk@354 490d8e77-9747-427b-9fa3-0b8f29cee8a0
2012-03-18Tolerate NULL URI parameter in serd_env_get_base_uri().David Robillard1-1/+3
git-svn-id: http://svn.drobilla.net/serd/trunk@337 490d8e77-9747-427b-9fa3-0b8f29cee8a0