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

Revision 9982, 1.9 kB (checked in by olly, 12 months ago)

backends/flint/flint_check.h,backends/flint/flint_table.h,
backends/quartz/btree.h,net/tcpserver.cc,tests/harness/testsuite.cc:
Add XAPIAN_NORETURN() annotations to functions and non-virtual
methods which don't return.
net/remoteserver.cc: Assign bool variable using a comparison rather
than subtraction, so the intent is clearer.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1/* flint_check.h: Btree checking
2 *
3 * Copyright 1999,2000,2001 BrightStation PLC
4 * Copyright 2002 Ananova Ltd
5 * Copyright 2002,2004,2005,2006,2008 Olly Betts
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of the
10 * License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
20 * USA
21 */
22
23#ifndef OM_HGUARD_FLINT_CHECK_H
24#define OM_HGUARD_FLINT_CHECK_H
25
26#include "flint_table.h"
27#include "noreturn.h"
28
29#include <iostream>
30#include <string>
31
32class BtreeCheck : public FlintTable {
33    public:
34        static void check(const string & name, int opts,
35                          std::ostream &out = std::cout);
36    private:
37        BtreeCheck(const std::string &name_, bool readonly, std::ostream &out_)
38            : FlintTable(name_, readonly), out(out_) { }
39
40        void block_check(Cursor_ * C_, int j, int opts);
41        int block_usage(const byte * p) const;
42        void report_block(int m, int n, const byte * p) const;
43        void report_block_full(int m, int n, const byte * p) const;
44        void report_cursor(int N, const Cursor_ *C_) const;
45
46        XAPIAN_NORETURN(void failure(int n) const);
47        void print_key(const byte * p, int c, int j) const;
48        void print_tag(const byte * p, int c, int j) const;
49        void print_spaces(int n) const;
50        void print_bytes(int n, const byte * p) const;
51
52        mutable std::ostream &out;
53};
54
55#define OPT_SHORT_TREE  1
56#define OPT_FULL_TREE   2
57#define OPT_SHOW_BITMAP 4
58#define OPT_SHOW_STATS  8
59
60#endif /* OM_HGUARD_FLINT_CHECK_H */
Note: See TracBrowser for help on using the browser.