/*1* Online help index definitions for CUPS.2*3* Copyright 2007-2011 by Apple Inc.4* Copyright 1997-2007 by Easy Software Products.5*6* Licensed under Apache License v2.0. See the file "LICENSE" for more information.7*/89#ifndef _CUPS_HELP_INDEX_H_10# define _CUPS_HELP_INDEX_H_1112/*13* Include necessary headers...14*/1516# include <cups/array.h>171819/*20* C++ magic...21*/2223# ifdef __cplusplus24extern "C" {25# endif /* __cplusplus */2627/*28* Data structures...29*/3031typedef struct help_word_s /**** Help word structure... ****/32{33int count; /* Number of occurrences */34char *text; /* Word text */35} help_word_t;3637typedef struct help_node_s /**** Help node structure... ****/38{39char *filename; /* Filename, relative to help dir */40char *section; /* Section name (NULL if none) */41char *anchor; /* Anchor name (NULL if none) */42char *text; /* Text in anchor */43cups_array_t *words; /* Words after this node */44time_t mtime; /* Last modification time */45off_t offset; /* Offset in file */46size_t length; /* Length in bytes */47int score; /* Search score */48} help_node_t;4950typedef struct help_index_s /**** Help index structure ****/51{52int search; /* 1 = search index, 0 = normal */53cups_array_t *nodes; /* Nodes sorted by filename */54cups_array_t *sorted; /* Nodes sorted by score + text */55} help_index_t;565758/*59* Functions...60*/6162extern void helpDeleteIndex(help_index_t *hi);63extern help_node_t *helpFindNode(help_index_t *hi, const char *filename,64const char *anchor);65extern help_index_t *helpLoadIndex(const char *hifile, const char *directory);66extern int helpSaveIndex(help_index_t *hi, const char *hifile);67extern help_index_t *helpSearchIndex(help_index_t *hi, const char *query,68const char *section,69const char *filename);707172# ifdef __cplusplus73}74# endif /* __cplusplus */7576#endif /* !_CUPS_HELP_INDEX_H_ */777879