GlobSearchP.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /*
  2. * CDE - Common Desktop Environment
  3. *
  4. * Copyright (c) 1993-2012, The Open Group. All rights reserved.
  5. *
  6. * These libraries and programs are free software; you can
  7. * redistribute them and/or modify them under the terms of the GNU
  8. * Lesser General Public License as published by the Free Software
  9. * Foundation; either version 2 of the License, or (at your option)
  10. * any later version.
  11. *
  12. * These libraries and programs are distributed in the hope that
  13. * they will be useful, but WITHOUT ANY WARRANTY; without even the
  14. * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  15. * PURPOSE. See the GNU Lesser General Public License for more
  16. * details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with these libraries and programs; if not, write
  20. * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  21. * Floor, Boston, MA 02110-1301 USA
  22. */
  23. /* $XConsortium: GlobSearchP.h /main/4 1995/10/26 12:22:52 rswiston $ */
  24. /************************************<+>*************************************
  25. ****************************************************************************
  26. **
  27. ** File: GlobSearchP.h
  28. **
  29. ** Project: DtHelp Project
  30. **
  31. ** Description: Builds and displays an instance of a DtHelp GlobSearch
  32. ** Dialog.
  33. **
  34. **
  35. ** (c) Copyright 1993, 1994 Hewlett-Packard Company
  36. ** (c) Copyright 1993, 1994 International Business Machines Corp.
  37. ** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
  38. ** (c) Copyright 1993, 1994 Novell, Inc.
  39. **
  40. **
  41. **
  42. ****************************************************************************
  43. ************************************<+>*************************************/
  44. #ifndef _GlobSearchP_h
  45. #define _GlobSearchP_h
  46. #include "Access.h"
  47. #include "FileListUtilsI.h"
  48. #include "StringFuncsI.h" /* for _CEStrcollProc */
  49. typedef enum {
  50. _DtHelpGlobSrchVolumeUndef = 0,
  51. _DtHelpGlobSrchCurVolume = 1,
  52. _DtHelpGlobSrchSelectedVolumes,
  53. _DtHelpGlobSrchAllVolumes
  54. } _DtHelpGlobSrchSources;
  55. typedef enum {
  56. _DtHelpGlobSrchSearchThisVolume = 32,
  57. _DtHelpGlobSrchNothingDone = 0,
  58. _DtHelpGlobSrchTopicSearchInProgress = 1,
  59. _DtHelpGlobSrchTopicSearchDone = 2,
  60. _DtHelpGlobSrchIndexSearchInProgress = 4,
  61. _DtHelpGlobSrchIndexSearchDone = 8,
  62. _DtHelpGlobSrchEverySearchDone = 15
  63. } _DtHelpGlobSrchState;
  64. /* maintained for each volume searched thus far */
  65. /* this data is stored in a struct pointed to by 'clientData' in _DtHelpFileList */
  66. typedef struct _DtHelpGlobSrchVol {
  67. unsigned int searchThisVolume:1;
  68. unsigned int nothingDone:1;
  69. unsigned int topicSearchInProgress:1;
  70. unsigned int topicSearchDone:1;
  71. unsigned int indexSearchInProgress:1;
  72. unsigned int indexSearchDone:1;
  73. unsigned int searchCompleted:1;
  74. unsigned int showVolInList:1; /* show vol in srchResultList? */
  75. unsigned int zeroHitsOk:1; /* show vol with zero hits? */
  76. unsigned int hitsDisplayed:1; /* are hits shown in list? */
  77. unsigned int showHitsWithVol:1; /* show hits of the volume? */
  78. unsigned int gatheredFullIndex:1; /* full index was gathered */
  79. unsigned int gotLocale:1; /* got locale already */
  80. struct _DtHelpGlobSrchHit * hitListHead;
  81. struct _DtHelpGlobSrchHit * hitListTail;
  82. int hitCnt; /* number hits for this volume */
  83. int startPosition; /* position of volume item */
  84. int nextVolPosition; /* pos of next vol with hits */
  85. size_t searchedCnt; /* number items searched thus far */
  86. char * * indexEntriesList;/* entries for searching */
  87. XmString * indexXmStrsList; /* entries for display */
  88. XmString * curIndexXmStr; /* position in indexXmStrsList */
  89. _DtHelpVolumeHdl volHandle;
  90. char * stdLocale; /* CDE standard locale of the volume */
  91. char * iconv3Codeset; /* iconv-compatible codeset of volume locale */
  92. _CEStrcollProc strcollProc; /* proc to do string coll */
  93. } _DtHelpGlobSrchVol;
  94. /* maintained for each location hit encountered */
  95. typedef struct _DtHelpGlobSrchHit {
  96. struct _DtHelpGlobSrchHit * next;
  97. _DtHelpFileEntry volume;
  98. int indexKey; /* hash value for quick compares */
  99. XmString indexTitle; /* title used for display */
  100. char * indexEntry; /* string used for retrieval */
  101. char ** topicIdList; /* list of topic ids of this index */
  102. char ** topicFileList;/* list of files of the topics */
  103. XmString * topicTitles; /* list of titles of the topics */
  104. short topicCnt; /* number of topics in the list */
  105. unsigned int topicsLoaded:1; /* loaded topics of this index*/
  106. unsigned int topicsDisplayed:1; /* are topics shown in list */
  107. unsigned int showTopicsWithHit:1;/* show topics if showing hit?*/
  108. } _DtHelpGlobSrchHit;
  109. #endif /* _GlobSearchP_h */
  110. /* DON'T ADD ANYTHING AFTER THIS #endif */