Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / programs / dtfile / dtcopy / dtcopy.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 librararies 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: dtcopy.h /main/7 1996/10/29 17:08:48 mustafa $ */
24 /************************************<+>*************************************
25  ****************************************************************************
26  *
27  *   FILE:           dtcopy.h
28  *
29  *
30  *   DESCRIPTION:    Header file used in copydialog.c,errordialog.c
31  *                   main_dtcopy.c,overwrtdialog.c,utils.c
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 /* Macros */
42 #define MAX_PATH      1024
43
44 #define G_OVERWRITE_EXISTING            0
45 #define G_SKIP                          1
46 #define G_RENAME_EXISTING               2
47 #define N_OVERWRITE_RADIO_BUTTONS       3
48
49 /* Help numbers that are used locally in dtcopy
50  * to indentify what help volume should be used
51  * for a particular callback.  Look to utils.c
52  * in help_callback for code.  MJT
53  */
54 #define HELP_HELP_MENU                  1
55 #define HELP_INTRODUCTION               2
56 #define HELP_DIR_COPY                   3
57 #define HELP_DIR_ERROR                  4
58 #define HELP_OVERWRITE                  5
59 #define HELP_USING                      6
60 #define HELP_VERSION                    7
61 #define STOPW_HELP_DIALOG               9
62
63 /*  debugging output  */
64 #ifdef DEBUG
65 extern int debug;
66 #define DPRINTF(p)  if (debug) printf p
67 #define DPRINTF2(p) if (debug >= 2) printf p
68 #else
69 #define DPRINTF(p)  /* noop */
70 #define DPRINTF2(p) /* noop */
71 #endif
72
73 /* _DtMessage Dialog build defines */
74 #define ERROR_DIALOG  1
75 #define WARNING_DIALOG  2
76 #define QUESTION_DIALOG 3
77
78 /* Global Variables */
79 extern Widget G_toplevel;
80 extern Widget G_overwrite_radio;
81 extern Widget G_summary_text;
82 extern Widget G_status_text;
83 extern Widget G_status_text2;
84 extern Widget G_error_count;
85 extern Widget G_error_msgs;
86 extern Widget G_copy_dialog;
87 extern Widget G_error_dialog;
88 extern Widget G_over_dialog;
89 extern Widget G_over_confirm;
90 extern Widget G_copy_action_area_pbuttons[4];
91 extern Widget G_help_dialog;
92 extern Widget G_rename_text;
93 extern Widget G_toggle_main;
94 extern Widget G_toggle_error;
95
96 extern char  G_rename_oldname[];
97 extern char  G_source_dir[];
98 extern int G_move;
99 extern int G_do_copy;
100 extern int G_pause_copy;
101 extern int G_user_pause_copy;
102 extern int G_wait_on_error;
103 extern int G_error_status;
104 extern int G_ignore_errors;
105 extern int G_overwrite_selection;
106 extern int G_overwrite_confirm;
107 extern int G_wait_on_input;
108 extern int G_dialog_closed;
109
110 /* Types */
111
112
113 /* External Routines */
114
115 extern void help_callback(
116         Widget widget,
117         XtPointer client_data,
118         XtPointer call_data);
119 extern void sensitize_copy_action_area(
120                 Widget *pushbutton_array);
121 extern void desensitize_copy_action_area(
122                 Widget *pushbutton_array);
123 extern Boolean create_copydir_dialog(
124                 Widget parent_widget,
125                 char *source,
126                 char *target);
127 extern void create_error_dialog(
128                 Widget parent_widget,
129                 char *op,
130                 char *filename,
131                 int errnum);
132 extern void create_overwrite_dialog(
133                 Widget parent_widget,
134                 char *sname,
135                 char *tname,
136                 Boolean isdir);
137 extern void _DtChildPosition(
138                 Widget w,
139                 Widget parent,
140                 Position *newX,
141                 Position *newY);
142 extern void cancel_callback(
143                 Widget w,
144                 XtPointer client_data,
145                 XtPointer call_data);
146 extern void display_cancel_warning(Widget parent);
147 extern void toggle_callback(
148                 Widget w,
149                 XtPointer client_data,
150                 XtPointer call_data);
151 extern int  touch(String path);
152
153 /*
154  * macro to get message catalog strings
155  */
156
157 #ifndef NO_MESSAGE_CATALOG
158 # ifdef __ultrix
159 #  define _CLIENT_CAT_NAME "dtcopy.cat"
160 # else  /* __ultrix */
161 #  define _CLIENT_CAT_NAME "dtcopy"
162 # endif /* __ultrix */
163 extern char *_DtGetMessage(char *filename, int set, int n, char *s);
164 # define GETMESSAGE(set, number, string)\
165     (_DtGetMessage(_CLIENT_CAT_NAME, set, number, string))
166 #else
167 # define GETMESSAGE(set, number, string)\
168     string
169 #endif