| 1 | /* This header file contains the function prototypes for
|
|---|
| 2 | * Fortran standard generic intrinsic procedures (SGIPs).
|
|---|
| 3 | */
|
|---|
| 4 |
|
|---|
| 5 | #ifndef __FORTRAN_SGIP_H__
|
|---|
| 6 | #define __FORTRAN_SGIP_H__
|
|---|
| 7 |
|
|---|
| 8 | #define FORTRAN_COMMAND_LINE_ARG_LENGTH_MAX 100
|
|---|
| 9 | #define F_ARGC __fortran__command_line_arg_count
|
|---|
| 10 | #define F_ARGL __fortran__command_line_arg_lengths
|
|---|
| 11 | #define F_ARGV __fortran__command_line_arg_chars
|
|---|
| 12 | #define F_PENL __fortran__program_entry_name_length
|
|---|
| 13 | #define F_PENV __fortran__program_entry_name_chars
|
|---|
| 14 |
|
|---|
| 15 | #define ERRSTAT_ARGUMENT_INVALID 1
|
|---|
| 16 | #define ERRSTAT_ARGUMENT_OUT_OF_RANGE 2
|
|---|
| 17 | #define ERRSTAT_NUMBER_OUT_OF_RANGE 3
|
|---|
| 18 |
|
|---|
| 19 | $input int F_ARGC;
|
|---|
| 20 | $assume(F_ARGC >= 0);
|
|---|
| 21 | $input int F_PENL;
|
|---|
| 22 | #assume(F_PENL > 0);
|
|---|
| 23 | $input int F_ARGL[F_ARGC];
|
|---|
| 24 | $input char F_ARGV[F_ARGC][FORTRAN_COMMAND_LINE_ARG_LENGTH_MAX];
|
|---|
| 25 | $input char F_PENV[F_PENL];
|
|---|
| 26 |
|
|---|
| 27 | /* F2018: Sec. 16.9.51 COMMAND_ARGUMENT_COUNT()
|
|---|
| 28 | * Returns the number of command arguments,
|
|---|
| 29 | * which can be configured as following:
|
|---|
| 30 | * <code>$assume(F_ARGC == 1)</code>
|
|---|
| 31 | */
|
|---|
| 32 | int __fortran__command_argument_count();
|
|---|
| 33 |
|
|---|
| 34 | /* F2018: Sec. 16.9.83 GET_COMMAND_ARGUMENT(NUMNER [, VALUE, LENGTH, STATUS, ERRMSG])
|
|---|
| 35 | * Gets program invocation argument
|
|---|
| 36 | */
|
|---|
| 37 | void __fortran__get_command_argument(
|
|---|
| 38 | int *number, /* the nth argument, 0 for program entry name*/
|
|---|
| 39 | char *value, /* the variable pointing to the nth argument */
|
|---|
| 40 | /* if no such argument exists, blanks are assigend*/
|
|---|
| 41 | int *length, /* the length of the value assigned to 'value' */
|
|---|
| 42 | int *status, /* -1, if 'value' has insufficient length for assigned actual arg */
|
|---|
| 43 | /* 0, if 'value' is correctly assigned */
|
|---|
| 44 | /* >0, if the actual argument is invalid */
|
|---|
| 45 | char *errmsg /* Processor-dependent error messages if 'status' is positive */
|
|---|
| 46 | );
|
|---|
| 47 |
|
|---|
| 48 | #endif
|
|---|