42 WerrorS(
"no sub-processes allowed");
53 Werror(
"pipe failed with %d\n",errno);
63 si_close(pc[1]); si_close(cp[0]);
67 int r=system(
l->name);
76 si_close(pc[0]); si_close(cp[1]);
77 d->
f_read=fdopen(cp[0],
"r");
85 Werror(
"fork failed (%d)",errno);
102 unidirectional=
FALSE;
117 if (unidirectional && (d->
pid!=0))
118 { kill(d->
pid,15); kill(d->
pid,9); }
143 char *ss=fgets(
s,1024,d->
f_read);
146 if ((
i>=0) && (
s[
i]==
'\n'))
s[
i]=
'\0';
167 fprintf(outfile,
"%s\n",
s);
172 WerrorS(
"cannot convert to string");
186 if (d==
NULL)
return "not open";
187 if(strcmp(request,
"read") == 0)
191 else if (FD_SETSIZE<=d->fd_read)
212 case 0:
return "not ready";
213 case -1:
return "error";
214 default:
return "ready";
217 else if (strcmp(request,
"write") == 0)
222 return "unknown status request";
Class used for (list of) interpreter objects.
char * String(void *d=NULL, BOOLEAN typed=FALSE, int dim=1)
Called for conversion to string (used by string(..), write(..),..).
const CanonicalForm int s
void WerrorS(const char *s)
static void * feOptValue(feOptIndex opt)
#define omFreeSize(addr, size)
static const char * slStatusPipe(si_link l, const char *request)
si_link_extension slInitPipeExtension(si_link_extension s)
static BOOLEAN pipeOpen(si_link l, short, leftv)
static BOOLEAN pipeKill(si_link l)
static leftv pipeRead1(si_link l)
static BOOLEAN pipeClose(si_link l)
static BOOLEAN pipeWrite(si_link l, leftv data)
void Werror(const char *fmt,...)
BOOLEAN slOpen(si_link l, short flag, leftv h)
#define SI_LINK_W_OPEN_P(l)
leftv(* slRead2Proc)(si_link l, leftv a)
#define SI_LINK_SET_R_OPEN_P(l)
#define SI_LINK_SET_CLOSE_P(l)
#define SI_LINK_R_OPEN_P(l)
#define SI_LINK_SET_RW_OPEN_P(l)
#define SI_LINK_OPEN_P(l)