annotate osx/include/sord-0/sord/sord.h @ 23:619f715526df sv_v2.1

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