grub2: bring back build of aros-side grub2 tools
[AROS.git] / workbench / demos / rtezrequest.c
blob548aaa7a41326f46dd2cd45fb0726b214db7cc29
2 #include <libraries/reqtools.h>
3 #include <proto/exec.h>
4 #include <proto/reqtools.h>
6 #include <stdio.h>
7 #include <string.h>
8 #include <stdlib.h>
10 #define PROGNAME "rtezrequest"
12 struct ReqToolsBase *ReqToolsBase;
14 static void cleanup(char *msg)
16 if (msg) printf(PROGNAME ": %s\n", msg);
18 if (ReqToolsBase) CloseLibrary((struct Library *)ReqToolsBase);
20 exit(0);
23 static void openlibs(void)
25 ReqToolsBase = (struct ReqToolsBase *)OpenLibrary("reqtools.library", 0);
26 if (!ReqToolsBase) cleanup("Can't open reqtools.library");
29 static void action(void)
31 struct TagItem tags[] =
33 { RT_Underscore , (IPTR)'_' },
34 { RTEZ_ReqTitle , (IPTR)"I'm a ReqTools Requester" },
35 { TAG_DONE }
38 IPTR args[] = {(IPTR)"ABCDEF12345678", 12345678};
40 rtEZRequestA("This is a requester\n"
41 "which was created\n"
42 "with rtEZRequestA\n"
43 "\n"
44 "String arg: \"%s\" Integer arg: %ld",
45 "_Ok|Coo_l|So _what",
46 NULL,
47 args,
48 tags);
52 int main(void)
54 openlibs();
55 action();
56 cleanup(0);
58 return 0;