Oberon || Library || Module Index || Search Engine || Definition || Module


Ulm's Oberon Library:
SysArgs


NAME

SysArgs - interface to UNIX command line arguments

SYNOPSIS

(* $P- $O- don't trace any pointers here *)
TYPE Argument = POINTER TO ARRAY large OF CHAR;
TYPE Arguments = POINTER TO ARRAY large OF Argument;
(* $P= $O= *)


VAR argc: INTEGER; VAR argv: Arguments;

VAR envc: INTEGER; VAR environ: Arguments;

DESCRIPTION

SysArgs is initialized by the runtime startoff and interfaces the UNIX command line arguments and environment parameters.

argc and envc are set to the number of arguments (including the command name) and the number of environment parameters. argv and environ point to the list of arguments and environment parameters, respectively. These pointers may be modified but not the objects they point to. Oberon has no appropiate data type for pointers to character arrays with unknown length. The problem is fixed by using pointers to array types with sufficient length (to avoid range check faults). But this restricts access to the basic elements (i.e. characters). Access of these arrays in their entirety could cause memory faults.

Note that environ may be NIL. The types Argument and Arguments are protected against pointer tracing by the garbage collector.

SEE ALSO

UnixArgLists
construction of argument lists
UnixArguments
convenient interface for reading command line arguments
UnixEnvironment
convenient interface for environment parameters

Edited by: borchert, last change: 2004/06/03, revision: 1.4, converted to HTML: 2004/06/03

Oberon || Library || Module Index || Search Engine || Definition || Module