]>
git.ipfire.org Git - thirdparty/cups.git/blob - cgi-bin/help-index.h
2 * Online help index definitions for CUPS.
4 * Copyright 2007-2011 by Apple Inc.
5 * Copyright 1997-2007 by Easy Software Products.
7 * Licensed under Apache License v2.0. See the file "LICENSE" for more information.
10 #ifndef _CUPS_HELP_INDEX_H_
11 # define _CUPS_HELP_INDEX_H_
14 * Include necessary headers...
17 # include <cups/array.h>
26 # endif /* __cplusplus */
32 typedef struct help_word_s
/**** Help word structure... ****/
34 int count
; /* Number of occurrences */
35 char *text
; /* Word text */
38 typedef struct help_node_s
/**** Help node structure... ****/
40 char *filename
; /* Filename, relative to help dir */
41 char *section
; /* Section name (NULL if none) */
42 char *anchor
; /* Anchor name (NULL if none) */
43 char *text
; /* Text in anchor */
44 cups_array_t
*words
; /* Words after this node */
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 */
51 typedef struct help_index_s
/**** Help index structure ****/
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 */
63 extern void helpDeleteIndex(help_index_t
*hi
);
64 extern help_node_t
*helpFindNode(help_index_t
*hi
, const char *filename
,
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
,
70 const char *filename
);
75 # endif /* __cplusplus */
77 #endif /* !_CUPS_HELP_INDEX_H_ */