Remove typedefs deprecated in 1.3.0
[xapian.git] / xapian-core / include / xapian / types.h
blobf07bfa5207bf8088bde7c92ed741b6cf83a8a521
1 /** @file xapian/types.h
2 * @brief typedefs for Xapian
3 */
4 /* Copyright (C) 2007,2010,2011,2013,2014,2017 Olly Betts
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.
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.
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
21 #ifndef XAPIAN_INCLUDED_TYPES_H
22 #define XAPIAN_INCLUDED_TYPES_H
24 #if !defined XAPIAN_IN_XAPIAN_H && !defined XAPIAN_LIB_BUILD
25 # error "Never use <xapian/types.h> directly; include <xapian.h> instead."
26 #endif
28 #include <xapian/version.h>
30 namespace Xapian {
32 /** A count of documents.
34 * This is used to hold values such as the number of documents in a database
35 * and the frequency of a term in the database.
37 typedef unsigned XAPIAN_DOCID_BASE_TYPE doccount;
39 /** A signed difference between two counts of documents.
41 * This is used by the Xapian classes which are STL containers of documents
42 * for "difference_type".
44 typedef XAPIAN_DOCID_BASE_TYPE doccount_diff;
46 /** A unique identifier for a document.
48 * Docid 0 is invalid, providing an "out of range" value which can be
49 * used to mean "not a valid document".
51 typedef unsigned XAPIAN_DOCID_BASE_TYPE docid;
53 /** A normalised document length.
55 * The normalised document length is the document length divided by the
56 * average document length in the database.
58 typedef double doclength;
60 /** A counts of terms.
62 * This is used to hold values such as the Within Document Frequency (wdf).
64 typedef unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount;
66 /** A signed difference between two counts of terms.
68 * This is used by the Xapian classes which are STL containers of terms
69 * for "difference_type".
71 typedef XAPIAN_TERMCOUNT_BASE_TYPE termcount_diff;
73 /** A term position within a document or query.
75 typedef unsigned termpos;
77 /** A signed difference between two term positions.
79 * This is used by the Xapian classes which are STL containers of positions
80 * for "difference_type".
82 typedef int termpos_diff; /* FIXME: can overflow. */
84 /** The number for a value slot in a document.
86 * Value slot numbers are unsigned and (currently) a 32-bit quantity, with
87 * Xapian::BAD_VALUENO being represented by the largest possible value.
88 * Therefore value slots 0 to 0xFFFFFFFE are available for use.
90 typedef unsigned valueno;
92 /** A signed difference between two value slot numbers.
94 * This is used by the Xapian classes which are STL containers of values
95 * for "difference_type".
97 typedef int valueno_diff; /* FIXME: can overflow. */
99 /** Reserved value to indicate "no valueno". */
100 const valueno BAD_VALUENO = 0xffffffff;
102 /** Revision number of a database.
104 * For databases which support this, it increases with each commit.
106 * Experimental - see https://xapian.org/docs/deprecation#experimental-features
108 typedef XAPIAN_REVISION_TYPE rev;
110 /** The total length of all documents in a database.
112 * Added in Xapian 1.4.5.
114 typedef XAPIAN_TOTALLENGTH_TYPE totallength;
118 #endif /* XAPIAN_INCLUDED_TYPES_H */