backends/flint/flint_check.h

Go to the documentation of this file.
00001 /* flint_check.h: Btree checking
00002  *
00003  * Copyright 1999,2000,2001 BrightStation PLC
00004  * Copyright 2002 Ananova Ltd
00005  * Copyright 2002,2004,2005,2006,2008 Olly Betts
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License as
00009  * published by the Free Software Foundation; either version 2 of the
00010  * License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
00020  * USA
00021  */
00022 
00023 #ifndef OM_HGUARD_FLINT_CHECK_H
00024 #define OM_HGUARD_FLINT_CHECK_H
00025 
00026 #include "flint_table.h"
00027 #include "noreturn.h"
00028 
00029 #include <iostream>
00030 #include <string>
00031 
00032 class BtreeCheck : public FlintTable {
00033     public:
00034         static void check(const string & name, int opts,
00035                           std::ostream &out = std::cout);
00036     private:
00037         BtreeCheck(const std::string &name_, bool readonly, std::ostream &out_)
00038             : FlintTable(name_, readonly), out(out_) { }
00039 
00040         void block_check(Cursor_ * C_, int j, int opts);
00041         int block_usage(const byte * p) const;
00042         void report_block(int m, int n, const byte * p) const;
00043         void report_block_full(int m, int n, const byte * p) const;
00044         void report_cursor(int N, const Cursor_ *C_) const;
00045 
00046         XAPIAN_NORETURN(void failure(int n) const);
00047         void print_key(const byte * p, int c, int j) const;
00048         void print_tag(const byte * p, int c, int j) const;
00049         void print_spaces(int n) const;
00050         void print_bytes(int n, const byte * p) const;
00051 
00052         mutable std::ostream &out;
00053 };
00054 
00055 #define OPT_SHORT_TREE  1
00056 #define OPT_FULL_TREE   2
00057 #define OPT_SHOW_BITMAP 4
00058 #define OPT_SHOW_STATS  8
00059 
00060 #endif /* OM_HGUARD_FLINT_CHECK_H */

Documentation for Xapian (version 1.0.10).
Generated on 24 Dec 2008 by Doxygen 1.5.2.