system_.c
Go to the documentation of this file.
00001 /* f77 interface to system routine */
00002 
00003 #include "f2c.h"
00004 
00005 #ifdef KR_headers
00006 extern char *F77_aloc();
00007 
00008  integer
00009 system_(s, n) register char *s; ftnlen n;
00010 #else
00011 #undef abs
00012 #undef min
00013 #undef max
00014 #include "stdlib.h"
00015 #ifdef __cplusplus
00016 extern "C" {
00017 #endif
00018 extern char *F77_aloc(ftnlen, const char*);
00019 
00020  integer
00021 system_(register char *s, ftnlen n)
00022 #endif
00023 {
00024         char buff0[256], *buff;
00025         register char *bp, *blast;
00026         integer rv;
00027 
00028         buff = bp = n < sizeof(buff0)
00029                         ? buff0 : F77_aloc(n+1, "system_");
00030         blast = bp + n;
00031 
00032         while(bp < blast && *s)
00033                 *bp++ = *s++;
00034         *bp = 0;
00035         rv = system(buff);
00036         if (buff != buff0)
00037                 free(buff);
00038         return rv;
00039         }
00040 #ifdef __cplusplus
00041 }
00042 #endif


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:56:15