2 /* Copyright (C) 1989, 1990, 1991, 1992, 2004 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 2, or (at your option) any later
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 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. */
22 class search_item_iterator;
28 void add_file(const char *fn, int silent = 0);
34 friend class search_list_iterator;
39 class linear_searcher {
40 const char *ignore_fields;
44 const char *search_and_check(const bmpattern *key, const char *buf,
45 const char *bufend, const char **start = 0)
47 int check_match(const char *buf, const char *bufend, const char *match,
48 int matchlen, const char **cont, const char **start)
51 linear_searcher(const char *query, int query_len,
52 const char *ign, int trunc);
54 int search(const char *buf, const char *bufend,
55 const char **startp, int *lengthp) const;
58 class search_list_iterator {
61 search_item_iterator *iter;
63 linear_searcher searcher;
65 search_list_iterator(search_list *, const char *query);
66 ~search_list_iterator();
67 int next(const char **, int *, reference_id * = 0);
76 search_item(const char *nm, int fid);
77 virtual search_item_iterator *make_search_item_iterator(const char *) = 0;
78 virtual ~search_item();
79 int is_named(const char *) const;
80 virtual int next_filename_id() const;
83 class search_item_iterator {
84 char shut_g_plus_plus_up;
86 virtual ~search_item_iterator();
87 virtual int next(const linear_searcher &, const char **ptr, int *lenp,
91 search_item *make_index_search_item(const char *filename, int fid);
92 search_item *make_linear_search_item(int fd, const char *filename, int fid);
94 extern int linear_truncate_len;
95 extern const char *linear_ignore_fields;
96 extern int verify_flag;