1998-02-01 09:37:08 +08:00
|
|
|
/* f77 interface to system routine */
|
|
|
|
|
|
|
|
#include "f2c.h"
|
|
|
|
|
|
|
|
#undef abs
|
|
|
|
#undef min
|
|
|
|
#undef max
|
|
|
|
#include <stdlib.h>
|
2002-06-01 20:38:32 +08:00
|
|
|
extern char *F77_aloc (ftnlen, char *);
|
1998-02-01 09:37:08 +08:00
|
|
|
|
2002-06-01 20:38:32 +08:00
|
|
|
integer
|
1998-02-01 09:37:08 +08:00
|
|
|
G77_system_0 (register char *s, ftnlen n)
|
|
|
|
{
|
2002-06-01 20:38:32 +08:00
|
|
|
char buff0[256], *buff;
|
|
|
|
register char *bp, *blast;
|
|
|
|
integer rv;
|
1998-02-01 09:37:08 +08:00
|
|
|
|
2002-06-02 20:54:28 +08:00
|
|
|
buff = bp = n < (ftnlen) sizeof (buff0) ? buff0 : F77_aloc (n + 1, "system_");
|
2002-06-01 20:38:32 +08:00
|
|
|
blast = bp + n;
|
1998-02-01 09:37:08 +08:00
|
|
|
|
2002-06-01 20:38:32 +08:00
|
|
|
while (bp < blast && *s)
|
|
|
|
*bp++ = *s++;
|
|
|
|
*bp = 0;
|
|
|
|
rv = system (buff);
|
|
|
|
if (buff != buff0)
|
|
|
|
free (buff);
|
|
|
|
return rv;
|
|
|
|
}
|