Pristine Ack-5.5
[Ack-5.5.git] / lang / m2 / libm2 / Arguments.def
1 DEFINITION MODULE Arguments;
2 (*
3   Module:       Access to program arguments and environment
4   Author:       Ceriel J.H. Jacobs
5   Version:      $Id: Arguments.def,v 1.3 1994/06/24 12:48:13 ceriel Exp $
6 *)
7
8 VAR     Argc: CARDINAL; (* Number of program arguments, including the program
9                            name, so it is at least 1.
10                         *)
11
12 PROCEDURE Argv( argnum : CARDINAL;
13                 VAR argument : ARRAY OF CHAR
14               ) : CARDINAL;
15 (* Stores the "argnum'th" argument in "argument", and returns its length,
16    including a terminating null-byte. If it returns 0, the argument was not
17    present, and if it returns a number larger than the size of "argument",
18    "argument" was'nt large enough.
19    Argument 0 contains the program name.
20 *)
21
22 PROCEDURE GetEnv( name : ARRAY OF CHAR;
23                   VAR value : ARRAY OF CHAR
24                 ) : CARDINAL;
25 (* Searches the environment list for a string of the form
26         name=value
27    and stores the value in "value", if such a string is present.
28    It returns the length of the "value" part, including a terminating
29    null-byte. If it returns 0, such a string is not present, and
30    if it returns a number larger than the size of the "value",
31    "value" was'nt large enough.
32    The string in "name" must be null_terminated.
33 *)
34 END Arguments.