git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@31540 fb15a70f-31f2-0310-bbcc...
[cake.git] / test / openlib.c
blobc7d38c7fda55da17daa1babd1d84258fc0576165
1 /*
2 Copyright © 1995-2004 The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Tool to test openlib closelib functions.
6 Lang: english
7 */
8 #define DEBUG 1
9 #include <aros/debug.h>
11 #include <exec/memory.h>
12 #include <dos/dos.h>
13 #include <dos/exall.h>
14 #include <dos/datetime.h>
15 #include <proto/dos.h>
16 #include <proto/utility.h>
17 #include <utility/tagitem.h>
18 #include <utility/utility.h>
20 #include <proto/alib.h>
21 #include <proto/exec.h>
22 #include <proto/dos.h>
24 #include <stdio.h>
25 #include <string.h>
26 #include <stdlib.h>
27 #include <memory.h>
29 static const char version[] = "$VER: openlib.c 45.0 (16.1.2004)\n";
31 #define ARG_TEMPLATE "LIBRARY/A,DIRTY/S"
33 enum
35 ARG_LIBNAME,
36 ARG_DIRTY,
37 NOOFARGS
40 int main(int argc, char **argv)
42 IPTR args[NOOFARGS] = {0, // ARG_LIBNAME
43 FALSE // ARG_DIRTY
45 struct RDArgs *rda;
46 rda = ReadArgs(ARG_TEMPLATE, args, NULL);
47 if (NULL != rda)
49 if (args[ARG_LIBNAME]!=0)
51 APTR tmpBase = OpenLibrary((CONST_STRPTR) args[ARG_LIBNAME],0);
52 if (tmpBase != 0)
54 printf ("OPENLIB.c: Succesfully opened !\n");
56 if (args[ARG_DIRTY] == FALSE)
58 CloseLibrary(tmpBase);
59 printf ("OPENLIB.c: Library closed\n");
62 }else{
63 printf("OPENLIB.c: Library open FAILED!\n");
65 }else{
66 printf("OPENLIB.c: Please specify a library to open!\n");
68 FreeArgs(rda);
70 return 0;