MCPcopy Create free account
hub / github.com/Singular/Singular / pipeWrite

Function pipeWrite

Singular/links/pipeLink.cc:144–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142//**************************************************************************/
143EXTERN_VAR si_link pipeLastLink;
144static BOOLEAN pipeWrite(si_link l, leftv data)
145{
146 if(!SI_LINK_W_OPEN_P(l)) slOpen(l,SI_LINK_OPEN|SI_LINK_WRITE,NULL);
147 pipeInfo *d = (pipeInfo *)l->data;
148 FILE *outfile=d->f_write;;
149 BOOLEAN err=FALSE;
150 char *s;
151 pipeLastLink=l;
152 while (data!=NULL)
153 {
154 s = data->String();
155 // free data ??
156 if (s!=NULL)
157 {
158 fprintf(outfile,"%s\n",s);
159 omFree((ADDRESS)s);
160 }
161 else
162 {
163 WerrorS("cannot convert to string");
164 err=TRUE;
165 }
166 if (pipeLastLink==NULL) return TRUE;
167 data = data->next;
168 }
169 fflush(outfile);
170 pipeLastLink=NULL;
171 return err;
172}
173
174static const char* slStatusPipe(si_link l, const char* request)
175{

Callers

nothing calls this directly

Calls 3

slOpenFunction · 0.85
WerrorSFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected