1 typedef char * caddr_t
;
2 typedef unsigned Cursor
;
4 typedef struct _WidgetRec
*Widget
;
6 typedef unsigned int Cardinal
;
7 typedef struct _XedwListReturnStruct
{
10 struct _XedwListReturnStruct
*next
;
11 } XedwListReturnStruct
;
12 static XedwListReturnStruct
*return_list
;
13 static String srcdir
, dstdir
;
15 extern void setCursor(Cursor
);
16 extern void query_dialog(String
, Boolean
);
17 extern Boolean
directoryManagerNewDirectory(String
);
18 trashQueryResult(Widget w
, Boolean
delete, caddr_t call_data
)
20 int execute(String
, String
, String
, Boolean
);
21 extern void destroy_button_dialog(void);
22 extern void changestate(Boolean
);
24 extern Cursor busy
, left_ptr
;
26 extern void freeReturnStruct(void);
29 XedwListReturnStruct
*tmp
;
31 destroy_button_dialog();
33 rmstring
= (("rm -fr") != ((void *)0) ? (strcpy((char*)XtMalloc((unsigned)strlen("rm -fr") + 1), "rm -fr")) : ((void *)0));
35 while (tmp
!= ((void *)0)) {
36 rmstring
= (String
) XtRealloc (rmstring
, sizeof(char) *
38 strlen(tmp
->string
) + 5));
39 sprintf(rmstring
, "%s '%s'", rmstring
, tmp
->string
);
42 if ((status
= execute(((void *)0), "rm", rmstring
, 1)) != 0) {
43 XBell(XtDisplay(w
), 100);
44 query_dialog("Can't remove file", 0);
48 directoryManagerNewDirectory(cwd
);
56 copyQueryResult(Widget w
, Boolean copy
, caddr_t call_data
)
58 extern void destroy_button_dialog();
59 extern void changestate(Boolean
);
60 extern Cursor busy
, left_ptr
;
61 extern void freeReturnStruct(void);
62 int execute(String
, String
, String
, Boolean
);
66 Cardinal srclen
, dstlen
;
67 XedwListReturnStruct
*tmp
;
68 destroy_button_dialog();
71 srclen
= strlen(srcdir
);
72 dstlen
= strlen(dstdir
);
73 copystring
= (("cp -r") != ((void *)0) ? (strcpy((char*)XtMalloc((unsigned)strlen("cp -r") + 1), "cp -r")) : ((void *)0));
75 while (tmp
!= ((void *)0)) {
76 copystring
= (String
) XtRealloc (copystring
, sizeof(char) *
80 sprintf(copystring
, "%s '%s/%s'", copystring
, srcdir
, tmp
->string
);
83 copystring
= (String
) XtRealloc (copystring
, sizeof(char) *
86 sprintf(copystring
, "%s '%s'", copystring
, dstdir
);
87 if ((status
= execute(((void *)0), "cp", copystring
, 1)) != 0) {
88 XBell(XtDisplay(w
), 100);
89 query_dialog("Can't copy file!", 0);
93 directoryManagerNewDirectory(cwd
);