aboutsummaryrefslogtreecommitdiffstats
path: root/src/string.c
AgeCommit message (Collapse)AuthorFilesLines
2023-12-02Use ZixAllocator directlyDavid Robillard1-8/+0
2023-12-02Add model and serd-sort utilityDavid Robillard1-0/+4
With all the new functionality, the complexity of the serd-pipe command-line interface is starting to push the limits of available flags. So, instead of grafting on further options to control a model, this commit adds a new tool, serd-sort, which acts somewhat like a stripped-down serd-pipe that stores statements in a model in memory. This keeps the complexity (including the user-facing complexity) of any one tool down, since other more focused tools can be used for streaming tasks in a pipeline. In other words, abandon Swissarmyknifeism, take a page from the Unix philosophy, and try to expose the model functionality to the command-line in a dedicated focused tool. The model implementation is tested by using this tool to run a subset of the usual test suites, and a special suite to test statement sorting.
2023-12-02Add statement filter sink and serd-filter toolDavid Robillard1-0/+2
2023-12-02Expose serd_strncasecmp in public APIDavid Robillard1-1/+17
2023-12-02Add support for custom allocatorsDavid Robillard1-4/+4
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] Preserve long or short quoting from input documentsDavid Robillard1-53/+0
2023-12-02Replace multiple stream callbacks with SerdEventDavid Robillard1-0/+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.
2023-12-02Clean up numeric node construction and access APIDavid Robillard1-14/+0
2023-12-02[WIP] Use exess for reading and writing numeric and binary literalsDavid Robillard1-60/+7
2023-12-02Use more human-readable status codesDavid Robillard1-14/+32
2023-12-02Split up public API headerDavid Robillard1-1/+4
2023-12-02Use char* for strings in public APIDavid Robillard1-18/+18
The constant casting just makes user code a mess, for no benefit.
2023-12-02Remove useless character countingDavid Robillard1-32/+18
2023-04-16Gracefully handle errors when writing textDavid Robillard1-0/+2
2023-04-05Improve writer error handlingDavid Robillard1-0/+2
2022-08-31Adopt REUSE machine-readable licensing standardDavid Robillard1-15/+2
2021-05-31Make most function parameters constDavid Robillard1-5/+7
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-2/+2
This is just noise since these are static functions local to a C compilation unit.
2021-05-31Remove default case from exhaustive switchDavid Robillard1-2/+0
2021-05-31Fix unannotated switch fallthroughsDavid Robillard1-3/+8
Unfortunately, clang does not support doing this with comments, requiring yet more preprocessor gunk.
2021-01-02Use email address instead of website for attributionDavid Robillard1-1/+1
2020-12-31Format all code with clang-formatDavid Robillard1-105/+118
2020-08-14Separate base64 implementationDavid Robillard1-49/+0
2020-08-14Clean up and separate internal headersDavid Robillard1-1/+1
2020-06-21Cleanup: Add missing default switch casesDavid Robillard1-0/+3
2020-06-21Clean up includesDavid Robillard1-1/+5
2019-10-27Fix integer conversion warningsDavid Robillard1-2/+6
2018-09-04Fix fallthrough warnings with GCC8David Robillard1-3/+8
2018-07-22Add serd_free for freeing memory allocated by serdDavid Robillard1-0/+6
2018-06-15Remove redundant SERD_API declarationsDavid Robillard1-4/+0
2017-07-09Add serd_node_from_substring()David Robillard1-9/+38
This allows creating nodes in-place from substrings of other strings to allow zero-copy serialization from existing delimited buffers.
2017-06-30Fix various clang-tidy issuesDavid Robillard1-2/+2
2016-07-09Fix construction of URIs with UTF-8 charactersDavid Robillard1-6/+9
2012-07-05Add error callback to reader and writer for custom error reporting.David Robillard1-1/+4
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-01Tolerate NULL endptr in serd_strtod.David Robillard1-1/+4
git-svn-id: http://svn.drobilla.net/serd/trunk@327 490d8e77-9747-427b-9fa3-0b8f29cee8a0
2012-02-20Fix collection parsing code to not leak stack space.David Robillard1-2/+1
Collection parsing now truly uses O(1) memory. Trim some fat. git-svn-id: http://svn.drobilla.net/serd/trunk@309 490d8e77-9747-427b-9fa3-0b8f29cee8a0
2012-01-16Support compilation as C++ under MSVC++David Robillard1-3/+3
git-svn-id: http://svn.drobilla.net/serd/trunk@291 490d8e77-9747-427b-9fa3-0b8f29cee8a0
2012-01-16Update copyright dates.David Robillard1-1/+1
git-svn-id: http://svn.drobilla.net/serd/trunk@285 490d8e77-9747-427b-9fa3-0b8f29cee8a0
2011-12-30Add serd_node_new_blob and serd_base64_decode for handling arbitrary binaryDavid Robillard1-0/+46
data via base64 encoding. git-svn-id: http://svn.drobilla.net/serd/trunk@280 490d8e77-9747-427b-9fa3-0b8f29cee8a0
2011-12-25Near 100% branch coverage.David Robillard1-1/+1
git-svn-id: http://svn.drobilla.net/serd/trunk@277 490d8e77-9747-427b-9fa3-0b8f29cee8a0
2011-12-24Test serd_strlen and serd_strerror.David Robillard1-0/+1
git-svn-id: http://svn.drobilla.net/serd/trunk@265 490d8e77-9747-427b-9fa3-0b8f29cee8a0
2011-12-19Add serd_strtod(), serd_node_new_decimal(), and serd_node_new_integer() forDavid Robillard1-0/+55
locale-independent numeric node parsing/serialising. git-svn-id: http://svn.drobilla.net/serd/trunk@260 490d8e77-9747-427b-9fa3-0b8f29cee8a0
2011-11-04Move serd_strlen and serd_strerror to string.c and document both in "String ↵David Robillard1-0/+58
Utilities" section. git-svn-id: http://svn.drobilla.net/serd/trunk@229 490d8e77-9747-427b-9fa3-0b8f29cee8a0
2011-01-24Remove SerdString cruft.David Robillard1-91/+0
git-svn-id: http://svn.drobilla.net/serd/trunk@54 490d8e77-9747-427b-9fa3-0b8f29cee8a0
2011-01-24Remove SerdString from public API in favour of more expressive (and not ↵David Robillard1-8/+27
necessarily inline with data payload) SerdNode. git-svn-id: http://svn.drobilla.net/serd/trunk@53 490d8e77-9747-427b-9fa3-0b8f29cee8a0
2011-01-20Add serd_string_free to API.David Robillard1-0/+7
git-svn-id: http://svn.drobilla.net/serd/trunk@13 490d8e77-9747-427b-9fa3-0b8f29cee8a0
2011-01-20Rework character reading functions to support reading multi-byte characters ↵David Robillard1-0/+65
(take a string dest parameter instead of returning uchar). Escape ntriples output. Pass all good read tests with output verification. git-svn-id: http://svn.drobilla.net/serd/trunk@8 490d8e77-9747-427b-9fa3-0b8f29cee8a0