aboutsummaryrefslogtreecommitdiffstats
path: root/src/env.c
AgeCommit message (Collapse)AuthorFilesLines
2023-12-02[WIP] Generalize node construction APIDavid Robillard1-13/+24
2023-12-02Add support for custom allocatorsDavid Robillard1-42/+92
This makes it explicit in the API where memory is allocated, and allows the user to provide a custom allocator to avoid the use of the default system allocator for whatever reason.
2023-12-02[WIP] Remove serd_new_resolved_uri()David Robillard1-21/+12
2023-12-02[WIP] Remove SERD_CURIE node datatype entirelyDavid Robillard1-59/+40
2023-12-02[WIP] Expand URIs in readerDavid Robillard1-0/+15
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.
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-02Use Zix attributes directlyDavid Robillard1-1/+2
2023-12-02Add assertions for all non-null pointers in the public APIDavid Robillard1-0/+7
2023-12-02Make serd_env_expand_in_place() take a string view instead of a nodeDavid Robillard1-6/+8
2023-12-02Add serd_env_copy() and serd_env_equals()David Robillard1-0/+47
2023-12-02Split up serd_env_expand() implementationDavid Robillard1-17/+35
2023-12-02Simplify SerdEnv APIDavid Robillard1-18/+33
2023-12-02Replace multiple stream callbacks with SerdEventDavid Robillard1-6/+10
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.
2023-12-02Simplify node construction APIDavid Robillard1-63/+34
2023-12-02Simplify URI API and implementationDavid Robillard1-19/+25
2023-12-02Make nodes opaqueDavid Robillard1-57/+68
2023-12-02Shorten node constructor namesDavid Robillard1-3/+3
2023-12-02Rename string view fieldsDavid Robillard1-9/+9
2023-12-02Use more human-readable status codesDavid Robillard1-5/+5
2023-12-02Split up public API headerDavid Robillard1-1/+1
2023-12-02Remove "get" from accessor namesDavid Robillard1-1/+1
2023-12-02Rename function types for consistencyDavid Robillard1-1/+1
2023-12-02Rename SerdURI to SerdURIViewDavid Robillard1-7/+7
2023-12-02Rename SerdChunk to SerdStringViewDavid Robillard1-5/+5
2023-12-02Use char* for strings in public APIDavid Robillard1-12/+9
The constant casting just makes user code a mess, for no benefit.
2023-12-02Remove useless character countingDavid Robillard1-7/+2
2023-09-22Fix potential realloc leaksDavid Robillard1-3/+6
2023-04-05Remove redundant null check in serd_env_set_base_uri()David Robillard1-2/+2
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-11-25Always handle the return value of serd_env_set_base_uri()David Robillard1-2/+5
2022-08-31Adopt REUSE machine-readable licensing standardDavid Robillard1-15/+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