annotate src/sord-0.12.0/sord/sord.h @ 2:cc5d363db385

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