added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / compiler / include / rexx / storage.h
blob282086ace3f31e2e55ebb3daba4fcd065c031079
1 #ifndef REXX_STORAGE_H
2 #define REXX_STORAGE_H
4 /*
5 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
6 $Id$
8 Desc: ARexx data structures
9 Lang: English
12 #ifndef EXEC_TYPES_H
13 # include <exec/types.h>
14 #endif
15 #ifndef EXEC_PORTS_H
16 # include <exec/ports.h>
17 #endif
18 #ifndef DOS_DOSEXTENS_H
19 # include <dos/dosextens.h>
20 #endif
22 struct RexxMsg
24 struct Message rm_Node;
25 IPTR rm_Private1; /* Was rm_TaskBlock */
26 IPTR rm_Private2; /* Was rm_LibBase */
27 LONG rm_Action; /* What to do ? */
28 LONG rm_Result1; /* The first result as a number */
29 IPTR rm_Result2; /* The second result, most of the time an argstring */
30 IPTR rm_Args[16]; /* 16 possible arguments for function calls */
31 struct MsgPort *rm_PassPort;
32 STRPTR rm_CommAddr; /* The starting host environment */
33 STRPTR rm_FileExt; /* The file extension for macro files */
34 struct FileHandle *rm_Stdin; /* Input filehandle to use */
35 struct FileHandle *rm_Stdout; /* Output filehandle to use */
36 LONG rm_Unused1; /* Was rm_avail */
38 /* AROS comment: rm_Private1 and rm_Private2 are implementation specific.
39 * When sending a message that is meant to be handled in the same environment as
40 * another message one received from somewhere, these fields have to be copied
41 * to the new message.
44 /* Shortcuts for the arguments */
45 #define ARG0(msg) ((UBYTE *)msg->rm_Args[0])
46 #define ARG1(msg) ((UBYTE *)msg->rm_Args[1])
47 #define ARG2(msg) ((UBYTE *)msg->rm_Args[2])
48 #define RXARG(msg,n) ((UBYTE *)msg->rm_Args[n])
50 /* The command for in rm_Action */
51 #define RXCOMM 0x01000000
52 #define RXFUNC 0x02000000
53 #define RXCLOSE 0x03000000
54 #define RXQUERY 0x04000000
55 #define RXADDFH 0x07000000
56 #define RXADDLIB 0x08000000
57 #define RXREMLIB 0x09000000
58 #define RXADDCON 0x0A000000
59 #define RXREMCON 0x0B000000
60 #define RXTCOPN 0x0C000000
61 #define RXTCCLS 0x0D000000
63 /* Some commands added for AROS and regina only */
64 #define RXADDRSRC 0xF0000000 /* Will register a resource node to call the clean up function
65 * from when the rexx script finishes
66 * The rexx implementation is free to use the list node fields
67 * for their own purpose. */
68 #define RXREMRSRC 0xF1000000 /* Will unregister an earlier registered resource node */
69 #define RXCHECKMSG 0xF2000000 /* Check if private fields are from the Rexx interpreter */
70 #define RXSETVAR 0xF3000000 /* Set a variable with a given to a given value */
71 #define RXGETVAR 0xF4000000 /* Get the value of a variable with the given name */
73 #define RXCODEMASK 0xFF000000
74 #define RXARGMASK 0x0000000F
76 /* Flags that can be combined with the commands */
77 #define RXFB_NOIO 16
78 #define RXFB_RESULT 17
79 #define RXFB_STRING 18
80 #define RXFB_TOKEN 19
81 #define RXFB_NONRET 20
82 #define RXFB_FUNCLIST 5
84 /* Convert from bit number to number */
85 #define RXFF_NOIO (1<<RXFB_NOIO)
86 #define RXFF_RESULT (1<<RXFB_RESULT)
87 #define RXFF_STRING (1<<RXFB_STRING)
88 #define RXFF_TOKEN (1<<RXFB_TOKEN)
89 #define RXFF_NONRET (1<<RXFB_NONRET)
91 struct RexxArg
93 LONG ra_Size;
94 UWORD ra_Length;
95 UBYTE ra_Depricated1; /* Was ra_Flags but not used anymore */
96 UBYTE ra_Depricated2; /* Was ra_Hash but not used anymore */
97 BYTE ra_Buff[8];
100 struct RexxRsrc
102 struct Node rr_Node;
103 WORD rr_Func; /* Library offset of clean up function */
104 APTR rr_Base; /* Library base of clean up function */
105 LONG rr_Size; /* Total size of structure */
106 LONG rr_Arg1; /* Meaning depends on type of Resource */
107 LONG rr_Arg2; /* Meaning depends on type of Resource */
110 /* Types for the resource nodes */
111 #define RRT_ANY 0
112 #define RRT_LIB 1 /* A function library */
113 /*#define RRT_PORT 2 Not used */
114 /*#define RRT_FILE 3 Not used */
115 #define RRT_HOST 4 /* A function host */
116 #define RRT_CLIP 5 /* A clip on the clip list */
118 #endif /* REXX_STORAGE_H */