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 AROS_SLOWSTACKFORMAT_PRE(format
);
39 RawDoFmt(format
, AROS_SLOWSTACKFORMAT_ARG(format
), (VOID_FUNC
)__putChr
, &buffer
);
40 AROS_SLOWSTACKFORMAT_POST(format
);
43 LONG
rxsupp_statef(struct Library
*RexxSupportBase
, struct RexxMsg
*msg
, UBYTE
**argstring
)
48 lock
= Lock(RXARG(msg
,1), ACCESS_READ
);
51 *argstring
= CreateArgstring("", 0);
56 struct FileInfoBlock
*fib
= AllocDosObject(DOS_FIB
, NULL
);
63 string
= AllocMem(1024, MEMF_ANY
);
64 my_sprintf(RexxSupportBase
, string
, "%s %ld %ld %s%s%s%s%s%s%s%s %ld %ld %ld",
65 fib
->fib_DirEntryType
<0 ? "FILE" : "DIR",
68 fib
->fib_Protection
& 1<<8 ? "H" : "-",
69 fib
->fib_Protection
& FIBF_SCRIPT
? "S" : "-",
70 fib
->fib_Protection
& FIBF_PURE
? "P" : "-",
71 fib
->fib_Protection
& FIBF_ARCHIVE
? "A" : "-",
72 fib
->fib_Protection
& FIBF_READ
? "-" : "R",
73 fib
->fib_Protection
& FIBF_WRITE
? "-" : "W",
74 fib
->fib_Protection
& FIBF_EXECUTE
? "-" : "E",
75 fib
->fib_Protection
& FIBF_DELETE
? "-" : "D",
76 fib
->fib_Date
.ds_Days
,
77 fib
->fib_Date
.ds_Minute
,
78 fib
->fib_Date
.ds_Tick
);
79 FreeDosObject(DOS_FIB
, fib
);
82 *argstring
= CreateArgstring(string
, strlen(string
));
83 FreeMem(string
, 1024);