2 /* Copyright (C) 1989-2014 Free Software Foundation, Inc.
3 Written by James Clark (jjc@jclark.com)
5 This file is part of groff.
7 groff 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 3 of the License, or
10 (at your option) any later version.
12 groff 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
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
21 class search_item_iterator;
27 void add_file(const char *fn, int silent = 0);
33 friend class search_list_iterator;
38 class linear_searcher {
39 const char *ignore_fields;
43 const char *search_and_check(const bmpattern *key, const char *buf,
44 const char *bufend, const char **start = 0)
46 int check_match(const char *buf, const char *bufend, const char *match,
47 int matchlen, const char **cont, const char **start)
50 linear_searcher(const char *query, int query_len,
51 const char *ign, int trunc);
53 int search(const char *buf, const char *bufend,
54 const char **startp, int *lengthp) const;
57 class search_list_iterator {
60 search_item_iterator *iter;
62 linear_searcher searcher;
64 search_list_iterator(search_list *, const char *query);
65 ~search_list_iterator();
66 int next(const char **, int *, reference_id * = 0);
75 search_item(const char *nm, int fid);
76 virtual search_item_iterator *make_search_item_iterator(const char *) = 0;
77 virtual ~search_item();
78 int is_named(const char *) const;
79 virtual int next_filename_id() const;
82 class search_item_iterator {
83 char shut_g_plus_plus_up;
85 virtual ~search_item_iterator();
86 virtual int next(const linear_searcher &, const char **ptr, int *lenp,
90 search_item *make_index_search_item(const char *filename, int fid);
91 search_item *make_linear_search_item(int fd, const char *filename, int fid);
93 extern int linear_truncate_len;
94 extern const char *linear_ignore_fields;
95 extern int verify_flag;