David Robillard
d101d92694
Format all code with clang-format
2 years ago
David Robillard
8a93d0b3be
Avoid "else" after "break" and "return"
2 years ago
David Robillard
18949858d9
Fix test coverage
2 years ago
David Robillard
dddc46b13f
Allow setting the base URI of an Env to NULL
2 years ago
David Robillard
9eee20ada8
Add nonnull and nullable attributes to API
...
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.
2 years ago
David Robillard
bafa091fad
Add const, pure, and malloc function attributes
2 years ago
David Robillard
bb1a00aac2
Ensure that all free methods tolerate NULL
3 years ago
David Robillard
a9a6a4e417
Fix Wswitch-enum warnings
3 years ago
David Robillard
4b50e6ebda
Avoid copying nodes when equivalent prefixes are set
3 years ago
David Robillard
8353731836
Clean up includes
3 years ago
David Robillard
f0c5278f57
Fix integer conversion warnings
3 years ago
David Robillard
f0bc2210cd
Fix calloc argument order
5 years ago
David Robillard
275581c775
Remove redundant SERD_API declarations
5 years ago
David Robillard
480744aab7
Remove syntax assumptions from SerdEnv implementation
5 years ago
David Robillard
a0c483d9f1
Clarify errors returned by serd_env_expand()
5 years ago
David Robillard
902d171c5e
Fix various clang-tidy issues
6 years ago
David Robillard
b5d531a26d
Fix memory error
...
Introduced in 443f470383
7 years ago
David Robillard
443f470383
Fix construction of URIs with UTF-8 characters
7 years ago
David Robillard
31bf2e8147
Use Markdown in doc comments for better source readability.
...
git-svn-id: http://svn.drobilla.net/serd/trunk@471 490d8e77-9747-427b-9fa3-0b8f29cee8a0
9 years ago
David Robillard
272b0626ea
Update copyright dates.
...
git-svn-id: http://svn.drobilla.net/serd/trunk@467 490d8e77-9747-427b-9fa3-0b8f29cee8a0
9 years ago
David Robillard
cb9ee287d9
Remove unnecessary include.
...
git-svn-id: http://svn.drobilla.net/serd/trunk@464 490d8e77-9747-427b-9fa3-0b8f29cee8a0
9 years ago
David Robillard
85a7ec2b8e
Minor hardening.
...
git-svn-id: http://svn.drobilla.net/serd/trunk@459 490d8e77-9747-427b-9fa3-0b8f29cee8a0
9 years ago
David Robillard
c283edd147
Fix warnings: -Wshadow -Wpointer-arith -Wcast-align -Wstrict-prototypes -Wmissing-prototypes.
...
git-svn-id: http://svn.drobilla.net/serd/trunk@374 490d8e77-9747-427b-9fa3-0b8f29cee8a0
11 years ago
David Robillard
02a41f39b2
Add error callback to reader and writer for custom error reporting.
...
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
11 years ago
David Robillard
90830a30aa
Tolerate NULL URI parameter in serd_env_get_base_uri().
...
git-svn-id: http://svn.drobilla.net/serd/trunk@337 490d8e77-9747-427b-9fa3-0b8f29cee8a0
11 years ago
David Robillard
ae46d9dfd9
Print command name in serdi error messages.
...
Trim code.
git-svn-id: http://svn.drobilla.net/serd/trunk@313 490d8e77-9747-427b-9fa3-0b8f29cee8a0
11 years ago
David Robillard
e3dcfd6ac4
Fix compilation on sane platforms.
...
git-svn-id: http://svn.drobilla.net/serd/trunk@292 490d8e77-9747-427b-9fa3-0b8f29cee8a0
11 years ago
David Robillard
2d724f0e19
Support compilation as C++ under MSVC++
...
git-svn-id: http://svn.drobilla.net/serd/trunk@291 490d8e77-9747-427b-9fa3-0b8f29cee8a0
11 years ago
David Robillard
3c3e2de8a7
Update copyright dates.
...
git-svn-id: http://svn.drobilla.net/serd/trunk@285 490d8e77-9747-427b-9fa3-0b8f29cee8a0
11 years ago
David Robillard
e092ff0935
Lint.
...
git-svn-id: http://svn.drobilla.net/serd/trunk@283 490d8e77-9747-427b-9fa3-0b8f29cee8a0
11 years ago
David Robillard
f3c95977f6
Near 100% branch coverage.
...
git-svn-id: http://svn.drobilla.net/serd/trunk@277 490d8e77-9747-427b-9fa3-0b8f29cee8a0
11 years ago
David Robillard
b2effabfc5
100% test coverage.
...
git-svn-id: http://svn.drobilla.net/serd/trunk@276 490d8e77-9747-427b-9fa3-0b8f29cee8a0
11 years ago
David Robillard
15b033080c
Allow digit as first character of prefixed name suffix (match latest Turtle spec).
...
Improve env.c test coverage.
Add test case for ticket #734 .
git-svn-id: http://svn.drobilla.net/serd/trunk@271 490d8e77-9747-427b-9fa3-0b8f29cee8a0
11 years ago
David Robillard
ea1936a594
Move all #ifdef gunk to serd_internal.h.
...
Centralise file open and buffer allocation to localize platform tweaks.
git-svn-id: http://svn.drobilla.net/serd/trunk@244 490d8e77-9747-427b-9fa3-0b8f29cee8a0
11 years ago
David Robillard
c8e9bd0923
Tidy.
...
git-svn-id: http://svn.drobilla.net/serd/trunk@218 490d8e77-9747-427b-9fa3-0b8f29cee8a0
12 years ago
David Robillard
de5aa9e275
Add serd_env_set_prefix_from_strings for convenience.
...
Fix configure --debug.
git-svn-id: http://svn.drobilla.net/serd/trunk@217 490d8e77-9747-427b-9fa3-0b8f29cee8a0
12 years ago
David Robillard
95697f0761
Avoid writing illegal Turtle names as a result of URI qualifying ( fix #734 ).
...
git-svn-id: http://svn.drobilla.net/serd/trunk@210 490d8e77-9747-427b-9fa3-0b8f29cee8a0
12 years ago
David Robillard
463db7f4af
Add string measuring sanity check.
...
git-svn-id: http://svn.drobilla.net/serd/trunk@188 490d8e77-9747-427b-9fa3-0b8f29cee8a0
12 years ago
David Robillard
b92d598a22
Add test to ensure blank node IDs don't clash with generated IDs.
...
Add handle destructor parameter to serd_reader_new.
Add serd_reader_get_handle.
Rename serd_reader_set_blank_prefix to serd_reader_add_blank_prefix.
Rename serd_reader_read_file to serd_reader_read_file_handle.
Add new serd_reader_read_file that takes a path/URI parameter.
Add serdi -i option to select input syntax.
Add serdi -p and -c options to add/chop a prefix to/from blank IDs.
Add optional base_uri parameter to serd_env_new.
Add serd_writer_chop_blank_prefix.
Bump version to 0.3.0.
git-svn-id: http://svn.drobilla.net/serd/trunk@183 490d8e77-9747-427b-9fa3-0b8f29cee8a0
12 years ago
David Robillard
f07ed64923
Fix URI resolution off-by-one.
...
git-svn-id: http://svn.drobilla.net/serd/trunk@176 490d8e77-9747-427b-9fa3-0b8f29cee8a0
12 years ago
David Robillard
bc42e1c4d4
Use conventional string lengths not including NULL terminator
...
git-svn-id: http://svn.drobilla.net/serd/trunk@174 490d8e77-9747-427b-9fa3-0b8f29cee8a0
12 years ago
David Robillard
126e208fa5
Fix crash when setting an identical namespace prefix.
...
git-svn-id: http://svn.drobilla.net/serd/trunk@169 490d8e77-9747-427b-9fa3-0b8f29cee8a0
12 years ago
David Robillard
efd2a2ecb1
Record whether strings contains quotes or newlines for smart selection of long strings vs short strings in writer output.
...
git-svn-id: http://svn.drobilla.net/serd/trunk@167 490d8e77-9747-427b-9fa3-0b8f29cee8a0
12 years ago
David Robillard
64f006162d
Improve documentation and const-correctness.
...
git-svn-id: http://svn.drobilla.net/serd/trunk@165 490d8e77-9747-427b-9fa3-0b8f29cee8a0
12 years ago
David Robillard
246aa2aca7
Merge SerdEnv and SerdReadState.
...
git-svn-id: http://svn.drobilla.net/serd/trunk@163 490d8e77-9747-427b-9fa3-0b8f29cee8a0
12 years ago
David Robillard
3ef3583423
Use descriptive return codes instead of bool
...
git-svn-id: http://svn.drobilla.net/serd/trunk@154 490d8e77-9747-427b-9fa3-0b8f29cee8a0
12 years ago
David Robillard
68aa3540cb
Don't hide pointers in typedefs.
...
git-svn-id: http://svn.drobilla.net/serd/trunk@150 490d8e77-9747-427b-9fa3-0b8f29cee8a0
12 years ago
David Robillard
ecc3adb41d
Tidy.
...
git-svn-id: http://svn.drobilla.net/serd/trunk@145 490d8e77-9747-427b-9fa3-0b8f29cee8a0
12 years ago
David Robillard
78492aeaf5
Fix license header (awk oops).
...
git-svn-id: http://svn.drobilla.net/serd/trunk@143 490d8e77-9747-427b-9fa3-0b8f29cee8a0
12 years ago
David Robillard
0cdf509658
Switch to ISC license (legally equivalent to MIT license but with less obnoxious lawyer noise).
...
git-svn-id: http://svn.drobilla.net/serd/trunk@139 490d8e77-9747-427b-9fa3-0b8f29cee8a0
12 years ago