Debian Codegraph @

debian/external_deps/fetk/punc/src/vf2c/getarg_.c

raw
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
13 VOID getarg_(n, s, ls) ftnint *n; register char *s; ftnlen ls;
14 #else
15 void getarg_(ftnint *n, register char *s, ftnlen ls)
16 #endif
17 {
18 extern int xargc;
19 extern char **xargv;
20 register char *t;
21 register int i;
22
23 if(*n>=0 && *n<xargc)
24 t = xargv[*n];
25 else
26 t = "";
27 for(i = 0; i<ls && *t!='\0' ; ++i)
28 *s++ = *t++;
29 for( ; i<ls ; ++i)
30 *s++ = ' ';
31 }
32 #ifdef __cplusplus
33 }
34 #endif