| 1 | /** @file |
| 2 | * @brief Definitions, types, etc for use inside glass. |
| 3 | */ |
| 4 | /* Copyright (C) 2010,2014,2015,2017,2024 Olly Betts |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; either version 2 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program; if not, write to the Free Software |
| 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 19 | */ |
| 20 | |
| 21 | #ifndef XAPIAN_INCLUDED_GLASS_DEFS_H |
| 22 | #define XAPIAN_INCLUDED_GLASS_DEFS_Hcxx . . $ `backends/glass/glass_defs.h:22:9`! |
| 23 | |
| 24 | #include "internaltypes.h"cxx . . $ `<file>/common/internaltypes.h`/ |
| 25 | |
| 26 | /// Glass table extension. |
| 27 | #define GLASS_TABLE_EXTENSIONcxx . . $ `backends/glass/glass_defs.h:27:9`! "glass" |
| 28 | |
| 29 | /// Default B-tree block size. |
| 30 | #define GLASS_DEFAULT_BLOCKSIZEcxx . . $ `backends/glass/glass_defs.h:30:9`! 8192 |
| 31 | |
| 32 | /// Minimum B-tree block size. |
| 33 | #define GLASS_MIN_BLOCKSIZEcxx . . $ `backends/glass/glass_defs.h:33:9`! 2048 |
| 34 | |
| 35 | /// Maximum B-tree block size. |
| 36 | #define GLASS_MAX_BLOCKSIZEcxx . . $ `backends/glass/glass_defs.h:36:9`! 65536 |
| 37 | |
| 38 | /** Allow for this many levels in the B-tree. |
| 39 | * |
| 40 | * With 10, overflow is practically impossible. |
| 41 | * FIXME: but we want it to be completely impossible... |
| 42 | */ |
| 43 | #define GLASS_BTREE_CURSOR_LEVELScxx . . $ `backends/glass/glass_defs.h:43:9`! 10 |
| 44 | |
| 45 | /** The largest docid value supported by glass. |
| 46 | * |
| 47 | * The disk format supports 64-bit docids, but if Xapian::docid is narrower |
| 48 | * then it's the largest value supported by the type that matters here. |
| 49 | */ |
| 50 | #define GLASS_MAX_DOCIDcxx . . $ `backends/glass/glass_defs.h:50:9`! Xapian::docid(0xffffffffffffffff) |
| 51 | |
| 52 | namespace Glasscxx . . $ Glass/ { |
| 53 | enum table_typecxx . . $ Glass/table_type# { |
| 54 | POSTLISTcxx . . $ Glass/POSTLIST., |
| 55 | DOCDATAcxx . . $ Glass/DOCDATA., |
| 56 | TERMLISTcxx . . $ Glass/TERMLIST., |
| 57 | POSITIONcxx . . $ Glass/POSITION., |
| 58 | SPELLINGcxx . . $ Glass/SPELLING., |
| 59 | SYNONYMcxx . . $ Glass/SYNONYM., |
| 60 | MAX_cxx . . $ Glass/MAX_. |
| 61 | }; |
| 62 | } |
| 63 | |
| 64 | /// A block number in a glass Btree file. |
| 65 | typedef uint4cxx . . $ uint4# glass_block_tcxx . . $ glass_block_t#; |
| 66 | |
| 67 | /// The revision number of a glass database. |
| 68 | typedef uint4cxx . . $ uint4# glass_revision_number_tcxx . . $ glass_revision_number_t#; |
| 69 | |
| 70 | /// How many entries there are in a table. |
| 71 | typedef unsigned long long glass_tablesize_tcxx . . $ glass_tablesize_t#; |
| 72 | |
| 73 | #endif // XAPIAN_INCLUDED_GLASS_DEFS_H |