2 Copyright © 1995-2002, The AROS Development Team. All rights reserved.
5 Desc: Rexx stub for AllocMem system function
9 #include <proto/exec.h>
10 #include <proto/rexxsyslib.h>
11 #include <exec/types.h>
12 #include <exec/memory.h>
13 #include <rexx/storage.h>
14 #include <rexx/errors.h>
19 #include "rexxsupport_intern.h"
20 #include "rxfunctions.h"
22 LONG
rxsupp_allocmem(struct Library
*RexxSupportBase
, struct RexxMsg
*msg
, UBYTE
**argstring
)
27 ULONG attributes
= MEMF_PUBLIC
;
29 if ((msg
->rm_Action
& RXARGMASK
) == 2)
31 if (LengthArgstring(ARG2(msg
)) != 4)
38 /* This value has always has to be given in little endian to keep arexx
40 UBYTE
*bytes
= ARG2(msg
);
41 attributes
= (ULONG
)bytes
[0]<<24 | (ULONG
)bytes
[1]<<16 | (ULONG
)bytes
[2]<<8 | (ULONG
)bytes
[3];
44 size
= strtoul(ARG1(msg
), &end
, 10);
45 while (isspace(*end
)) end
++;
51 mem
= AllocMem(size
, attributes
);
59 *argstring
= CreateArgstring((UBYTE
*)&mem
, sizeof(void *));