* gcc.c (.h spec): Fix typo.
[official-gcc.git] / texinfo / info / search.h
blobfc32185c91bcfc52581499e991c4dd28e45e67e1
1 /* search.h -- Structure used to search large bodies of text, with bounds.
2 $Id: search.h,v 1.1.1.2 1998/03/22 20:42:51 law Exp $
4 This file is part of GNU Info, a program for reading online documentation
5 stored in Info format.
7 Copyright (C) 1993, 97 Free Software Foundation, Inc.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2, or (at your option)
12 any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 Written by Brian Fox (bfox@ai.mit.edu). */
25 /* The search functions take two arguments:
27 1) a string to search for, and
29 2) a pointer to a SEARCH_BINDING which contains the buffer, start,
30 and end of the search.
32 They return a long, which is the offset from the start of the buffer
33 at which the match was found. An offset of -1 indicates failure. */
35 #ifndef INFO_SEARCH_H
36 #define INFO_SEARCH_H
38 typedef struct {
39 char *buffer; /* The buffer of text to search. */
40 long start; /* Offset of the start of the search. */
41 long end; /* Offset of the end of the searh. */
42 int flags; /* Flags controlling the type of search. */
43 } SEARCH_BINDING;
45 #define S_FoldCase 0x01 /* Set means fold case in searches. */
46 #define S_SkipDest 0x02 /* Set means return pointing after the dest. */
48 SEARCH_BINDING *make_binding (), *copy_binding ();
49 extern long search_forward (), search_backward (), search ();
50 extern int looking_at ();
52 /* Note that STRING_IN_LINE () always returns the offset of the 1st character
53 after the string. */
54 extern int string_in_line ();
56 /* Some unixes don't have strcasecmp or strncasecmp. */
57 #if !defined (HAVE_STRCASECMP)
58 extern int strcasecmp (), strncasecmp ();
59 #endif /* !HAVE_STRCASECMP */
61 /* Function names that start with "skip" are passed a string, and return
62 an offset from the start of that string. Function names that start
63 with "find" are passed a SEARCH_BINDING, and return an absolute position
64 marker of the item being searched for. "Find" functions return a value
65 of -1 if the item being looked for couldn't be found. */
66 extern int skip_whitespace (), skip_non_whitespace ();
67 extern int skip_whitespace_and_newlines (), skip_line ();
68 extern int skip_node_characters (), skip_node_separator ();
69 #define DONT_SKIP_NEWLINES 0
70 #define SKIP_NEWLINES 1
72 extern long find_node_separator (), find_tags_table ();
73 extern long find_node_in_binding ();
75 #endif /* not INFO_SEARCH_H */