1994-10-26 18:17:41 +00:00
|
|
|
/* f77 interface to system routine */
|
|
|
|
|
|
|
|
#include "f2c.h"
|
|
|
|
|
|
|
|
#ifdef KR_headers
|
1995-09-28 20:49:15 +00:00
|
|
|
extern char *F77_aloc();
|
|
|
|
|
|
|
|
integer
|
1994-10-26 18:17:41 +00:00
|
|
|
system_(s, n) register char *s; ftnlen n;
|
|
|
|
#else
|
|
|
|
#undef abs
|
|
|
|
#undef min
|
|
|
|
#undef max
|
|
|
|
#include "stdlib.h"
|
1995-09-28 20:49:15 +00:00
|
|
|
extern char *F77_aloc(ftnlen, char*);
|
|
|
|
|
|
|
|
integer
|
1994-10-26 18:17:41 +00:00
|
|
|
system_(register char *s, ftnlen n)
|
|
|
|
#endif
|
|
|
|
{
|
1995-09-28 20:49:15 +00:00
|
|
|
char buff0[256], *buff;
|
|
|
|
register char *bp, *blast;
|
|
|
|
integer rv;
|
1994-10-26 18:17:41 +00:00
|
|
|
|
1995-09-28 20:49:15 +00:00
|
|
|
buff = bp = n < sizeof(buff0)
|
|
|
|
? buff0 : F77_aloc(n+1, "system_");
|
|
|
|
blast = bp + n;
|
1994-10-26 18:17:41 +00:00
|
|
|
|
1995-09-28 20:49:15 +00:00
|
|
|
while(bp < blast && *s)
|
|
|
|
*bp++ = *s++;
|
|
|
|
*bp = 0;
|
|
|
|
rv = system(buff);
|
|
|
|
if (buff != buff0)
|
|
|
|
free(buff);
|
|
|
|
return rv;
|
|
|
|
}
|