annotate osx/include/sord-0/sord/sord.h @ 103:629ca8f70812

Ranlib
author Chris Cannam <cannam@all-day-breakfast.com>
date Mon, 25 Mar 2013 16:24:21 +0000
parents dde06ec3df43
children
rev   line source
cannam@87 1 /*
cannam@87 2 Copyright 2011-2013 David Robillard <http://drobilla.net>
cannam@87 3
cannam@87 4 Permission to use, copy, modify, and/or distribute this software for any
cannam@87 5 purpose with or without fee is hereby granted, provided that the above
cannam@87 6 copyright notice and this permission notice appear in all copies.
cannam@87 7
cannam@87 8 THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
cannam@87 9 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
cannam@87 10 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
cannam@87 11 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
cannam@87 12 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
cannam@87 13 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
cannam@87 14 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
cannam@87 15 */
cannam@87 16
cannam@87 17 /**
cannam@87 18 @file sord.h API for Sord, a lightweight RDF model library.
cannam@87 19 */
cannam@87 20
cannam@87 21 #ifndef SORD_SORD_H
cannam@87 22 #define SORD_SORD_H
cannam@87 23
cannam@87 24 #include <stddef.h>
cannam@87 25 #include <stdint.h>
cannam@87 26 #include <stdio.h>
cannam@87 27
cannam@87 28 #include "serd/serd.h"
cannam@87 29
cannam@87 30 #ifdef SORD_SHARED
cannam@87 31 # ifdef _WIN32
cannam@87 32 # define SORD_LIB_IMPORT __declspec(dllimport)
cannam@87 33 # define SORD_LIB_EXPORT __declspec(dllexport)
cannam@87 34 # else
cannam@87 35 # define SORD_LIB_IMPORT __attribute__((visibility("default")))
cannam@87 36 # define SORD_LIB_EXPORT __attribute__((visibility("default")))
cannam@87 37 # endif
cannam@87 38 # ifdef SORD_INTERNAL
cannam@87 39 # define SORD_API SORD_LIB_EXPORT
cannam@87 40 # else
cannam@87 41 # define SORD_API SORD_LIB_IMPORT
cannam@87 42 # endif
cannam@87 43 #else
cannam@87 44 # define SORD_API
cannam@87 45 #endif
cannam@87 46
cannam@87 47 #ifdef __cplusplus
cannam@87 48 extern "C" {
cannam@87 49 #else
cannam@87 50 # include <stdbool.h>
cannam@87 51 #endif
cannam@87 52
cannam@87 53 /**
cannam@87 54 @defgroup sord Sord
cannam@87 55 A lightweight RDF model library.
cannam@87 56
cannam@87 57 Sord stores RDF (subject object predicate context) quads, where the context
cannam@87 58 may be omitted (to represent triples in the default graph).
cannam@87 59 @{
cannam@87 60 */
cannam@87 61
cannam@87 62 /**
cannam@87 63 Sord World.
cannam@87 64 The World represents all library state, including interned strings.
cannam@87 65 */
cannam@87 66 typedef struct SordWorldImpl SordWorld;
cannam@87 67
cannam@87 68 /**
cannam@87 69 Sord Model.
cannam@87 70
cannam@87 71 A model is an indexed set of Quads (i.e. it can contain several RDF
cannam@87 72 graphs). It may be searched using various patterns depending on which
cannam@87 73 indices are enabled.
cannam@87 74 */
cannam@87 75 typedef struct SordModelImpl SordModel;
cannam@87 76
cannam@87 77 /**
cannam@87 78 Model Inserter.
cannam@87 79
cannam@87 80 An inserter is used for writing statements to a model using the Serd sink
cannam@87 81 interface. This makes it simple to write to a model directly using a
cannam@87 82 SerdReader, or any other code that writes statements to a SerdStatementSink.
cannam@87 83 */
cannam@87 84 typedef struct SordInserterImpl SordInserter;
cannam@87 85
cannam@87 86 /**
cannam@87 87 Model Iterator.
cannam@87 88 */
cannam@87 89 typedef struct SordIterImpl SordIter;
cannam@87 90
cannam@87 91 /**
cannam@87 92 RDF Node.
cannam@87 93 A Node is a component of a Quad. Nodes may be URIs, blank nodes, or
cannam@87 94 (in the case of quad objects only) string literals. Literal nodes may
cannam@87 95 have an associate language or datatype (but not both).
cannam@87 96 */
cannam@87 97 typedef struct SordNodeImpl SordNode;
cannam@87 98
cannam@87 99 /**
cannam@87 100 Quad of nodes (a statement), or a quad pattern.
cannam@87 101
cannam@87 102 Nodes are ordered (S P O G). The ID of the default graph is 0.
cannam@87 103 */
cannam@87 104 typedef const SordNode* SordQuad[4];
cannam@87 105
cannam@87 106 /**
cannam@87 107 Index into a SordQuad.
cannam@87 108 */
cannam@87 109 typedef enum {
cannam@87 110 SORD_SUBJECT = 0, /**< Subject */
cannam@87 111 SORD_PREDICATE = 1, /**< Predicate (a.k.a. "key") */
cannam@87 112 SORD_OBJECT = 2, /**< Object (a.k.a. "value") */
cannam@87 113 SORD_GRAPH = 3 /**< Graph (a.k.a. "context") */
cannam@87 114 } SordQuadIndex;
cannam@87 115
cannam@87 116 /**
cannam@87 117 Type of a node.
cannam@87 118 */
cannam@87 119 typedef enum {
cannam@87 120 SORD_URI = 1, /**< URI */
cannam@87 121 SORD_BLANK = 2, /**< Blank node identifier */
cannam@87 122 SORD_LITERAL = 3 /**< Literal (string with optional lang or datatype) */
cannam@87 123 } SordNodeType;
cannam@87 124
cannam@87 125 /**
cannam@87 126 Indexing option.
cannam@87 127 */
cannam@87 128 typedef enum {
cannam@87 129 SORD_SPO = 1, /**< Subject, Predicate, Object */
cannam@87 130 SORD_SOP = 1 << 1, /**< Subject, Object, Predicate */
cannam@87 131 SORD_OPS = 1 << 2, /**< Object, Predicate, Subject */
cannam@87 132 SORD_OSP = 1 << 3, /**< Object, Subject, Predicate */
cannam@87 133 SORD_PSO = 1 << 4, /**< Predicate, Subject, Object */
cannam@87 134 SORD_POS = 1 << 5 /**< Predicate, Object, Subject */
cannam@87 135 } SordIndexOption;
cannam@87 136
cannam@87 137 /**
cannam@87 138 @name World
cannam@87 139 @{
cannam@87 140 */
cannam@87 141
cannam@87 142 /**
cannam@87 143 Create a new Sord World.
cannam@87 144 It is safe to use multiple worlds in one process, though no data
cannam@87 145 (e.g. nodes) can be shared between worlds, and this should be avoided if
cannam@87 146 possible for performance reasons.
cannam@87 147 */
cannam@87 148 SORD_API
cannam@87 149 SordWorld*
cannam@87 150 sord_world_new(void);
cannam@87 151
cannam@87 152 /**
cannam@87 153 Free @c world.
cannam@87 154 */
cannam@87 155 SORD_API
cannam@87 156 void
cannam@87 157 sord_world_free(SordWorld* world);
cannam@87 158
cannam@87 159 /**
cannam@87 160 Set a function to be called when errors occur.
cannam@87 161
cannam@87 162 The @p error_sink will be called with @p handle as its first argument. If
cannam@87 163 no error function is set, errors are printed to stderr.
cannam@87 164 */
cannam@87 165 SORD_API
cannam@87 166 void
cannam@87 167 sord_world_set_error_sink(SordWorld* world,
cannam@87 168 SerdErrorSink error_sink,
cannam@87 169 void* handle);
cannam@87 170
cannam@87 171 /**
cannam@87 172 @}
cannam@87 173 @name Node
cannam@87 174 @{
cannam@87 175 */
cannam@87 176
cannam@87 177 /**
cannam@87 178 Get a URI node from a string.
cannam@87 179
cannam@87 180 Note this function measures @c str, which is a common bottleneck.
cannam@87 181 Use sord_node_from_serd_node instead if @c str is already measured.
cannam@87 182 */
cannam@87 183 SORD_API
cannam@87 184 SordNode*
cannam@87 185 sord_new_uri(SordWorld* world, const uint8_t* uri);
cannam@87 186
cannam@87 187 /**
cannam@87 188 Get a URI node from a relative URI string.
cannam@87 189 */
cannam@87 190 SORD_API
cannam@87 191 SordNode*
cannam@87 192 sord_new_relative_uri(SordWorld* world,
cannam@87 193 const uint8_t* str,
cannam@87 194 const uint8_t* base_uri);
cannam@87 195
cannam@87 196 /**
cannam@87 197 Get a blank node from a string.
cannam@87 198
cannam@87 199 Note this function measures @c str, which is a common bottleneck.
cannam@87 200 Use sord_node_from_serd_node instead if @c str is already measured.
cannam@87 201 */
cannam@87 202 SORD_API
cannam@87 203 SordNode*
cannam@87 204 sord_new_blank(SordWorld* world, const uint8_t* str);
cannam@87 205
cannam@87 206 /**
cannam@87 207 Get a literal node from a string.
cannam@87 208
cannam@87 209 Note this function measures @c str, which is a common bottleneck.
cannam@87 210 Use sord_node_from_serd_node instead if @c str is already measured.
cannam@87 211 */
cannam@87 212 SORD_API
cannam@87 213 SordNode*
cannam@87 214 sord_new_literal(SordWorld* world,
cannam@87 215 SordNode* datatype,
cannam@87 216 const uint8_t* str,
cannam@87 217 const char* lang);
cannam@87 218
cannam@87 219 /**
cannam@87 220 Copy a node (obtain a reference).
cannam@87 221
cannam@87 222 Node that since nodes are interned and reference counted, this does not
cannam@87 223 actually create a deep copy of @c node.
cannam@87 224 */
cannam@87 225 SORD_API
cannam@87 226 SordNode*
cannam@87 227 sord_node_copy(const SordNode* node);
cannam@87 228
cannam@87 229 /**
cannam@87 230 Free a node (drop a reference).
cannam@87 231 */
cannam@87 232 SORD_API
cannam@87 233 void
cannam@87 234 sord_node_free(SordWorld* world, SordNode* node);
cannam@87 235
cannam@87 236 /**
cannam@87 237 Return the type of a node (SORD_URI, SORD_BLANK, or SORD_LITERAL).
cannam@87 238 */
cannam@87 239 SORD_API
cannam@87 240 SordNodeType
cannam@87 241 sord_node_get_type(const SordNode* node);
cannam@87 242
cannam@87 243 /**
cannam@87 244 Return the string value of a node.
cannam@87 245 */
cannam@87 246 SORD_API
cannam@87 247 const uint8_t*
cannam@87 248 sord_node_get_string(const SordNode* node);
cannam@87 249
cannam@87 250 /**
cannam@87 251 Return the string value of a node, and set @c len to its length.
cannam@87 252 */
cannam@87 253 SORD_API
cannam@87 254 const uint8_t*
cannam@87 255 sord_node_get_string_counted(const SordNode* node, size_t* len);
cannam@87 256
cannam@87 257 /**
cannam@87 258 Return the language of a literal node (or NULL).
cannam@87 259 */
cannam@87 260 SORD_API
cannam@87 261 const char*
cannam@87 262 sord_node_get_language(const SordNode* node);
cannam@87 263
cannam@87 264 /**
cannam@87 265 Return the datatype URI of a literal node (or NULL).
cannam@87 266 */
cannam@87 267 SORD_API
cannam@87 268 SordNode*
cannam@87 269 sord_node_get_datatype(const SordNode* node);
cannam@87 270
cannam@87 271 /**
cannam@87 272 Return the flags (string attributes) of a node.
cannam@87 273 */
cannam@87 274 SORD_API
cannam@87 275 SerdNodeFlags
cannam@87 276 sord_node_get_flags(const SordNode* node);
cannam@87 277
cannam@87 278 /**
cannam@87 279 Return true iff node can be serialised as an inline object.
cannam@87 280
cannam@87 281 More specifically, this returns true iff the node is the object field
cannam@87 282 of exactly one statement, and therefore can be inlined since it needn't
cannam@87 283 be referred to by name.
cannam@87 284 */
cannam@87 285 SORD_API
cannam@87 286 bool
cannam@87 287 sord_node_is_inline_object(const SordNode* node);
cannam@87 288
cannam@87 289 /**
cannam@87 290 Return true iff @c a is equal to @c b.
cannam@87 291
cannam@87 292 Note this is much faster than comparing the node's strings.
cannam@87 293 */
cannam@87 294 SORD_API
cannam@87 295 bool
cannam@87 296 sord_node_equals(const SordNode* a,
cannam@87 297 const SordNode* b);
cannam@87 298
cannam@87 299 /**
cannam@87 300 Return a SordNode as a SerdNode.
cannam@87 301
cannam@87 302 The returned node is shared and must not be freed or modified.
cannam@87 303 */
cannam@87 304 SORD_API
cannam@87 305 const SerdNode*
cannam@87 306 sord_node_to_serd_node(const SordNode* node);
cannam@87 307
cannam@87 308 /**
cannam@87 309 Create a new SordNode from a SerdNode.
cannam@87 310
cannam@87 311 The returned node must be freed using sord_node_free.
cannam@87 312 */
cannam@87 313 SORD_API
cannam@87 314 SordNode*
cannam@87 315 sord_node_from_serd_node(SordWorld* world,
cannam@87 316 SerdEnv* env,
cannam@87 317 const SerdNode* node,
cannam@87 318 const SerdNode* datatype,
cannam@87 319 const SerdNode* lang);
cannam@87 320
cannam@87 321 /**
cannam@87 322 @}
cannam@87 323 @name Model
cannam@87 324 @{
cannam@87 325 */
cannam@87 326
cannam@87 327 /**
cannam@87 328 Create a new model.
cannam@87 329
cannam@87 330 @param world The world in which to make this model.
cannam@87 331
cannam@87 332 @param indices SordIndexOption flags (e.g. SORD_SPO|SORD_OPS). Be sure to
cannam@87 333 enable an index where the most significant node(s) are not variables in your
cannam@87 334 queries (e.g. to make (? P O) queries, enable either SORD_OPS or SORD_POS).
cannam@87 335
cannam@87 336 @param graphs If true, store (and index) graph contexts.
cannam@87 337 */
cannam@87 338 SORD_API
cannam@87 339 SordModel*
cannam@87 340 sord_new(SordWorld* world,
cannam@87 341 unsigned indices,
cannam@87 342 bool graphs);
cannam@87 343
cannam@87 344 /**
cannam@87 345 Close and free @c model.
cannam@87 346 */
cannam@87 347 SORD_API
cannam@87 348 void
cannam@87 349 sord_free(SordModel* model);
cannam@87 350
cannam@87 351 /**
cannam@87 352 Get the world associated with @c model.
cannam@87 353 */
cannam@87 354 SORD_API
cannam@87 355 SordWorld*
cannam@87 356 sord_get_world(SordModel* model);
cannam@87 357
cannam@87 358 /**
cannam@87 359 Return the number of nodes stored in @c world.
cannam@87 360
cannam@87 361 Nodes are included in this count iff they are a part of a quad in @c world.
cannam@87 362 */
cannam@87 363 SORD_API
cannam@87 364 size_t
cannam@87 365 sord_num_nodes(const SordWorld* world);
cannam@87 366
cannam@87 367 /**
cannam@87 368 Return the number of quads stored in @c model.
cannam@87 369 */
cannam@87 370 SORD_API
cannam@87 371 size_t
cannam@87 372 sord_num_quads(const SordModel* model);
cannam@87 373
cannam@87 374 /**
cannam@87 375 Return an iterator to the start of @c model.
cannam@87 376 */
cannam@87 377 SORD_API
cannam@87 378 SordIter*
cannam@87 379 sord_begin(const SordModel* model);
cannam@87 380
cannam@87 381 /**
cannam@87 382 Search for statements by a quad pattern.
cannam@87 383 @return an iterator to the first match, or NULL if no matches found.
cannam@87 384 */
cannam@87 385 SORD_API
cannam@87 386 SordIter*
cannam@87 387 sord_find(SordModel* model, const SordQuad pat);
cannam@87 388
cannam@87 389 /**
cannam@87 390 Search for statements by nodes.
cannam@87 391 @return an iterator to the first match, or NULL if no matches found.
cannam@87 392 */
cannam@87 393 SORD_API
cannam@87 394 SordIter*
cannam@87 395 sord_search(SordModel* model,
cannam@87 396 const SordNode* s,
cannam@87 397 const SordNode* p,
cannam@87 398 const SordNode* o,
cannam@87 399 const SordNode* g);
cannam@87 400 /**
cannam@87 401 Search for a single node that matches a pattern.
cannam@87 402 Exactly one of @p s, @p p, @p o must be NULL.
cannam@87 403 This function is mainly useful for predicates that only have one value.
cannam@87 404 The returned node must be freed using sord_node_free.
cannam@87 405 @return the first matching node, or NULL if no matches are found.
cannam@87 406 */
cannam@87 407 SORD_API
cannam@87 408 SordNode*
cannam@87 409 sord_get(SordModel* model,
cannam@87 410 const SordNode* s,
cannam@87 411 const SordNode* p,
cannam@87 412 const SordNode* o,
cannam@87 413 const SordNode* g);
cannam@87 414
cannam@87 415 /**
cannam@87 416 Return true iff a statement exists.
cannam@87 417 */
cannam@87 418 SORD_API
cannam@87 419 bool
cannam@87 420 sord_ask(SordModel* model,
cannam@87 421 const SordNode* s,
cannam@87 422 const SordNode* p,
cannam@87 423 const SordNode* o,
cannam@87 424 const SordNode* g);
cannam@87 425
cannam@87 426 /**
cannam@87 427 Return the number of matching statements.
cannam@87 428 */
cannam@87 429 SORD_API
cannam@87 430 uint64_t
cannam@87 431 sord_count(SordModel* model,
cannam@87 432 const SordNode* s,
cannam@87 433 const SordNode* p,
cannam@87 434 const SordNode* o,
cannam@87 435 const SordNode* g);
cannam@87 436
cannam@87 437 /**
cannam@87 438 Check if @a model contains a triple pattern.
cannam@87 439 */
cannam@87 440 SORD_API
cannam@87 441 bool
cannam@87 442 sord_contains(SordModel* model, const SordQuad pat);
cannam@87 443
cannam@87 444 /**
cannam@87 445 Add a quad to a model.
cannam@87 446 */
cannam@87 447 SORD_API
cannam@87 448 bool
cannam@87 449 sord_add(SordModel* model, const SordQuad quad);
cannam@87 450
cannam@87 451 /**
cannam@87 452 Remove a quad from a model.
cannam@87 453
cannam@87 454 Note that is it illegal to remove while iterating over @c model.
cannam@87 455 */
cannam@87 456 SORD_API
cannam@87 457 void
cannam@87 458 sord_remove(SordModel* model, const SordQuad quad);
cannam@87 459
cannam@87 460 /**
cannam@87 461 @}
cannam@87 462 @name Inserter
cannam@87 463 @{
cannam@87 464 */
cannam@87 465
cannam@87 466 /**
cannam@87 467 Create an inserter for writing statements to a model.
cannam@87 468 */
cannam@87 469 SORD_API
cannam@87 470 SordInserter*
cannam@87 471 sord_inserter_new(SordModel* model,
cannam@87 472 SerdEnv* env);
cannam@87 473
cannam@87 474 /**
cannam@87 475 Free an inserter.
cannam@87 476 */
cannam@87 477 SORD_API
cannam@87 478 void
cannam@87 479 sord_inserter_free(SordInserter* inserter);
cannam@87 480
cannam@87 481 /**
cannam@87 482 Set the current base URI for writing to the model.
cannam@87 483
cannam@87 484 Note this function can be safely casted to SerdBaseSink.
cannam@87 485 */
cannam@87 486 SORD_API
cannam@87 487 SerdStatus
cannam@87 488 sord_inserter_set_base_uri(SordInserter* inserter,
cannam@87 489 const SerdNode* uri);
cannam@87 490
cannam@87 491 /**
cannam@87 492 Set a namespace prefix for writing to the model.
cannam@87 493
cannam@87 494 Note this function can be safely casted to SerdPrefixSink.
cannam@87 495 */
cannam@87 496 SORD_API
cannam@87 497 SerdStatus
cannam@87 498 sord_inserter_set_prefix(SordInserter* inserter,
cannam@87 499 const SerdNode* name,
cannam@87 500 const SerdNode* uri);
cannam@87 501
cannam@87 502 /**
cannam@87 503 Write a statement to the model.
cannam@87 504
cannam@87 505 Note this function can be safely casted to SerdStatementSink.
cannam@87 506 */
cannam@87 507 SORD_API
cannam@87 508 SerdStatus
cannam@87 509 sord_inserter_write_statement(SordInserter* inserter,
cannam@87 510 SerdStatementFlags flags,
cannam@87 511 const SerdNode* graph,
cannam@87 512 const SerdNode* subject,
cannam@87 513 const SerdNode* predicate,
cannam@87 514 const SerdNode* object,
cannam@87 515 const SerdNode* object_datatype,
cannam@87 516 const SerdNode* object_lang);
cannam@87 517
cannam@87 518 /**
cannam@87 519 @}
cannam@87 520 @name Iteration
cannam@87 521 @{
cannam@87 522 */
cannam@87 523
cannam@87 524 /**
cannam@87 525 Set @c quad to the quad pointed to by @c iter.
cannam@87 526 */
cannam@87 527 SORD_API
cannam@87 528 void
cannam@87 529 sord_iter_get(const SordIter* iter, SordQuad quad);
cannam@87 530
cannam@87 531 /**
cannam@87 532 Return a field of the quad pointed to by @c iter.
cannam@87 533 */
cannam@87 534 SORD_API
cannam@87 535 const SordNode*
cannam@87 536 sord_iter_get_node(const SordIter* iter, SordQuadIndex index);
cannam@87 537
cannam@87 538 /**
cannam@87 539 Return the store pointed to by @c iter.
cannam@87 540 */
cannam@87 541 SORD_API
cannam@87 542 const SordModel*
cannam@87 543 sord_iter_get_model(SordIter* iter);
cannam@87 544
cannam@87 545 /**
cannam@87 546 Increment @c iter to point to the next statement.
cannam@87 547 */
cannam@87 548 SORD_API
cannam@87 549 bool
cannam@87 550 sord_iter_next(SordIter* iter);
cannam@87 551
cannam@87 552 /**
cannam@87 553 Return true iff @c iter is at the end of its range.
cannam@87 554 */
cannam@87 555 SORD_API
cannam@87 556 bool
cannam@87 557 sord_iter_end(const SordIter* iter);
cannam@87 558
cannam@87 559 /**
cannam@87 560 Free @c iter.
cannam@87 561 */
cannam@87 562 SORD_API
cannam@87 563 void
cannam@87 564 sord_iter_free(SordIter* iter);
cannam@87 565
cannam@87 566 /**
cannam@87 567 @}
cannam@87 568 @name Utilities
cannam@87 569 @{
cannam@87 570 */
cannam@87 571
cannam@87 572 /**
cannam@87 573 Match two quads (using ID comparison only).
cannam@87 574
cannam@87 575 This function is a straightforward and fast equivalence match with wildcard
cannam@87 576 support (ID 0 is a wildcard). It does not actually read node data.
cannam@87 577 @return true iff @c x and @c y match.
cannam@87 578 */
cannam@87 579 SORD_API
cannam@87 580 bool
cannam@87 581 sord_quad_match(const SordQuad x, const SordQuad y);
cannam@87 582
cannam@87 583 /**
cannam@87 584 @}
cannam@87 585 @name Serialisation
cannam@87 586 @{
cannam@87 587 */
cannam@87 588
cannam@87 589 /**
cannam@87 590 Return a reader that will read into @c model.
cannam@87 591 */
cannam@87 592 SORD_API
cannam@87 593 SerdReader*
cannam@87 594 sord_new_reader(SordModel* model,
cannam@87 595 SerdEnv* env,
cannam@87 596 SerdSyntax syntax,
cannam@87 597 SordNode* graph);
cannam@87 598
cannam@87 599 /**
cannam@87 600 Write a model to a writer.
cannam@87 601 */
cannam@87 602 SORD_API
cannam@87 603 bool
cannam@87 604 sord_write(SordModel* model,
cannam@87 605 SerdWriter* writer,
cannam@87 606 SordNode* graph);
cannam@87 607
cannam@87 608 /**
cannam@87 609 Write a range to a writer.
cannam@87 610
cannam@87 611 This increments @c iter to its end, then frees it.
cannam@87 612 */
cannam@87 613 SORD_API
cannam@87 614 bool
cannam@87 615 sord_write_iter(SordIter* iter,
cannam@87 616 SerdWriter* writer);
cannam@87 617
cannam@87 618 /**
cannam@87 619 @}
cannam@87 620 @}
cannam@87 621 */
cannam@87 622
cannam@87 623 #ifdef __cplusplus
cannam@87 624 } /* extern "C" */
cannam@87 625 #endif
cannam@87 626
cannam@87 627 #endif /* SORD_SORD_H */