2 Copyright © 2003, The AROS Development Team. All rights reserved.
6 #define MUIMASTER_YES_INLINE_STDARG
9 #include <aros/debug.h>
11 #include <proto/intuition.h>
12 #include <proto/exec.h>
13 #include <proto/muimaster.h>
14 #include <proto/workbench.h>
15 #include <proto/dos.h>
18 #include <libraries/asl.h>
19 #include <libraries/mui.h>
20 #include <workbench/workbench.h>
21 #include <workbench/startup.h>
27 STRPTR
AllocateNameFromLock(BPTR lock
);
29 int main(int argc
, char **argv
)
31 int result
= RETURN_OK
;
35 struct WBStartup
*startup
= (struct WBStartup
*) argv
;
37 if (startup
->sm_NumArgs
== 2)
39 BPTR parent
= startup
->sm_ArgList
[1].wa_Lock
;
40 STRPTR name
= startup
->sm_ArgList
[1].wa_Name
;
47 _(MSG_DELETE_REQUEST
), _(MSG_DELETE_CHOICE
),
48 _(MSG_REQUEST
), (IPTR
) name
52 BPTR cd
= CurrentDir(parent
);
53 BPTR lock
= Lock(name
, ACCESS_WRITE
);
57 STRPTR buffer
= AllocateNameFromLock(lock
);
65 UpdateWorkbenchObject(buffer
, WBPROJECT
, TAG_DONE
);
72 _(MSG_ERROR
), _(MSG_OK
),
84 _(MSG_ERROR
), _(MSG_OK
),
85 _(MSG_COULDNT_ALLOCATE
)
94 _(MSG_ERROR
), _(MSG_OK
),
102 else if (startup
->sm_NumArgs
> 2)
106 for (i
= 1; i
< startup
->sm_NumArgs
; i
++)
110 "WANDERER:Tools/Delete",
111 WBOPENA_ArgLock
, (IPTR
) startup
->sm_ArgList
[i
].wa_Lock
,
112 WBOPENA_ArgName
, (IPTR
) startup
->sm_ArgList
[i
].wa_Name
,
122 _(MSG_INFO
), _(MSG_OK
), _(MSG_WRONG_ARGS
), NULL
124 result
= RETURN_ERROR
;
129 PutStr(_(MSG_WB_ONLY
));
130 result
= RETURN_FAIL
;
135 STRPTR
AllocateNameFromLock(BPTR lock
)
138 STRPTR buffer
= NULL
;
143 if (buffer
!= NULL
) FreeVec(buffer
);
145 buffer
= AllocVec(length
, MEMF_ANY
);
148 if (NameFromLock(lock
, buffer
, length
))
155 if (IoErr() == ERROR_LINE_TOO_LONG
)
168 SetIoErr(ERROR_NO_FREE_STORE
);
179 if (buffer
!= NULL
) FreeVec(buffer
);