summaryrefslogtreecommitdiffstats
path: root/src/sordi.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-04-27 23:27:41 +0000
committerDavid Robillard <d@drobilla.net>2011-04-27 23:27:41 +0000
commitbb2c564579a402a92dbaa513b6a4c9641523efc5 (patch)
tree7510282f5c74ad876dd2ea0d472b3108c3c4ac4b /src/sordi.c
parentb9dee426536cf2a21fa7976dd27b8839f349c534 (diff)
downloadsord-bb2c564579a402a92dbaa513b6a4c9641523efc5.tar.gz
sord-bb2c564579a402a92dbaa513b6a4c9641523efc5.tar.bz2
sord-bb2c564579a402a92dbaa513b6a4c9641523efc5.zip
Don't hide pointers behind typedefs.
git-svn-id: http://svn.drobilla.net/sord/trunk@91 3d64ff67-21c5-427c-a301-fe4f08042e5a
Diffstat (limited to 'src/sordi.c')
-rw-r--r--src/sordi.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/sordi.c b/src/sordi.c
index 48f3065..123752a 100644
--- a/src/sordi.c
+++ b/src/sordi.c
@@ -27,7 +27,7 @@ typedef struct {
SerdEnv* env;
SerdNode base_uri_node;
SerdURI base_uri;
- SordModel sord;
+ SordModel* sord;
} State;
int
@@ -61,7 +61,7 @@ file_sink(const void* buf, size_t len, void* stream)
}
static inline SerdNode
-serd_node_from_sord_node(const SordNode n)
+serd_node_from_sord_node(const SordNode* n)
{
size_t n_bytes = 0;
const uint8_t* buf = sord_node_get_string_counted(n, &n_bytes);
@@ -116,8 +116,8 @@ main(int argc, char** argv)
const uint8_t* input = (const uint8_t*)argv[a++];
- SordWorld world = sord_world_new();
- SordModel sord = sord_new(world, SORD_SPO|SORD_OPS, false);
+ SordWorld* world = sord_world_new();
+ SordModel* sord = sord_new(world, SORD_SPO|SORD_OPS, false);
bool success = sord_read_file(sord, input, NULL, NULL);
@@ -135,16 +135,16 @@ main(int argc, char** argv)
// Query
SordQuad pat = { 0, 0, 0, 0 };
- SordIter iter = sord_find(sord, pat);
+ SordIter* iter = sord_find(sord, pat);
for (; !sord_iter_end(iter); sord_iter_next(iter)) {
- SordQuad tup;
+ SordQuadConst tup;
sord_iter_get(iter, tup);
- SordNode s = tup[SORD_SUBJECT];
- SordNode p = tup[SORD_PREDICATE];
- SordNode o = tup[SORD_OBJECT];
- SerdNode ss = serd_node_from_sord_node(s);
- SerdNode sp = serd_node_from_sord_node(p);
- SerdNode so = serd_node_from_sord_node(o);
+ const SordNode* s = tup[SORD_SUBJECT];
+ const SordNode* p = tup[SORD_PREDICATE];
+ const SordNode* o = tup[SORD_OBJECT];
+ SerdNode ss = serd_node_from_sord_node(s);
+ SerdNode sp = serd_node_from_sord_node(p);
+ SerdNode so = serd_node_from_sord_node(o);
serd_writer_write_statement(
writer, NULL, &ss, &sp, &so, NULL, NULL);
}