/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. #ifndef _CUPS_HELP_INDEX_H_
  16. # define _CUPS_HELP_INDEX_H_
  17. /*
  18. * Include necessary headers...
  19. */
  20. # include <cups/array.h>
  21. /*
  22. * Data structures...
  23. */
  24. typedef struct help_word_s /**** Help word structure... ****/
  25. {
  26. int count; /* Number of occurrences */
  27. char *text; /* Word text */
  28. } help_word_t;
  29. typedef struct help_node_s /**** Help node structure... ****/
  30. {
  31. char *filename; /* Filename, relative to help dir */
  32. char *section; /* Section name (NULL if none) */
  33. char *anchor; /* Anchor name (NULL if none) */
  34. char *text; /* Text in anchor */
  35. cups_array_t *words; /* Words after this node */
  36. time_t mtime; /* Last modification time */
  37. off_t offset; /* Offset in file */
  38. size_t length; /* Length in bytes */
  39. int score; /* Search score */
  40. } help_node_t;
  41. typedef struct help_index_s /**** Help index structure ****/
  42. {
  43. int search; /* 1 = search index, 0 = normal */
  44. cups_array_t *nodes; /* Nodes sorted by filename */
  45. cups_array_t *sorted; /* Nodes sorted by score + text */
  46. } help_index_t;
  47. /*
  48. * Functions...
  49. */
  50. extern void helpDeleteIndex(help_index_t *hi);
  51. extern help_node_t *helpFindNode(help_index_t *hi, const char *filename,
  52. const char *anchor);
  53. extern help_index_t *helpLoadIndex(const char *hifile, const char *directory);
  54. extern int helpSaveIndex(help_index_t *hi, const char *hifile);
  55. extern help_index_t *helpSearchIndex(help_index_t *hi, const char *query,
  56. const char *section,
  57. const char *filename);
  58. #endif /* !_CUPS_HELP_INDEX_H_ */
  59. /*
  60. * End of "$Id: help-index.h 7615 2008-05-25 07:17:07Z mike $".
  61. */