4 /* Copyright (C) 1989, 1990, 1991, 1992, 2004 Free Software Foundation, Inc.
5 Written by James Clark (jjc@jclark.com)
7 This file is part of groff.
9 groff is free software; you can redistribute it and/or modify it under
10 the terms of the GNU General Public License as published by the Free
11 Software Foundation; either version 2, or (at your option) any later
14 groff is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19 You should have received a copy of the GNU General Public License along
20 with groff; see the file COPYING. If not, write to the Free Software
21 Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
24 class search_item_iterator
;
30 void add_file(const char *fn
, int silent
= 0);
36 friend class search_list_iterator
;
41 class linear_searcher
{
42 const char *ignore_fields
;
46 const char *search_and_check(const bmpattern
*key
, const char *buf
,
47 const char *bufend
, const char **start
= 0)
49 int check_match(const char *buf
, const char *bufend
, const char *match
,
50 int matchlen
, const char **cont
, const char **start
)
53 linear_searcher(const char *query
, int query_len
,
54 const char *ign
, int trunc
);
56 int search(const char *buf
, const char *bufend
,
57 const char **startp
, int *lengthp
) const;
60 class search_list_iterator
{
63 search_item_iterator
*iter
;
65 linear_searcher searcher
;
67 search_list_iterator(search_list
*, const char *query
);
68 ~search_list_iterator();
69 int next(const char **, int *, reference_id
* = 0);
78 search_item(const char *nm
, int fid
);
79 virtual search_item_iterator
*make_search_item_iterator(const char *) = 0;
80 virtual ~search_item();
81 int is_named(const char *) const;
82 virtual int next_filename_id() const;
85 class search_item_iterator
{
86 char shut_g_plus_plus_up
;
88 virtual ~search_item_iterator();
89 virtual int next(const linear_searcher
&, const char **ptr
, int *lenp
,
93 search_item
*make_index_search_item(const char *filename
, int fid
);
94 search_item
*make_linear_search_item(int fd
, const char *filename
, int fid
);
96 extern int linear_truncate_len
;
97 extern const char *linear_ignore_fields
;
98 extern int verify_flag
;