FileListUtilsI.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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: FileListUtilsI.h /main/5 1995/10/26 12:19:25 rswiston $ */
  24. /************************************<+>*************************************
  25. ****************************************************************************
  26. **
  27. ** File: FileListUtilsI.h
  28. **
  29. ** Project: DtHelp Project
  30. **
  31. ** Description: File locating and handling utilities
  32. **
  33. **
  34. ** (c) Copyright 1993, 1994 Hewlett-Packard Company
  35. ** (c) Copyright 1993, 1994 International Business Machines Corp.
  36. ** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
  37. ** (c) Copyright 1993, 1994 Novell, Inc.
  38. **
  39. **
  40. ****************************************************************************
  41. ************************************<+>*************************************/
  42. #ifndef _FileListUtilsI_h
  43. #define _FileListUtilsI_h
  44. #include <Xm/XmP.h>
  45. typedef struct _DtHelpFileRec {
  46. struct _DtHelpFileRec * next; /* next file in list */
  47. char * fileName; /* basename plus extensions */
  48. char * fullFilePath; /* full path of the file */
  49. int nameKey; /* used for quick identity compare*/
  50. char * fileTitle; /* comparable title of file */
  51. XmString fileTitleXmStr; /* displayable title of file */
  52. char * docId; /* string identifying doc */
  53. char * timeStamp; /* string with time of doc */
  54. void * clientData; /* data assoc with the file */
  55. unsigned int fileSelected:1; /* file selected for activity */
  56. unsigned int reservedFlag1:1;
  57. unsigned int reservedFlag2:1;
  58. unsigned int reservedFlag3:1;
  59. unsigned int clientFlag1:1;
  60. unsigned int clientFlag2:1;
  61. unsigned int clientFlag3:1;
  62. unsigned int clientFlag4:1;
  63. } _DtHelpFileRec, * _DtHelpFileEntry, * _DtHelpFileList;
  64. typedef void (*_DtHelpFileScanProcCB)(
  65. int count,
  66. XtPointer clientData);
  67. typedef Boolean (*_DtHelpFileInfoProc)(
  68. XtPointer pDisplayArea, /* in: display area in use */
  69. char * volumePath, /* in: full path to file */
  70. char ** ret_title, /* out: mallocd doc title string */
  71. XmString * ret_titleXmStr,/* out: mallocd doc title XmStr */
  72. char ** ret_docId, /* out: mallocd doc Id string */
  73. char ** ret_timeStamp, /* out: mallocd doc time string */
  74. int * ret_nameKey, /* out: hash value for fast discimination */
  75. XmFontList * io_fontList, /* io: fontList for title */
  76. Boolean * ret_mod); /* out: has font list been changed */
  77. /* Bitwise-ORable flags that affect the comparisons
  78. done when comparing two files. */
  79. typedef enum {
  80. _DtHELP_FILE_NAME = 0x01,
  81. _DtHELP_FILE_DIR = 0x02,
  82. _DtHELP_FILE_TITLE = 0x04,
  83. _DtHELP_FILE_TIME = 0x08,
  84. _DtHELP_FILE_IDSTR = 0x10,
  85. _DtHELP_FILE_LOCALE = 0x20
  86. } _DtHelpFileAttributes;
  87. Boolean _DtHelpFileListAddFile (
  88. _DtHelpFileList * in_out_list,
  89. XmFontList * io_fontList,
  90. Boolean * ret_mod,
  91. char * fullFilePath,
  92. char * fileName,
  93. _DtHelpFileInfoProc infoProc,
  94. int compareFlags,
  95. int sortFlags,
  96. XtPointer pDisplayArea);
  97. _DtHelpFileList _DtHelpFileListGetMatch (
  98. _DtHelpFileList fileListHead,
  99. char * fullFilePath,
  100. _DtHelpFileInfoProc infoProc,
  101. int compareFlags,
  102. XtPointer pDisplayArea);
  103. Boolean _DtHelpFileIsSameP(
  104. char * fileName1,
  105. char * fileName2,
  106. _DtHelpFileInfoProc infoProc,
  107. int compareFlags,
  108. XtPointer pDisplayArea);
  109. _DtHelpFileList _DtHelpFileListGetNext (
  110. _DtHelpFileList fileListHead,
  111. _DtHelpFileList curFile);
  112. int _DtHelpFileListScanPaths (
  113. _DtHelpFileList * in_out_list,
  114. XmFontList * io_fontList,
  115. Boolean * ret_mod,
  116. char * type,
  117. const char * suffixList[],
  118. Boolean searchHomeDir,
  119. _DtHelpFileInfoProc infoProc,
  120. XtPointer pDisplayArea,
  121. int sysPathCompareFlags,
  122. int otherPathCompareFlags,
  123. int sortFlags,
  124. _DtHelpFileScanProcCB scanProc,
  125. XtPointer clientData);
  126. void _DtHelpFileFreeEntry (
  127. _DtHelpFileEntry entry);
  128. #endif /* _FileListUtilsI_h */
  129. /* DON'T ADD ANYTHING AFTER THIS #endif */