xapian-core  2.0.0
glass_dbcheck.h
Go to the documentation of this file.
1 
4 /* Copyright (C) 2008,2009,2012,2013,2014,2016,2024 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, see
18  * <https://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef XAPIAN_INCLUDED_GLASS_DBCHECK_H
22 #define XAPIAN_INCLUDED_GLASS_DBCHECK_H
23 
24 #include "xapian/types.h"
25 
26 #include <sys/types.h> // For size_t and off_t.
27 #include <iosfwd>
28 #include <string>
29 #include <vector>
30 
31 class GlassVersion;
32 
33 size_t check_glass_table(const char* tablename, std::string_view db_dir,
34  int fd, off_t offset_,
35  const GlassVersion& version_file, int opts,
36  std::vector<Xapian::termcount>& doclens,
37  std::ostream* out);
38 
39 inline size_t
40 check_glass_table(const char* tablename, std::string_view db_dir,
41  const GlassVersion& version_file, int opts,
42  std::vector<Xapian::termcount>& doclens,
43  std::ostream* out)
44 {
45  return check_glass_table(tablename, db_dir, -1, 0, version_file, opts,
46  doclens, out);
47 }
48 
49 inline size_t
50 check_glass_table(const char * tablename, int fd, off_t offset_,
51  const GlassVersion & version_file, int opts,
52  std::vector<Xapian::termcount> & doclens,
53  std::ostream * out)
54 {
55  return check_glass_table(tablename, {}, fd, offset_,
56  version_file, opts,
57  doclens, out);
58 }
59 
60 #endif // XAPIAN_INCLUDED_GLASS_DBCHECK_H
The GlassVersion class manages the revision files.
Definition: glass_version.h:96
std::string db_dir
The database directory.
int fd
File descriptor.
size_t check_glass_table(const char *tablename, std::string_view db_dir, int fd, off_t offset_, const GlassVersion &version_file, int opts, std::vector< Xapian::termcount > &doclens, std::ostream *out)
typedefs for Xapian
static const char * opts