home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / f2csrc.zip / f2csrc / libF77 / getarg_.c < prev    next >
C/C++ Source or Header  |  1994-07-28  |  523b  |  29 lines

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