1: /* 2: char id_getarg[] = "@(#)getarg_.c 1.1"; 3: * 4: * return a specified command line argument 5: * 6: * calling sequence: 7: * character*20 arg 8: * call getarg(k, arg) 9: * where: 10: * arg will receive the kth unix command argument 11: */ 12: 13: #include "../libI77/fiodefs.h" 14: 15: getarg_(n, s, ls) 16: ftnint *n; 17: register char *s; 18: ftnlen ls; 19: { 20: extern int xargc; 21: extern char **xargv; 22: register char *t; 23: register 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: }