libDtSearch: Coverity 86579
[oweals/cde.git] / cde / programs / dtfile / SharedProcs.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: SharedProcs.h /main/4 1995/11/02 14:44:13 rswiston $ */
24 /************************************<+>*************************************
25  ****************************************************************************
26  *
27  *   FILE:           SharedProcs.h
28  *
29  *   COMPONENT_NAME: Desktop File Manager
30  *
31  *   DESCRIPTION:    Public include file for some shared functions.
32  *
33  *   (c) Copyright 1993, 1994, 1995 Hewlett-Packard Company
34  *   (c) Copyright 1993, 1994, 1995 International Business Machines Corp.
35  *   (c) Copyright 1993, 1994, 1995 Sun Microsystems, Inc.
36  *   (c) Copyright 1993, 1994, 1995 Novell, Inc.
37  *
38  ****************************************************************************
39  ************************************<+>*************************************/
40
41 #ifndef _DtFile_SharedProcs_h
42 #define _DtFile_SharedProcs_h
43
44 #include <Dt/Icon.h>
45 #include <Dt/Action.h>
46 #include <Dt/Dnd.h>
47
48 #include "Common.h"
49 #include "FileMgr.h"
50
51 /********    Public Function Declarations    ********/
52
53 extern String _DtStripSpaces(
54                         String string) ;
55
56 extern char * _DtPName(
57                         char *name) ;
58 extern char * _DtFollowLink(
59                         char * path) ;
60 extern Boolean _DtStringsAreEquivalent(
61                         char *in_str,
62                         char *test_str) ;
63 extern void _DtDuplicateDialogNameList (
64                         char ** nameList,
65                         char ** newNameList,
66                         int newNameListSize,
67                         int * nameCount) ;
68 extern void _DtLoadSubdialogArray (
69                         char ** nameList,
70                         int    nameCount,
71                         DialogData *** dialogArray,
72                         int    dialogCount,
73                         int    dialogId,
74                         XrmDatabase dataBase,
75                         int    firstId );
76 extern void _DtSaveSubdialogArray (
77                         char ** nameList,
78                         int    nameCount,
79                         DialogData ** dialogArray,
80                         int    dialogCount,
81                         int    fd,
82                         int    firstId );
83 extern void _DtDestroySubdialogArray (
84                         DialogData ** dialogArray,
85                         int    dialogCount) ;
86 extern void _DtDestroySubdialog (
87                         DialogData * dialogData) ;
88 extern void _DtHideOneSubdialog (
89                         DialogData * dialogData,
90                         DialogData *** dialogArray,
91                         int         * dialogCountPtr) ;
92 extern void _DtAddOneSubdialog (
93                         DialogData * dialogData,
94                         DialogData *** dialogArray,
95                         int         * dialogCountPtr) ;
96 extern void _DtMappedCB(
97                         Widget w,
98                         XtPointer client_data,
99                         XtPointer call_data) ;
100 extern void _DtGenericMapWindow (
101                         Widget parent,
102                         XtPointer recordPtr) ;
103 extern void _DtGenericDestroy(
104                         XtPointer recordPtr) ;
105 extern void _DtGenericUpdateWindowPosition(
106                         DialogData * dataPtr) ;
107 extern void _DtBuildPath(
108                         char         *path,
109                         char         *directory,
110                         char         *fileName) ;
111 extern PixmapData * _DtRetrievePixmapData(
112                         char         *dataType,
113                         char         *fileName,
114                         char         *directory,
115                         Widget        shell,
116                         int           size);
117 extern void _DtCheckAndFreePixmapData(
118                         char         *dataType,
119                         Widget        shell,
120                         DtIconGadget  iconGadget,
121                         PixmapData   *pixmapData) ;
122 extern Boolean _DtCheckForDataTypeProperty(
123                         char *dataType,
124                         char *property) ;
125 extern char ** _DtCompileActionVector(
126                         char *dataType) ;
127 extern char * _DtRetrieveDefaultAction(
128                         char *dataType) ;
129 extern char * _DtBuildFMTitle(
130                         FileMgrData *file_mgr_data) ;
131 extern char * _DtGetSelectedFilePath(
132                         FileViewData *selected_file) ;
133 extern void _DtBuildActionArgsWithSelectedFiles(
134                         FileViewData **selection_list,
135                         int selected_file_count,
136                         DtActionArg **action_args,
137                         int *args_count) ;
138
139 extern void _DtBuildActionArgsWithDroppedFiles(
140                         FileViewData *dropped_on_obj,
141                         DtDndDropCallbackStruct *drop_parameters,
142                         DtActionArg **action_args,
143                         int *args_count) ;
144 extern void _DtBuildActionArgsWithDroppedBuffers(
145                         FileViewData *dropped_on_obj,
146                         DtDndDropCallbackStruct *drop_parameters,
147                         DtActionArg **action_args,
148                         int *args_count) ;
149 extern void _DtFreeActionArgs(
150                         DtActionArg *action_args,
151                         int args_count) ;
152 extern void _DtSetDroppedBufferInfo(
153                         char **file_set,
154                         BufferInfo *buffer_set,
155                         char **host_set,
156                         DtDndDropCallbackStruct *drop_parameters);
157 extern void _DtFreeDroppedBufferInfo (
158                         char **file_set,
159                         BufferInfo *buffer_set,
160                         char **host_set,
161                         int num_of_buffers);
162 extern Boolean _DtIsBufferExecutable(
163                         void *buffer,
164                         int buffer_size) ;
165 extern void _DtSetDroppedFileInfo(
166                         DtDndDropCallbackStruct *drop_parameters,
167                         char ***file_set,
168                         char ***host_set) ;
169 extern void _DtCopyDroppedFileInfo(
170                         int num_files,
171                         char **orig_file_set,
172                         char **orig_host_set,
173                         char ***new_file_set,
174                         char ***new_host_set) ;
175 extern void _DtFreeDroppedFileInfo(
176                         int num_files,
177                         char **file_set,
178                         char **host_set) ;
179 extern void _DtPathFromInput(
180                         char *input_string,
181                         char *current_dir,
182                         char **host,
183                         char **rel_path) ;
184 extern char * _DtChangeTildeToHome(
185                         char *input_string) ;
186 extern Boolean _DtSpacesInFileNames(
187                         char **fileNames,
188                         int fileCount) ;
189 extern char * _DtResolveAppManPath(
190                         char *path,
191                         char *restricted_dir) ;
192
193 /********    End Public Function Declarations    ********/
194
195 /* _DtMessage Dialog build defines */
196 #define ERROR_DIALOG  1
197 #define WARNING_DIALOG  2
198 #define QUESTION_DIALOG 3
199
200 /* Flag which can be used to prevent error dialogs from being posted */
201 extern Boolean messageDisplayEnabled;
202
203 /* Flag controlling whether dialogs are auto-positioned */
204 extern Boolean disableDialogAutoPlacement;
205
206 #endif /* _DtFile_SharedProcs_h */
207 /* DON'T ADD ANYTHING AFTER THIS #endif */