]> git.ipfire.org Git - thirdparty/cups.git/blob - cgi-bin/help-index.h
Load cups into easysw/current.
[thirdparty/cups.git] / cgi-bin / help-index.h
1 /*
2 * "$Id: help-index.h 6257 2007-02-11 01:11:57Z mike $"
3 *
4 * On-line help index definitions for the Common UNIX Printing System (CUPS).
5 *
6 * Copyright 1997-2007 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_word_s /**** Help word structure... ****/
40 {
41 int count; /* Number of occurrences */
42 char *text; /* Word text */
43 } help_word_t;
44
45 typedef struct help_node_s /**** Help node structure... ****/
46 {
47 char *filename; /* Filename, relative to help dir */
48 char *section; /* Section name (NULL if none) */
49 char *anchor; /* Anchor name (NULL if none) */
50 char *text; /* Text in anchor */
51 cups_array_t *words; /* Words after this node */
52 time_t mtime; /* Last modification time */
53 off_t offset; /* Offset in file */
54 size_t length; /* Length in bytes */
55 int score; /* Search score */
56 } help_node_t;
57
58 typedef struct help_index_s /**** Help index structure ****/
59 {
60 int search; /* 1 = search index, 0 = normal */
61 cups_array_t *nodes; /* Nodes sorted by filename */
62 cups_array_t *sorted; /* Nodes sorted by score + text */
63 } help_index_t;
64
65
66 /*
67 * Functions...
68 */
69
70 extern void helpDeleteIndex(help_index_t *hi);
71 extern help_node_t *helpFindNode(help_index_t *hi, const char *filename,
72 const char *anchor);
73 extern help_index_t *helpLoadIndex(const char *hifile, const char *directory);
74 extern int helpSaveIndex(help_index_t *hi, const char *hifile);
75 extern help_index_t *helpSearchIndex(help_index_t *hi, const char *query,
76 const char *section,
77 const char *filename);
78
79
80 #endif /* !_CUPS_HELP_INDEX_H_ */
81
82 /*
83 * End of "$Id: help-index.h 6257 2007-02-11 01:11:57Z mike $".
84 */