annotate win32-mingw/include/sord-0/sord/sord.h @ 94:d278df1123f9

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