rexxsupport.library Reference¶
Comprehensive function reference for rexxsupport.library, synthesised from the AmigaOS NDK 3.2 Release 4 (Autodocs/rexxsupport).
This page documents 23 functions of rexxsupport.library. Each function entry follows the canonical autodoc format. struct Name, union Name, enum Name are clickable links to the type definition in the types reference.
Function index¶
ALLOCMEM()BADDR()CLOSEPORT()DELAY()DELETE()FORBID()FORWARD()FREEMEM()GETARG()GETPKT()MAKEDIR()NEXT()NULL()OFFSET()OPENPORT()PERMIT()RENAME()REPLY()SHOWDIR()SHOWLIST()STATEF()TYPEPKT()WAITPKT()
ALLOCMEM()¶
ALLOCMEM -- Allocate system memory
Synopsis
addr = ALLOCMEM(size,[reqments])
Function
Requests the indicated number of bytes from the system and returns
an address string as argument. The optional requirements argument
specifies memory requires as given in
BADDR()¶
BADDR -- convert a BCPL pointer to a C address string
Synopsis
rv = BADDR(bptr)
Function
Converts a BCPL style pointer encoded as address string to an address string representing a C pointer.
CLOSEPORT()¶
CLOSEPORT -- closes and disposes a public command port
Synopsis
rv = CLOSEPORT(name)
Function
Closes and disposes a port whose name is given as argument. The port must have been created by OPENPORT before. Returns a boolean success indicator.
DELAY()¶
DELAY -- wait for the indicated number of ticks
Synopsis
rv = DELAY(ticks)
Function
Waits the indicated number of ticks, i.e. 50th of a second, and then returns to the caller. The return value has no particular meaning and can be ignored.
DELETE()¶
DELETE -- delete a file by file name
Synopsis
rv = DELETE(filename)
Function
Deletes the file given by its file name, and returns a boolean success code.
FORBID()¶
FORBID -- temporarily disable task switching
Synopsis
rv = FORBID()
Function
Disables task switching until the next call to FORBID() or until ARexx gives up the CPU voluntarily.
FORWARD()¶
FORWARD -- forwards a message packet to a named port
Synopsis
rv = FORWARD(pkt,portname)
Function
Forwards the ARexx command packet, given as address string, to the port whose name is given as second argument. Returns 0 if the port could not be found, or the address of the port if found and forwarding worked.
FREEMEM()¶
FREEMEM -- release memory to the system
Synopsis
rv = FREEMEM(address,size)
Function
Returns the address block given as first argument, as address string, whose size is given as second argument, back to the system. Returns a boolean success indicator.
Notes
The function always succeeds, but if the address block or its size is different from what has been allocated before, the system may crash.
GETARG()¶
GETARG -- retrieve a given argument from an ARexx command packet
Synopsis
rv = GETARG(packet,[argument])
Function
Retrieves from the given ARexx command packet the indicated argument number and returns it as a string.
GETPKT()¶
GETPKT -- returns the next ARexx command packet queued on a port
Synopsis
rv = GETPKT(port)
Function
Retrieves an address string representing the next ARexx command packet queued on a port, also given as address string. If no command packet is queued on the port, returns '0000 0000'x, i.e. the address string representing the NULL pointer.
MAKEDIR()¶
MAKEDIR -- create a new directory
Synopsis
rv = MAKEDIR(dirname)
Function
Creates the directory of the given name, and returns a boolean success indicator.
NEXT()¶
NEXT -- retrieve the next node of a linked list in memory
Synopsis
rv = NEXT(address,[offset])
Function
Retrieves the 4-byte address string at "address" plus "offset". It reads four bytes from memory, and returns the value at this offset.
NULL()¶
NULL -- return an address string represting the NULL pointer
Synopsis
rv = NULL()
Function
Retrieves the address string representing the NULL pointer, i.e. '0000 0000'x.
OFFSET()¶
OFFSET -- adds an offset to a pointer given as address string
Synopsis
rv = OFFSET(address,displacement)
Function
Takes a pointer given as address string and adds a displacement to it, and returns it as address string.
OPENPORT()¶
OPENPORT -- create a public message port of given name
Synopsis
rv = OPENPORT(name)
Function
Creates a public message port for retrieving ARexx command packets and returns its address as address string. Returns '0000 0000'x in case of failure.
PERMIT()¶
PERMIT -- re-enable multitasking
Synopsis
rv = PERMIT()
Function
Re-enables multitasking after calling PERMIT(). The return value is irrelevant and can be ignored.
RENAME()¶
RENAME -- Rename a file or directory
Synopsis
rv = RENAME(oldname,newname)
Function
Renames a file or directory whose original name is given as first argument to the name given as second argument. Returns a boolean success indicator.
REPLY()¶
REPLY -- reply a ARexx command packet with a return code to its issuer
Synopsis
rv = REPLY(packet,resultcode)
Function
Replies the packet, represented as address string, with the given result code to its issuer.
SHOWDIR()¶
SHOWDIR -- create list of directory contents
Synopsis
rv = SHOWDIR(dirname,'ALL'|'FILE'|'DIR',separator)
Function
Creates a string that contains the file names of all files in the directory given as first argument, and that match the type given as second argument. File entries are separated by the string given as third argument.
Notes
The type FILE also includes hard links to files, the type DIR also includes hard links to directories, but soft links are only included if the type is 'ALL'.
SHOWLIST()¶
SHOWLIST -- creates a string of system resources of indicated type
Synopsis
rv = SHOWLIST(type,[name],[separator],['A'])
Function
Returns a list of system resources of the type given as first argument, or checks for its availability or its address, if the last argument is 'A' or 'Address'. The resource list is returned as a single string where the names of the resources are separated by the string given as third argument, or spaces if the third argument is missing.
The first argument specifies the type as follows: 'L' System libraries currently in RAM 'D' System devices currently in RAM 'M' Memory nodes registered 'P' Public ports 'R' Resources 'S' Public semaphores 'V' Volumes registered in the dos.library 'H' Handlers registered in the dos.library 'A' Assigns registered in the dos.library 'T' Tasks that are ready to run 'W' Tasks waiting for a signal
If the 'name' argument is given, then the function checks for the presence of the given system resource and returns a boolean indicator. If the last argument is 'A' or 'Address', its address is returned as address string, or '0000 0000'x if the resource has not been found. If the separator is given, then the resources are separated it.
STATEF()¶
STATEF -- returns information on a file or directory
Synopsis
rv = STATEF(filespec)
Function
Returns a string describing the type, size, protection bits and creation date of an entry of a directory.
Each entry consists of the following tokens, separated by blank
spaces:
TYPEPKT()¶
TYPEPKT -- returns a type of an Arexx command packet
Synopsis
rv = TYPEPKT(pkt,[mode])
Function
Returns the type of an ARexx command packet whose address is given as address string as first argument. If the mode argument is omitted, then the return value is a number that indicates the type in packed form, also available separately through specifying various modes.
The mode can be one of the following: 'A' - Returns the number of arguments of the packet also as byte 0 of the packed result. 'C' - Returns TRUE if the packet was created as command rather than function. This information is also available as byte 3 of the packed result, which is '01'x for commands. 'F' - Returns TRUE if the packet was created as function call. This information is also available as byte 3 of the packed result, which is '02'x for function calls. Byte 2 are modifier flags that are handled automatically by the REPLY function.
WAITPKT()¶
WAITPKT -- wait for a ARexx command packet on a named port
Synopsis
rv = WAITPKT(portname)
Function
Waits on the port whose name is given as argument for an ARexx command packet to arrive. Returns non-zero if a packet is available, but does not remove it. Use GETPKT for this.