another polish locale.
[AROS.git] / workbench / demos / rtezrequest.c
blobdf7b86bc4f92cdecb0cd7465ed1075ed49e778c8
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 #include <clib/alib_protos.h>
12 #define PROGNAME "rtezrequest"
14 struct ReqToolsBase *ReqToolsBase;
16 static void cleanup(char *msg)
18 if (msg) printf(PROGNAME ": %s\n", msg);
20 if (ReqToolsBase) CloseLibrary((struct Library *)ReqToolsBase);
22 exit(0);
25 static void openlibs(void)
27 ReqToolsBase = (struct ReqToolsBase *)OpenLibrary("reqtools.library", 0);
28 if (!ReqToolsBase) cleanup("Can't open reqtools.library");
31 static void myEZRequest(struct TagItem *tags, struct rtReqInfo *reqinfo, char *bodyfmt, char *gadfmt, ...)
33 AROS_SLOWSTACKFORMAT_PRE_USING(gadfmt, bodyfmt)
34 rtEZRequestA(bodyfmt, gadfmt, reqinfo, AROS_SLOWSTACKFORMAT_ARG(gadfmt), tags);
35 AROS_SLOWSTACKFORMAT_POST(gadfmt)
38 static void action(void)
40 struct TagItem tags[] =
42 { RT_Underscore , (IPTR)'_' },
43 { RTEZ_ReqTitle , (IPTR)"I'm a ReqTools Requester" },
44 { TAG_DONE }
47 myEZRequest(tags, NULL,
48 "This is a requester\n"
49 "which was created\n"
50 "with rtEZRequestA",
51 "_Ok");
53 myEZRequest(tags, NULL,
54 "And another rtEZRequestA\n"
55 "requester\n"
56 "\n"
57 "String arg: \"%s\" Integer arg: %ld",
58 "Coo_l|So _what",
59 "ABCDEF12345678", 12345678);
62 int main(void)
64 openlibs();
65 action();
66 cleanup(0);
68 return 0;