Doxygen Source Code Documentation
Main Page Alphabetical List Data Structures File List Data Fields Globals Search
system_.c
Go to the documentation of this file.00001 #include "stdlib.h"
00002
00003
00004 #include "f2c.h"
00005
00006 #ifdef KR_headers
00007 extern char *F77_aloc();
00008
00009 integer
00010 system_(s, n) register char *s; ftnlen n;
00011 #else
00012 #undef abs
00013 #undef min
00014 #undef max
00015 #include "stdlib.h"
00016 extern char *F77_aloc(ftnlen, char*);
00017
00018 integer
00019 system_(register char *s, ftnlen n)
00020 #endif
00021 {
00022 char buff0[256], *buff;
00023 register char *bp, *blast;
00024 integer rv;
00025
00026 buff = bp = n < sizeof(buff0)
00027 ? buff0 : F77_aloc(n+1, "system_");
00028 blast = bp + n;
00029
00030 while(bp < blast && *s)
00031 *bp++ = *s++;
00032 *bp = 0;
00033 rv = system(buff);
00034 if (buff != buff0)
00035 free(buff);
00036 return rv;
00037 }