2 * Copyright (c) 2014 - 2017 Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
4 * Copyright (C) 1989 - 1992, 2004 Free Software Foundation, Inc.
5 * Written by James Clark (jjc@jclark.com)
7 * This is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License as published by the Free
9 * Software Foundation; either version 2, or (at your option) any later
12 * This is distributed in the hope that it will be useful, but WITHOUT ANY
13 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 * You should have received a copy of the GNU General Public License along
18 * with groff; see the file COPYING. If not, write to the Free Software
19 * Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
27 class search_item_iterator
;
31 friend class search_list_iterator
;
40 void add_file(const char *fn
, int silent
= 0);
48 const char *ignore_fields
;
53 const char *search_and_check(const bmpattern
*key
, const char *buf
,
54 const char *bufend
, const char **start
= 0)
56 int check_match(const char *buf
, const char *bufend
, const char *match
,
57 int matchlen
, const char **cont
, const char **start
)
61 linear_searcher(const char *query
, int query_len
,
62 const char *ign
, int trunc
);
64 int search(const char *buf
, const char *bufend
,
65 const char **startp
, int *lengthp
) const;
68 class search_list_iterator
72 search_item_iterator
*iter
;
74 linear_searcher searcher
;
77 search_list_iterator(search_list
*, const char *query
);
78 ~search_list_iterator();
79 int next(const char **, int *, reference_id
* = 0);
90 search_item(const char *nm
, int fid
);
91 virtual search_item_iterator
*make_search_item_iterator(const char *) = 0;
92 virtual ~search_item();
93 int is_named(const char *) const;
94 virtual int next_filename_id() const;
97 class search_item_iterator
99 char shut_g_plus_plus_up
;
102 virtual ~search_item_iterator();
103 virtual int next(const linear_searcher
&, const char **ptr
, int *lenp
,
107 search_item
*make_index_search_item(const char *filename
, int fid
);
108 search_item
*make_linear_search_item(int fd
, const char *filename
, int fid
);
110 extern int linear_truncate_len
;
111 extern const char *linear_ignore_fields
;
112 extern int verify_flag
;