1 #include "f2c.h"
2 #ifdef __cplusplus
3 extern "C" {
4 #endif
5 
6 /*
7  * subroutine getarg(k, c)
8  * returns the kth unix command argument in fortran character
9  * variable argument c
10 */
11 
12 #ifdef KR_headers
getarg_(n,s,ls)13 VOID getarg_(n, s, ls) ftnint *n; char *s; ftnlen ls;
14 #define Const /*nothing*/
15 #else
16 #define Const const
17 void getarg_(ftnint *n, char *s, ftnlen ls)
18 #endif
19 {
20 	extern int xargc;
21 	extern char **xargv;
22 	Const char *t;
23 	int i;
24 
25 	if(*n>=0 && *n<xargc)
26 		t = xargv[*n];
27 	else
28 		t = "";
29 	for(i = 0; i<ls && *t!='\0' ; ++i)
30 		*s++ = *t++;
31 	for( ; i<ls ; ++i)
32 		*s++ = ' ';
33 	}
34 #ifdef __cplusplus
35 }
36 #endif
37