Home | History | Annotate | Download | only in test

Lines Matching refs:fs

111 	FILE *fs=NULL;  int retcode=0, scalefactor, dstpitch;
115 if((fs=fdopen(*fd, "r"))==NULL) _throw(strerror(errno));
119 if(!fgets(temps, 255, fs)) _throw("Read error");
150 if(fscanf(fs, "%d%d%d", &pixel[0], &pixel[1], &pixel[2])!=3)
164 if(fread(tempbuf, (*w)*(*h)*3, 1, fs)!=1) _throw("Read error");
169 if(fs) {fclose(fs); *fd=-1;}
276 FILE *fs=NULL; int retcode=0;
279 if((fs=fopen(filename, "wb"))==NULL) _throw(strerror(errno));
280 if(fprintf(fs, "P6\n")<1) _throw("Write error");
281 if(fprintf(fs, "%d %d\n", w, h)<1) _throw("Write error");
282 if(fprintf(fs, "255\n")<1) _throw("Write error");
290 if((fwrite(tempbuf, w*h*3, 1, fs))!=1) _throw("Write error");
294 if(fs) fclose(fs);