root / tags / 1.0.8 / xapian-core / backends / flint / flint_types.h

Revision 10643, 2.5 kB (checked in by olly, 8 months ago)

Backport change from trunk:
backends/flint/flint_btreeutil.h: Fix some out-of-date comments.
configure.ac: Use AC_CHECK_SIZEOF to define SIZEOF_INT and
SIZEOF_LONG.
backends/flint/flint_types.h: Use SIZEOF_INT and SIZEOF_LONG to
determine the type of uint4 rather than always using unsigned long
(which is 64 bits on most 64 bit Unix platforms). Drop int4 for
the time being, as we don't actually use it.
backends/quartz/quartz_types.h: Adapt flint change for quartz
(required to avoid differing uint4 types which clash in
backends/database.cc).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1/* flint_types.h: Types used by flint backend and the Btree manager
2 *
3 * Copyright 1999,2000,2001 BrightStation PLC
4 * Copyright 2002,2003,2004,2008 Olly Betts
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 2 of the
9 * License, or (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
19 * USA
20 */
21
22#ifndef OM_HGUARD_FLINT_TYPES_H
23#define OM_HGUARD_FLINT_TYPES_H
24
25typedef unsigned char byte;
26
27#ifndef SIZEOF_INT
28# error SIZEOF_INT is not defined
29#endif
30#ifndef SIZEOF_LONG
31# error SIZEOF_LONG is not defined
32#endif
33#if SIZEOF_INT >= 4
34typedef unsigned int uint4;
35#elif SIZEOF_LONG >= 4
36typedef unsigned long uint4;
37#else
38# error Type long is less than 32 bits, which ISO does not allow!
39#endif
40
41typedef unsigned int flint_blocksize_t;
42
43/** A type used to store a revision number for a table.
44 *
45 *  A table's revision number increases monotonically, incrementing by
46 *  one each time a modification is applied to the table.
47 *
48 *  FIXME: ensure that this is of a suitable minimum size - 32 bits is
49 *  satisfactory in most cases, but in extreme cases could cause the revision
50 *  number to roll over after a few years.  It would be better to use 64 bits
51 *  (and / or to ensure that rolling over causes no problem).
52 */
53typedef unsigned int flint_revision_number_t;
54
55/** A type used to store the number of entries in a table.
56 *
57 *  Again, this must be of suitable minimum size.
58 */
59typedef unsigned int flint_tablesize_t;
60
61/** An integer type for storing the length of a document - ie, the sum of the
62 *  wdfs of the terms in the document.
63 */
64typedef unsigned int flint_doclen_t;
65
66/** An integer type which can store the sum of the lengths of the documents
67 *  in the database.
68 */
69typedef unsigned long long int flint_totlen_t;
70
71/** The default block size to use in a B-tree table.
72 *  If this is changed, be sure to update the API documentation
73 *  correspondingly.
74 */
75#define FLINT_DEFAULT_BLOCK_SIZE 8192
76
77#endif /* OM_HGUARD_FLINT_TYPES_H */
Note: See TracBrowser for help on using the browser.