3 Copyright 2011 David Robillard <http://drobilla.net>
5 This is free software; you can redistribute it and/or modify it
6 under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This software is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this sofware; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
28 # define PACKED __attribute__((__packed__))
37 typedef struct _RDFF* RDFF;
41 RDFF_STATUS_UNKNOWN_ERROR = 1,
43 RDFF_STATUS_CORRUPT = 3
47 Generic RIFF chunk header.
61 } PACKED RDFFURIChunk;
71 } PACKED RDFFValueChunk;
74 Open/Create a new RDFF file.
77 rdff_open(const char* path, bool write);
80 Write a URI ID to @a file.
83 rdff_write_uri(RDFF file,
89 Write a key/value record to @a file.
92 rdff_write_value(RDFF file,
99 Read a chunk from @a file.
101 @param buf MUST point to an RDFFChunk dynamically allocated with malloc.
102 The @a size field (i.e. (*buf)->size) MUST be set to the amount of available
103 memory in the chunk (not including the header). If this is insufficient,
104 *buf will be resized using realloc.
107 rdff_read_chunk(RDFF file,
112 After this call, @a file is invalid.
115 rdff_close(RDFF file);
121 #endif /* RDFF_RDFF_H */