getarg_.c
Go to the documentation of this file.
00001 #include "f2c.h"
00002 #ifdef __cplusplus
00003 extern "C" {
00004 #endif
00005 
00006 /*
00007  * subroutine getarg(k, c)
00008  * returns the kth unix command argument in fortran character
00009  * variable argument c
00010 */
00011 
00012 #ifdef KR_headers
00013 VOID getarg_(n, s, ls) ftnint *n; char *s; ftnlen ls;
00014 #define Const /*nothing*/
00015 #else
00016 #define Const const
00017 void getarg_(ftnint *n, char *s, ftnlen ls)
00018 #endif
00019 {
00020         extern int xargc;
00021         extern char **xargv;
00022         Const char *t;
00023         int i;
00024         
00025         if(*n>=0 && *n<xargc)
00026                 t = xargv[*n];
00027         else
00028                 t = "";
00029         for(i = 0; i<ls && *t!='\0' ; ++i)
00030                 *s++ = *t++;
00031         for( ; i<ls ; ++i)
00032                 *s++ = ' ';
00033         }
00034 #ifdef __cplusplus
00035 }
00036 #endif


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:55:50