exec.library: do not clone value of task storage slot to children of task
[AROS.git] / test / rexx / vartest.c
blobd2aea87ba88d32bcaec373bc911ddf8d4dff5090
1 #include <proto/exec.h>
2 #include <proto/alib.h>
3 #include <proto/rexxsyslib.h>
5 #include <exec/ports.h>
6 #include <rexx/errors.h>
7 #include <rexx/storage.h>
8 #include <stdio.h>
9 #include <string.h>
11 int main(void)
13 struct MsgPort *port;
14 struct RexxMsg *msg;
15 struct Library *RexxSysBase;
16 char *value;
18 RexxSysBase = OpenLibrary("rexxsyslib.library", 0);
19 if (RexxSysBase == NULL)
21 puts("Error opening rexxsyslib.library");
22 return 20;
25 port = CreatePort("VARTEST", 1);
26 if (port == NULL)
28 puts("Error creating port");
29 CloseLibrary(RexxSysBase);
30 return 20;
33 printf("Port created %p, waiting for message\n", port);
34 WaitPort(port);
35 msg = (struct RexxMsg *)GetMsg(port);
36 puts("Got a message");
37 if (!IsRexxMsg(msg))
39 puts("Message is not a rexxmsg");
40 ReplyMsg((struct Message *)msg);
41 DeletePort(port);
42 CloseLibrary(RexxSysBase);
43 return 20;
46 puts("Is a rexx message");
47 if (!CheckRexxMsg(msg))
49 puts("Message is not from rexx interpreter");
50 msg->rm_Result1 = RC_ERROR;
51 ReplyMsg((struct Message *)msg);
52 DeletePort(port);
53 CloseLibrary(RexxSysBase);
54 return 20;
57 puts("Message is from the rexx interpreter");
58 if (GetRexxVar(msg, "A", &value) != RC_OK)
60 puts("Error during retreival of value !!");
62 else
64 printf("Length string: %d\n", (int)strlen(value));
65 printf("Value of A: %s\n", value);
68 SetRexxVar(msg, "A", "2", 1);
69 msg->rm_Result1 = RC_OK;
70 msg->rm_Result2 = 0;
71 ReplyMsg((struct Message *)msg);
72 DeletePort(port);
73 CloseLibrary(RexxSysBase);
75 return 0;