annotate src/sord-0.12.0/sord/sord.h @ 169:223a55898ab9 tip default

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