#include <stdbool.h>
#include <stdint.h>
Go to the source code of this file.
|
RDFF | rdff_open (const char *path, bool write) |
|
RDFFStatus | rdff_write_uri (RDFF file, uint32_t id, uint32_t len, const char *uri) |
|
RDFFStatus | rdff_write_triple (RDFF file, uint32_t subject, uint32_t predicate, uint32_t object_type, uint32_t object_size, const void *object) |
|
RDFFStatus | rdff_read_chunk (RDFF file, RDFFChunk **buf) |
|
bool | rdff_chunk_is_uri (RDFFChunk *chunk) |
|
bool | rdff_chunk_is_triple (RDFFChunk *chunk) |
|
void | rdff_close (RDFF file) |
|
RDFF file or stream.
Definition at line 37 of file rdff.h.
Status codes for function returns.
Enumerator |
---|
RDFF_STATUS_OK |
Success.
|
RDFF_STATUS_UNKNOWN_ERROR |
Unknown error.
|
RDFF_STATUS_EOF |
End of file.
|
RDFF_STATUS_CORRUPT |
Corrupt data.
|
Definition at line 42 of file rdff.h.
bool rdff_chunk_is_triple |
( |
RDFFChunk * |
chunk | ) |
|
Return true iff chunk is a Triple chunk.
Definition at line 165 of file rdff.c.
bool rdff_chunk_is_uri |
( |
RDFFChunk * |
chunk | ) |
|
Return true iff chunk is a URI chunk.
Definition at line 158 of file rdff.c.
void rdff_close |
( |
RDFF |
file | ) |
|
Close file. After this call, file is invalid.
Definition at line 171 of file rdff.c.
RDFF rdff_open |
( |
const char * |
path, |
|
|
bool |
write |
|
) |
| |
Open/Create a new RDFF file.
Definition at line 39 of file rdff.c.
Read a chunk from file.
- Parameters
-
buf | MUST point to an RDFFChunk dynamically allocated with malloc. The size field (i.e. (*buf)->size) MUST be set to the amount of available memory in the chunk (not including the header). If this is insufficient, buf will be resized using realloc. |
Definition at line 131 of file rdff.c.
RDFFStatus rdff_write_triple |
( |
RDFF |
file, |
|
|
uint32_t |
subject, |
|
|
uint32_t |
predicate, |
|
|
uint32_t |
object_type, |
|
|
uint32_t |
object_size, |
|
|
const void * |
object |
|
) |
| |
Write a key/value record to file.
Definition at line 108 of file rdff.c.
RDFFStatus rdff_write_uri |
( |
RDFF |
file, |
|
|
uint32_t |
id, |
|
|
uint32_t |
len, |
|
|
const char * |
uri |
|
) |
| |
Write a URI ID to file.
Definition at line 90 of file rdff.c.