annotate osx/include/sord/sord.h @ 116:e448888319fc

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