PageRenderTime 32ms CodeModel.GetById 25ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/vp_plugins/sptsd/cups/help-index.h

http://cupsfilter.googlecode.com/
C++ Header | 75 lines | 35 code | 14 blank | 26 comment | 0 complexity | 6ff40a527456c68685ed96752a0c065c MD5 | raw file
 1/*
 2 * "$Id: help-index.h 7615 2008-05-25 07:17:07Z mike $"
 3 *
 4 *   Online help index definitions for the Common UNIX Printing System (CUPS).
 5 *
 6 *   Copyright 2007 by Apple Inc.
 7 *   Copyright 1997-2007 by Easy Software Products.
 8 *
 9 *   These coded instructions, statements, and computer programs are the
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/".
14 */
15
16#ifndef _CUPS_HELP_INDEX_H_
17#  define _CUPS_HELP_INDEX_H_
18
19/*
20 * Include necessary headers...
21 */
22
23#  include <cups/array.h>
24
25
26/*
27 * Data structures...
28 */
29
30typedef struct help_word_s		/**** Help word structure... ****/
31{
32  int		count;			/* Number of occurrences */
33  char		*text;			/* Word text */
34} help_word_t;
35
36typedef struct help_node_s		/**** Help node structure... ****/
37{
38  char		*filename;		/* Filename, relative to help dir */
39  char		*section;		/* Section name (NULL if none) */
40  char		*anchor;		/* Anchor name (NULL if none) */
41  char		*text;			/* Text in anchor */
42  cups_array_t	*words;			/* Words after this node */
43  time_t	mtime;			/* Last modification time */
44  off_t		offset;			/* Offset in file */
45  size_t	length;			/* Length in bytes */
46  int		score;			/* Search score */
47} help_node_t;
48
49typedef struct help_index_s		/**** Help index structure ****/
50{
51  int		search;			/* 1 = search index, 0 = normal */
52  cups_array_t	*nodes;			/* Nodes sorted by filename */
53  cups_array_t	*sorted;		/* Nodes sorted by score + text */
54} help_index_t;
55
56
57/*
58 * Functions...
59 */
60
61extern void		helpDeleteIndex(help_index_t *hi);
62extern help_node_t	*helpFindNode(help_index_t *hi, const char *filename,
63			              const char *anchor);
64extern help_index_t	*helpLoadIndex(const char *hifile, const char *directory);
65extern int		helpSaveIndex(help_index_t *hi, const char *hifile);
66extern help_index_t	*helpSearchIndex(help_index_t *hi, const char *query,
67			                 const char *section,
68					 const char *filename);
69
70
71#endif /* !_CUPS_HELP_INDEX_H_ */
72
73/*
74 * End of "$Id: help-index.h 7615 2008-05-25 07:17:07Z mike $".
75 */