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