2 Copyright © 2004, The AROS Development Team. All rights reserved.
3 This file is part of the LoadResource program, which is distributed under
4 the terms of version 2 of the GNU General Public License.
7 + Implement LOCK and UNLOCK options. Argument template should then be
8 changed to "NAME/M,LOCK/S,UNLOCK/S"; if the user doesn't provide NAME,
9 then all currently locked resources shall be listed.
10 + Implement support for loading devices, fonts and catalogs.
13 #include <proto/exec.h>
14 #include <proto/dos.h>
23 #define TEMPLATE "NAME/M/A"
24 #define ERROR_HEADER "LoadResource"
26 BOOL
process(CONST_STRPTR name
);
31 struct RDArgs
*rdargs
= NULL
;
32 IPTR args
[ARG_COUNT
] = { 0 };
34 if ((rdargs
= ReadArgs(TEMPLATE
, args
, NULL
)) != NULL
)
36 if (args
[ARG_NAME
] != 0)
38 CONST_STRPTR
*names
= (CONST_STRPTR
*) args
[ARG_NAME
],
41 while ((name
= *names
++) != NULL
)
51 // FIXME: List currently locked resources.
58 PrintFault(IoErr(), ERROR_HEADER
);
65 BOOL
process(CONST_STRPTR name
)
67 struct Library
*lb
= OpenLibrary(name
, 0L);
76 PutStr(ERROR_HEADER
": ");
77 Printf(_(MSG_ERROR_OPEN_LIBRARY
), name
);