Lines Matching refs:outs

52 bool tool_create_output_file(struct OutStruct *outs,  in tool_create_output_file()  argument
57 const char *fname = outs->filename; in tool_create_output_file()
58 DEBUGASSERT(outs); in tool_create_output_file()
65 !outs->is_cd_filename)) { in tool_create_output_file()
103 outs->filename = newname; /* remember the new one */ in tool_create_output_file()
104 outs->alloc_filename = TRUE; in tool_create_output_file()
123 outs->s_isreg = TRUE; in tool_create_output_file()
124 outs->fopened = TRUE; in tool_create_output_file()
125 outs->stream = file; in tool_create_output_file()
126 outs->bytes = 0; in tool_create_output_file()
127 outs->init = 0; in tool_create_output_file()
139 struct OutStruct *outs = &per->outs; in tool_write_cb() local
174 if(outs->filename) { in tool_write_cb()
176 if(!*outs->filename) in tool_write_cb()
178 if(!outs->s_isreg) in tool_write_cb()
180 if(outs->fopened && !outs->stream) in tool_write_cb()
182 if(!outs->fopened && outs->stream) in tool_write_cb()
184 if(!outs->fopened && outs->bytes) in tool_write_cb()
189 if(!outs->stream || outs->s_isreg || outs->fopened) in tool_write_cb()
191 if(outs->alloc_filename || outs->is_cd_filename || outs->init) in tool_write_cb()
201 if(!outs->stream && !tool_create_output_file(outs, per->config)) in tool_write_cb()
204 if(is_tty && (outs->bytes < 2000) && !config->terminal_binary_ok) { in tool_write_cb()
216 fhnd = _get_osfhandle(fileno(outs->stream)); in tool_write_cb()
218 if(isatty(fileno(outs->stream)) && in tool_write_cb()
229 if(outs->utf8seq[0] && rlen) { in tool_write_cb()
232 if(0xC0 <= outs->utf8seq[0] && outs->utf8seq[0] < 0xE0) { in tool_write_cb()
233 outs->utf8seq[1] = *rbuf++; in tool_write_cb()
238 else if(0xE0 <= outs->utf8seq[0] && outs->utf8seq[0] < 0xF0) { in tool_write_cb()
239 if(!outs->utf8seq[1]) { in tool_write_cb()
240 outs->utf8seq[1] = *rbuf++; in tool_write_cb()
243 if(rlen && !outs->utf8seq[2]) { in tool_write_cb()
244 outs->utf8seq[2] = *rbuf++; in tool_write_cb()
250 else if(0xF0 <= outs->utf8seq[0] && outs->utf8seq[0] < 0xF8) { in tool_write_cb()
251 if(!outs->utf8seq[1]) { in tool_write_cb()
252 outs->utf8seq[1] = *rbuf++; in tool_write_cb()
255 if(rlen && !outs->utf8seq[2]) { in tool_write_cb()
256 outs->utf8seq[2] = *rbuf++; in tool_write_cb()
259 if(rlen && !outs->utf8seq[3]) { in tool_write_cb()
260 outs->utf8seq[3] = *rbuf++; in tool_write_cb()
269 if(MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)outs->utf8seq, -1, in tool_write_cb()
284 memset(outs->utf8seq, 0, sizeof(outs->utf8seq)); in tool_write_cb()
289 if(!outs->utf8seq[0] && rlen && (rbuf[rlen - 1] & 0x80)) { in tool_write_cb()
292 outs->utf8seq[0] = rbuf[rlen - 1]; in tool_write_cb()
298 outs->utf8seq[0] = rbuf[rlen - 2]; in tool_write_cb()
299 outs->utf8seq[1] = rbuf[rlen - 1]; in tool_write_cb()
305 outs->utf8seq[0] = rbuf[rlen - 3]; in tool_write_cb()
306 outs->utf8seq[1] = rbuf[rlen - 2]; in tool_write_cb()
307 outs->utf8seq[2] = rbuf[rlen - 1]; in tool_write_cb()
350 if(tool_write_headers(&per->hdrcbdata, outs->stream)) in tool_write_cb()
353 rc = fwrite(buffer, sz, nmemb, outs->stream); in tool_write_cb()
358 outs->bytes += bytes; in tool_write_cb()
367 int res = fflush(outs->stream); in tool_write_cb()