]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | /* |
75bd9771 | 2 | * "$Id: help-index.h 7615 2008-05-25 07:17:07Z mike $" |
ef416fc2 | 3 | * |
79e1d494 | 4 | * Online help index definitions for the Common UNIX Printing System (CUPS). |
ef416fc2 | 5 | * |
bc44d920 | 6 | * Copyright 2007 by Apple Inc. |
f7deaa1a | 7 | * Copyright 1997-2007 by Easy Software Products. |
ef416fc2 | 8 | * |
9 | * These coded instructions, statements, and computer programs are the | |
bc44d920 | 10 | * property of Apple Inc. and are protected by Federal copyright |
11 | * law. Distribution and use rights are outlined in the file "LICENSE.txt" | |
12 | * which should have been included with this file. If this file is | |
13 | * file is missing or damaged, see the license at "http://www.cups.org/". | |
ef416fc2 | 14 | */ |
15 | ||
16 | #ifndef _CUPS_HELP_INDEX_H_ | |
17 | # define _CUPS_HELP_INDEX_H_ | |
18 | ||
ecdc0628 | 19 | /* |
20 | * Include necessary headers... | |
21 | */ | |
22 | ||
23 | # include <cups/array.h> | |
24 | ||
ef416fc2 | 25 | |
ef55b745 MS |
26 | /* |
27 | * C++ magic... | |
28 | */ | |
29 | ||
30 | # ifdef __cplusplus | |
31 | extern "C" { | |
32 | # endif /* __cplusplus */ | |
33 | ||
ef416fc2 | 34 | /* |
35 | * Data structures... | |
36 | */ | |
37 | ||
f7deaa1a | 38 | typedef struct help_word_s /**** Help word structure... ****/ |
39 | { | |
40 | int count; /* Number of occurrences */ | |
41 | char *text; /* Word text */ | |
42 | } help_word_t; | |
43 | ||
44 | typedef struct help_node_s /**** Help node structure... ****/ | |
ef416fc2 | 45 | { |
46 | char *filename; /* Filename, relative to help dir */ | |
47 | char *section; /* Section name (NULL if none) */ | |
48 | char *anchor; /* Anchor name (NULL if none) */ | |
49 | char *text; /* Text in anchor */ | |
f7deaa1a | 50 | cups_array_t *words; /* Words after this node */ |
ef416fc2 | 51 | time_t mtime; /* Last modification time */ |
52 | off_t offset; /* Offset in file */ | |
53 | size_t length; /* Length in bytes */ | |
54 | int score; /* Search score */ | |
55 | } help_node_t; | |
56 | ||
f7deaa1a | 57 | typedef struct help_index_s /**** Help index structure ****/ |
ef416fc2 | 58 | { |
ecdc0628 | 59 | int search; /* 1 = search index, 0 = normal */ |
60 | cups_array_t *nodes; /* Nodes sorted by filename */ | |
61 | cups_array_t *sorted; /* Nodes sorted by score + text */ | |
ef416fc2 | 62 | } help_index_t; |
63 | ||
64 | ||
65 | /* | |
66 | * Functions... | |
67 | */ | |
68 | ||
69 | extern void helpDeleteIndex(help_index_t *hi); | |
ecdc0628 | 70 | extern help_node_t *helpFindNode(help_index_t *hi, const char *filename, |
71 | const char *anchor); | |
ef416fc2 | 72 | extern help_index_t *helpLoadIndex(const char *hifile, const char *directory); |
73 | extern int helpSaveIndex(help_index_t *hi, const char *hifile); | |
74 | extern help_index_t *helpSearchIndex(help_index_t *hi, const char *query, | |
75 | const char *section, | |
76 | const char *filename); | |
77 | ||
78 | ||
ef55b745 MS |
79 | # ifdef __cplusplus |
80 | } | |
81 | # endif /* __cplusplus */ | |
82 | ||
ef416fc2 | 83 | #endif /* !_CUPS_HELP_INDEX_H_ */ |
84 | ||
85 | /* | |
75bd9771 | 86 | * End of "$Id: help-index.h 7615 2008-05-25 07:17:07Z mike $". |
ef416fc2 | 87 | */ |