]>
git.ipfire.org Git - thirdparty/cups.git/blob - cgi-bin/help-index.h
5fb1ac1f5b25007130274e00dd4ce5e823173f27
2 * Online help index definitions for CUPS.
4 * Copyright 2007-2011 by Apple Inc.
5 * Copyright 1997-2007 by Easy Software Products.
7 * These coded instructions, statements, and computer programs are the
8 * property of Apple Inc. and are protected by Federal copyright
9 * law. Distribution and use rights are outlined in the file "LICENSE.txt"
10 * which should have been included with this file. If this file is
11 * file is missing or damaged, see the license at "http://www.cups.org/".
14 #ifndef _CUPS_HELP_INDEX_H_
15 # define _CUPS_HELP_INDEX_H_
18 * Include necessary headers...
21 # include <cups/array.h>
30 # endif /* __cplusplus */
36 typedef struct help_word_s
/**** Help word structure... ****/
38 int count
; /* Number of occurrences */
39 char *text
; /* Word text */
42 typedef struct help_node_s
/**** Help node structure... ****/
44 char *filename
; /* Filename, relative to help dir */
45 char *section
; /* Section name (NULL if none) */
46 char *anchor
; /* Anchor name (NULL if none) */
47 char *text
; /* Text in anchor */
48 cups_array_t
*words
; /* Words after this node */
49 time_t mtime
; /* Last modification time */
50 off_t offset
; /* Offset in file */
51 size_t length
; /* Length in bytes */
52 int score
; /* Search score */
55 typedef struct help_index_s
/**** Help index structure ****/
57 int search
; /* 1 = search index, 0 = normal */
58 cups_array_t
*nodes
; /* Nodes sorted by filename */
59 cups_array_t
*sorted
; /* Nodes sorted by score + text */
67 extern void helpDeleteIndex(help_index_t
*hi
);
68 extern help_node_t
*helpFindNode(help_index_t
*hi
, const char *filename
,
70 extern help_index_t
*helpLoadIndex(const char *hifile
, const char *directory
);
71 extern int helpSaveIndex(help_index_t
*hi
, const char *hifile
);
72 extern help_index_t
*helpSearchIndex(help_index_t
*hi
, const char *query
,
74 const char *filename
);
79 # endif /* __cplusplus */
81 #endif /* !_CUPS_HELP_INDEX_H_ */