aboutsummaryrefslogtreecommitdiffstats
path: root/src/env.c
AgeCommit message (Collapse)AuthorFilesLines
2022-01-28Add custom allocator supportDavid Robillard1-28/+72
2022-01-28Update zix and make it a proper subprojectDavid Robillard1-0/+1
2022-01-28Make environments and sinks part of the worldDavid Robillard1-1/+12
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-28Use more human-readable status codesDavid Robillard1-3/+3
2022-01-28Add assertions for all non-null pointers in the public APIDavid Robillard1-0/+7
Clang issues warnings at build time based on the SERD_NONNULL annotations, which is a much better approach in general. However, it does not cover cases where the API is being used with another compiler, or without a compiler that can statically check things at all (such as Python or other dynamic language bindings). In those situations, getting a clear assertion message is a lot less confusing than a random crash somewhere in serd, and it makes it clear that the bug is in the caller, so I think it's worth the tedious verbosity.
2022-01-14Use Nodes in Env implementationDavid Robillard1-46/+58
2022-01-14Expose low-level node construction APIDavid Robillard1-12/+16
2022-01-14Remove serd_new_resolved_uri()David Robillard1-36/+36
2022-01-14Remove SERD_CURIE node datatype entirelyDavid Robillard1-45/+22
2022-01-14Make serd_env_expand_in_place() take a string view instead of a nodeDavid Robillard1-6/+8
2022-01-13Add 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.
2022-01-13Split up serd_env_expand() implementationDavid Robillard1-17/+35
2022-01-13Add serd_env_copy() and serd_env_equals()David Robillard1-0/+47
2022-01-13Simplify SerdEnv APIDavid Robillard1-18/+33
2022-01-13Replace multiple stream callbacks with SerdEventDavid Robillard1-4/+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.
2022-01-13Simplify node construction APIDavid Robillard1-58/+34
2022-01-13Simplify URI API and implementationDavid Robillard1-19/+24
2022-01-13Make nodes opaqueDavid Robillard1-57/+67
2022-01-13Shorten node constructor namesDavid Robillard1-3/+3
2022-01-13Remove redundant null check in serd_env_set_base_uri()David Robillard1-1/+1
The env parameter here is declared as nonnull in the API, so it is an error to call it with NULL (which clang can statically flag as a warning).
2022-01-13Remove "get" from accessor namesDavid Robillard1-1/+1
2022-01-13Rename function types for consistencyDavid Robillard1-1/+1
2022-01-13Rename SerdURI to SerdURIViewDavid Robillard1-7/+7
2022-01-13Rename SerdChunk to SerdStringViewDavid Robillard1-5/+5
2022-01-13Use char* for strings in public APIDavid Robillard1-12/+9
The constant casting just makes user code a mess, for no benefit.
2022-01-13Remove useless character countingDavid Robillard1-7/+2
2021-06-30Make node qualify and expand functions tolerate a null EnvDavid Robillard1-0/+12
This is convenient in places where you don't necessarily need an Env, since these methods will work the same as with an empty Env.
2021-05-31Make most function parameters constDavid Robillard1-20/+28
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-31Remove "static inline" for functions in implementation filesDavid Robillard1-1/+1
This is just noise since these are static functions local to a C compilation unit.
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