]> git.ipfire.org Git - thirdparty/cups.git/blob - cgi-bin/help-index.h
c696cd371d2a6484767c504c21bf506a9373b3b7
[thirdparty/cups.git] / cgi-bin / help-index.h
1 /*
2 * "$Id: help-index.h 177 2006-06-21 00:20:03Z jlovell $"
3 *
4 * On-line help index definitions for the Common UNIX Printing System (CUPS).
5 *
6 * Copyright 1997-2006 by Easy Software Products.
7 *
8 * These coded instructions, statements, and computer programs are the
9 * property of Easy Software Products and are protected by Federal
10 * copyright law. Distribution and use rights are outlined in the file
11 * "LICENSE.txt" which should have been included with this file. If this
12 * file is missing or damaged please contact Easy Software Products
13 * at:
14 *
15 * Attn: CUPS Licensing Information
16 * Easy Software Products
17 * 44141 Airport View Drive, Suite 204
18 * Hollywood, Maryland 20636 USA
19 *
20 * Voice: (301) 373-9600
21 * EMail: cups-info@cups.org
22 * WWW: http://www.cups.org
23 */
24
25 #ifndef _CUPS_HELP_INDEX_H_
26 # define _CUPS_HELP_INDEX_H_
27
28 /*
29 * Include necessary headers...
30 */
31
32 # include <cups/array.h>
33
34
35 /*
36 * Data structures...
37 */
38
39 typedef struct /**** Help node structure... ****/
40 {
41 char *filename; /* Filename, relative to help dir */
42 char *section; /* Section name (NULL if none) */
43 char *anchor; /* Anchor name (NULL if none) */
44 char *text; /* Text in anchor */
45 time_t mtime; /* Last modification time */
46 off_t offset; /* Offset in file */
47 size_t length; /* Length in bytes */
48 int score; /* Search score */
49 } help_node_t;
50
51 typedef struct /**** Help index structure ****/
52 {
53 int search; /* 1 = search index, 0 = normal */
54 cups_array_t *nodes; /* Nodes sorted by filename */
55 cups_array_t *sorted; /* Nodes sorted by score + text */
56 } help_index_t;
57
58
59 /*
60 * Functions...
61 */
62
63 extern void helpDeleteIndex(help_index_t *hi);
64 extern help_node_t *helpFindNode(help_index_t *hi, const char *filename,
65 const char *anchor);
66 extern help_index_t *helpLoadIndex(const char *hifile, const char *directory);
67 extern int helpSaveIndex(help_index_t *hi, const char *hifile);
68 extern help_index_t *helpSearchIndex(help_index_t *hi, const char *query,
69 const char *section,
70 const char *filename);
71
72
73 #endif /* !_CUPS_HELP_INDEX_H_ */
74
75 /*
76 * End of "$Id: help-index.h 177 2006-06-21 00:20:03Z jlovell $".
77 */