2 * Copyright © 2010 Codethink Limited
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the licence, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
19 * Author: Ryan Lortie <desrt@desrt.ca>
22 #ifndef __gvdb_format_h__
23 #define __gvdb_format_h__
27 typedef struct { guint16 value; } guint16_le;
28 typedef struct { guint32 value; } guint32_le;
35 struct gvdb_hash_header {
36 guint32_le n_bloom_words;
40 struct gvdb_hash_item {
41 guint32_le hash_value;
51 struct gvdb_pointer pointer;
61 struct gvdb_pointer root;
64 static inline guint32_le guint32_to_le (guint32 value) {
65 guint32_le result = { GUINT32_TO_LE (value) };
69 static inline guint32 guint32_from_le (guint32_le value) {
70 return GUINT32_FROM_LE (value.value);
73 static inline guint16_le guint16_to_le (guint16 value) {
74 guint16_le result = { GUINT16_TO_LE (value) };
78 static inline guint16 guint16_from_le (guint16_le value) {
79 return GUINT16_FROM_LE (value.value);
82 #define GVDB_SIGNATURE0 1918981703
83 #define GVDB_SIGNATURE1 1953390953
84 #define GVDB_SWAPPED_SIGNATURE0 GUINT32_SWAP_LE_BE (GVDB_SIGNATURE0)
85 #define GVDB_SWAPPED_SIGNATURE1 GUINT32_SWAP_LE_BE (GVDB_SIGNATURE1)
87 #endif /* __gvdb_format_h__ */