diff options
author | David Robillard <d@drobilla.net> | 2018-06-19 09:39:48 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-06-21 18:12:04 +0200 |
commit | 68a4f7cfbae546831e375e2097bd7efa57a1d565 (patch) | |
tree | a6f512f80a820d8c7a0adb7b5f86d2f23636771a | |
parent | d398b559d7487822e56d62cb2c0197b772e9b35b (diff) | |
download | serd-68a4f7cfbae546831e375e2097bd7efa57a1d565.tar.gz serd-68a4f7cfbae546831e375e2097bd7efa57a1d565.tar.bz2 serd-68a4f7cfbae546831e375e2097bd7efa57a1d565.zip |
Separate style enum from style flags types
-rw-r--r-- | serd/serd.h | 7 | ||||
-rw-r--r-- | src/serdi.c | 4 | ||||
-rw-r--r-- | src/writer.c | 2 | ||||
-rw-r--r-- | tests/serd_test.c | 4 |
4 files changed, 11 insertions, 6 deletions
diff --git a/serd/serd.h b/serd/serd.h index 7571c82b..6a5bd1a1 100644 --- a/serd/serd.h +++ b/serd/serd.h @@ -303,6 +303,11 @@ typedef enum { } SerdStyle; /** + Bitwise OR of SerdStyle values. +*/ +typedef uint32_t SerdStyleFlags; + +/** Free memory allocated by Serd. This function exists because some systems require memory allocated by a @@ -1199,7 +1204,7 @@ SERD_API SerdWriter* serd_writer_new(SerdWorld* world, SerdSyntax syntax, - SerdStyle style, + SerdStyleFlags style, SerdEnv* env, SerdWriteFunc ssink, void* stream); diff --git a/src/serdi.c b/src/serdi.c index e8970877..1c47aed3 100644 --- a/src/serdi.c +++ b/src/serdi.c @@ -206,7 +206,7 @@ main(int argc, char** argv) SerdWorld* world = serd_world_new(); SerdEnv* env = serd_env_new(base); - int output_style = 0; + SerdStyleFlags output_style = 0; if (output_syntax == SERD_NTRIPLES || ascii) { output_style |= SERD_STYLE_ASCII; } else if (output_syntax == SERD_TURTLE) { @@ -228,7 +228,7 @@ main(int argc, char** argv) SerdWriter* writer = serd_writer_new(world, output_syntax, - (SerdStyle)output_style, + output_style, env, (SerdWriteFunc)fwrite, out_fd); diff --git a/src/writer.c b/src/writer.c index 062cb4c5..4b6b5579 100644 --- a/src/writer.c +++ b/src/writer.c @@ -866,7 +866,7 @@ serd_writer_finish(SerdWriter* writer) SerdWriter* serd_writer_new(SerdWorld* world, SerdSyntax syntax, - SerdStyle style, + SerdStyleFlags style, SerdEnv* env, SerdWriteFunc ssink, void* stream) diff --git a/tests/serd_test.c b/tests/serd_test.c index ea555950..fff5aa56 100644 --- a/tests/serd_test.c +++ b/tests/serd_test.c @@ -623,7 +623,7 @@ test_writer(const char* const path) SerdWriter* writer = serd_writer_new(world, SERD_TURTLE, - (SerdStyle)0, + 0, env, (SerdWriteFunc)fwrite, fd); @@ -706,7 +706,7 @@ test_writer(const char* const path) // Test buffer sink SerdBuffer buffer = { NULL, 0 }; writer = serd_writer_new( - world, SERD_TURTLE, (SerdStyle)0, env, serd_buffer_sink, &buffer); + world, SERD_TURTLE, 0, env, serd_buffer_sink, &buffer); o = serd_new_uri("http://example.org/base"); assert(!serd_writer_set_base_uri(writer, o)); |