LCOV - code coverage report
Current view: top level - backends/chert - chert_check.h (source / functions) Hit Total Coverage
Test: Test Coverage for xapian-core r Lines: 3 3 100.0 %
Date: 2011-08-21 Functions: 2 2 100.0 %
Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : /* chert_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                 :            :  * Copyright 2008 Lemur Consulting Ltd
       7                 :            :  *
       8                 :            :  * This program is free software; you can redistribute it and/or
       9                 :            :  * modify it under the terms of the GNU General Public License as
      10                 :            :  * published by the Free Software Foundation; either version 2 of the
      11                 :            :  * License, or (at your option) any later version.
      12                 :            :  *
      13                 :            :  * This program is distributed in the hope that it will be useful,
      14                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      15                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      16                 :            :  * GNU General Public License for more details.
      17                 :            :  *
      18                 :            :  * You should have received a copy of the GNU General Public License
      19                 :            :  * along with this program; if not, write to the Free Software
      20                 :            :  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
      21                 :            :  * USA
      22                 :            :  */
      23                 :            : 
      24                 :            : #ifndef OM_HGUARD_CHERT_CHECK_H
      25                 :            : #define OM_HGUARD_CHERT_CHECK_H
      26                 :            : 
      27                 :            : #include "chert_table.h"
      28                 :            : #include "noreturn.h"
      29                 :            : 
      30                 :            : #include <iostream>
      31                 :            : #include <string>
      32                 :            : 
      33                 :          3 : class ChertTableCheck : public ChertTable {
      34                 :            :     public:
      35                 :            :         static void check(const char * tablename, const std::string & path,
      36                 :            :                           int opts, std::ostream &out = std::cout);
      37                 :            :     private:
      38                 :          3 :         ChertTableCheck(const char * tablename_, const std::string &path_,
      39                 :            :                         bool readonly, std::ostream &out_)
      40                 :          3 :             : ChertTable(tablename_, path_, readonly), out(out_) { }
      41                 :            : 
      42                 :            :         void block_check(Cursor * C_, int j, int opts);
      43                 :            :         int block_usage(const byte * p) const;
      44                 :            :         void report_block(int m, int n, const byte * p) const;
      45                 :            :         void report_block_full(int m, int n, const byte * p) const;
      46                 :            :         void report_cursor(int N, const Cursor *C_) const;
      47                 :            : 
      48                 :            :         XAPIAN_NORETURN(void failure(int n) const);
      49                 :            :         void print_key(const byte * p, int c, int j) const;
      50                 :            :         void print_tag(const byte * p, int c, int j) const;
      51                 :            :         void print_spaces(int n) const;
      52                 :            :         void print_bytes(int n, const byte * p) const;
      53                 :            : 
      54                 :            :         std::ostream &out;
      55                 :            : };
      56                 :            : 
      57                 :            : #define OPT_SHORT_TREE  1
      58                 :            : #define OPT_FULL_TREE   2
      59                 :            : #define OPT_SHOW_BITMAP 4
      60                 :            : #define OPT_SHOW_STATS  8
      61                 :            : 
      62                 :            : #endif /* OM_HGUARD_CHERT_CHECK_H */

Generated by: LCOV version 1.8