Merge branch 'master' into cde-next
[oweals/cde.git] / cde / lib / DtHelp / FileListUtilsI.h
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
45 #include <Xm/XmP.h>
46
47 typedef struct _DtHelpFileRec {
48   struct _DtHelpFileRec *  next;           /* next file in list */
49   char *                fileName;          /* basename plus extensions */
50   char *                fullFilePath;      /* full path of the file */
51   int                   nameKey;           /* used for quick identity compare*/
52   char *                fileTitle;         /* comparable title of file */
53   XmString              fileTitleXmStr;    /* displayable title of file */
54   char *                docId;             /* string identifying doc */
55   char *                timeStamp;         /* string with time of doc */
56   void *                clientData;        /* data assoc with the file */
57   unsigned int          fileSelected:1;    /* file selected for activity */
58   unsigned int          reservedFlag1:1; 
59   unsigned int          reservedFlag2:1;
60   unsigned int          reservedFlag3:1;
61   unsigned int          clientFlag1:1;
62   unsigned int          clientFlag2:1;
63   unsigned int          clientFlag3:1;
64   unsigned int          clientFlag4:1;
65 } _DtHelpFileRec, * _DtHelpFileEntry, * _DtHelpFileList;
66
67 typedef void (*_DtHelpFileScanProcCB)(
68           int           count,
69           XtPointer     clientData);
70
71 typedef Boolean (*_DtHelpFileInfoProc)(
72     XtPointer  pDisplayArea, /* in: display area in use */
73     char *     volumePath,    /* in: full path to file */
74     char **    ret_title,     /* out: mallocd doc title string */
75     XmString * ret_titleXmStr,/* out: mallocd doc title XmStr */
76     char **    ret_docId,     /* out: mallocd doc Id string */
77     char **    ret_timeStamp, /* out: mallocd doc time string */
78     int *      ret_nameKey,   /* out: hash value for fast discimination */
79     XmFontList * io_fontList, /* io: fontList for title */
80     Boolean *  ret_mod);      /* out: has font list been changed */
81
82
83 /* Bitwise-ORable flags that affect the comparisons 
84    done when comparing two files. */
85 typedef enum {
86   _DtHELP_FILE_NAME = 0x01,
87   _DtHELP_FILE_DIR = 0x02,
88   _DtHELP_FILE_TITLE = 0x04,
89   _DtHELP_FILE_TIME = 0x08,
90   _DtHELP_FILE_IDSTR = 0x10,
91   _DtHELP_FILE_LOCALE = 0x20
92   } _DtHelpFileAttributes;
93
94 Boolean _DtHelpFileListAddFile (
95         _DtHelpFileList *      in_out_list,
96         XmFontList *           io_fontList,
97         Boolean *              ret_mod,
98         char *                 fullFilePath,
99         char *                 fileName,
100         _DtHelpFileInfoProc    infoProc,
101         int                    compareFlags,
102         int                    sortFlags,
103         XtPointer              pDisplayArea);
104 _DtHelpFileList _DtHelpFileListGetMatch ( 
105         _DtHelpFileList     fileListHead,
106         char *              fullFilePath,
107         _DtHelpFileInfoProc infoProc,
108         int                 compareFlags,
109         XtPointer           pDisplayArea);
110 Boolean _DtHelpFileIsSameP(
111         char *              fileName1,
112         char *              fileName2,
113         _DtHelpFileInfoProc infoProc,
114         int                 compareFlags,
115         XtPointer           pDisplayArea);
116 _DtHelpFileList _DtHelpFileListGetNext (
117         _DtHelpFileList fileListHead,
118         _DtHelpFileList curFile);
119 int _DtHelpFileListScanPaths (
120         _DtHelpFileList * in_out_list,
121         XmFontList *      io_fontList,
122         Boolean *         ret_mod,
123         char *            type,
124         const char *      suffixList[],
125         Boolean           searchHomeDir,
126         _DtHelpFileInfoProc infoProc,
127         XtPointer           pDisplayArea,
128         int               sysPathCompareFlags,
129         int               otherPathCompareFlags,
130         int               sortFlags,
131         _DtHelpFileScanProcCB scanProc,
132         XtPointer         clientData);
133 void _DtHelpFileFreeEntry (
134         _DtHelpFileEntry entry);
135
136 #endif /* _FileListUtilsI_h */
137 /* DON'T ADD ANYTHING AFTER THIS #endif */
138