aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-12-29 20:05:00 -0500
committerDavid Robillard <d@drobilla.net>2018-12-31 11:37:49 -0500
commitbeb2eba61195d6ef838cd3bfd363ae74785aaff9 (patch)
treea1d201d9e324c3babc3d36023b1a31c4a0d2c969
parent201888d97b1382632fcd7b335c37030c8a4922d8 (diff)
downloadserd-beb2eba61195d6ef838cd3bfd363ae74785aaff9.tar.gz
serd-beb2eba61195d6ef838cd3bfd363ae74785aaff9.tar.bz2
serd-beb2eba61195d6ef838cd3bfd363ae74785aaff9.zip
Rename SerdStyle to SerdWriterFlags
-rw-r--r--serd/serd.h10
-rw-r--r--src/serdi.c4
-rw-r--r--src/writer.c18
3 files changed, 16 insertions, 16 deletions
diff --git a/serd/serd.h b/serd/serd.h
index 30ab1fc7..0346d32e 100644
--- a/serd/serd.h
+++ b/serd/serd.h
@@ -315,7 +315,7 @@ typedef struct {
} SerdURI;
/**
- Syntax style options.
+ Writer style options.
The style of the writer output can be controlled by ORing together
values from this enumeration. Note that some options are only supported
@@ -324,12 +324,12 @@ typedef struct {
*/
typedef enum {
SERD_STYLE_ASCII = 1 << 0, /**< Escape all non-ASCII characters. */
-} SerdStyle;
+} SerdWriterFlag;
/**
- Bitwise OR of SerdStyle values.
+ Bitwise OR of SerdWriterFlag values.
*/
-typedef uint32_t SerdStyleFlags;
+typedef uint32_t SerdWriterFlags;
/**
Free memory allocated by Serd.
@@ -1244,7 +1244,7 @@ SERD_API
SerdWriter*
serd_writer_new(SerdWorld* world,
SerdSyntax syntax,
- SerdStyleFlags style,
+ SerdWriterFlags style,
SerdEnv* env,
SerdWriteFunc ssink,
void* stream);
diff --git a/src/serdi.c b/src/serdi.c
index 789284c2..0b33ae77 100644
--- a/src/serdi.c
+++ b/src/serdi.c
@@ -193,14 +193,14 @@ main(int argc, char** argv)
SerdWorld* world = serd_world_new();
SerdEnv* env = serd_env_new(base);
- const SerdStyleFlags output_style = (ascii ? SERD_STYLE_ASCII : 0);
+ const SerdWriterFlags writer_flags = (ascii ? SERD_STYLE_ASCII : 0);
SerdByteSink* byte_sink = serd_byte_sink_new(
(SerdWriteFunc)fwrite, out_fd, bulk_write ? 4096 : 1);
SerdWriter* writer = serd_writer_new(world,
output_syntax,
- output_style,
+ writer_flags,
env,
(SerdWriteFunc)serd_byte_sink_write,
byte_sink);
diff --git a/src/writer.c b/src/writer.c
index ccae595b..48979423 100644
--- a/src/writer.c
+++ b/src/writer.c
@@ -103,7 +103,7 @@ struct SerdWriterImpl {
SerdWorld* world;
SerdSink iface;
SerdSyntax syntax;
- SerdStyleFlags style;
+ SerdWriterFlags flags;
SerdEnv* env;
SerdNode* root_node;
SerdURI root_uri;
@@ -194,7 +194,7 @@ write_character(SerdWriter* writer, const uint8_t* utf8, size_t* size)
break;
}
- if (!(writer->style & SERD_STYLE_ASCII)) {
+ if (!(writer->flags & SERD_STYLE_ASCII)) {
// Write UTF-8 character directly to UTF-8 output
return sink(utf8, *size, writer);
}
@@ -903,18 +903,18 @@ serd_writer_finish(SerdWriter* writer)
}
SerdWriter*
-serd_writer_new(SerdWorld* world,
- SerdSyntax syntax,
- SerdStyleFlags style,
- SerdEnv* env,
- SerdWriteFunc write_func,
- void* stream)
+serd_writer_new(SerdWorld* world,
+ SerdSyntax syntax,
+ SerdWriterFlags flags,
+ SerdEnv* env,
+ SerdWriteFunc write_func,
+ void* stream)
{
const WriteContext context = WRITE_CONTEXT_NULL;
SerdWriter* writer = (SerdWriter*)calloc(1, sizeof(SerdWriter));
writer->world = world;
writer->syntax = syntax;
- writer->style = style;
+ writer->flags = flags;
writer->env = env;
writer->root_node = NULL;
writer->root_uri = SERD_URI_NULL;