2 Copyright © 1995-2002, The AROS Development Team. All rights reserved.
5 Desc: Rexx stub for AllocMem system function
9 #include <proto/alib.h>
10 #include <proto/exec.h>
11 #include <proto/dos.h>
12 #include <proto/rexxsyslib.h>
13 #include <exec/types.h>
14 #include <exec/memory.h>
15 #include <dos/exall.h>
16 #include <rexx/storage.h>
17 #include <rexx/errors.h>
22 #include "rexxsupport_intern.h"
23 #include "rxfunctions.h"
25 AROS_UFH2(void, __putChr
,
26 AROS_UFHA(UBYTE
, chr
, D0
),
27 AROS_UFHA(STRPTR
*, p
, A3
))
36 void my_sprintf(struct Library
*RexxSupportBase
, UBYTE
*buffer
, UBYTE
*format
, ...)
38 RawDoFmt(format
, &format
+1, (VOID_FUNC
)__putChr
, &buffer
);
41 LONG
rxsupp_statef(struct Library
*RexxSupportBase
, struct RexxMsg
*msg
, UBYTE
**argstring
)
46 lock
= Lock(RXARG(msg
,1), ACCESS_READ
);
49 *argstring
= CreateArgstring("", 0);
54 struct FileInfoBlock
*fib
= AllocDosObject(DOS_FIB
, NULL
);
61 string
= AllocMem(1024, MEMF_ANY
);
62 my_sprintf(RexxSupportBase
, string
, "%s %ld %ld %s%s%s%s%s%s%s%s %ld %ld %ld",
63 fib
->fib_DirEntryType
<0 ? "FILE" : "DIR",
66 fib
->fib_Protection
& 1<<8 ? "H" : "-",
67 fib
->fib_Protection
& FIBF_SCRIPT
? "S" : "-",
68 fib
->fib_Protection
& FIBF_PURE
? "P" : "-",
69 fib
->fib_Protection
& FIBF_ARCHIVE
? "A" : "-",
70 fib
->fib_Protection
& FIBF_READ
? "-" : "R",
71 fib
->fib_Protection
& FIBF_WRITE
? "-" : "W",
72 fib
->fib_Protection
& FIBF_EXECUTE
? "-" : "E",
73 fib
->fib_Protection
& FIBF_DELETE
? "-" : "D",
74 fib
->fib_Date
.ds_Days
,
75 fib
->fib_Date
.ds_Minute
,
76 fib
->fib_Date
.ds_Tick
);
77 FreeDosObject(DOS_FIB
, fib
);
80 *argstring
= CreateArgstring(string
, strlen(string
));
81 FreeMem(string
, 1024);