Lines Matching defs:outs
35 bool tool_create_output_file(struct OutStruct *outs)
37 struct GlobalConfig *global = outs->config->global;
40 if(!outs->filename || !*outs->filename) {
45 if(outs->is_cd_filename) {
47 file = fopen(outs->filename, "rb");
50 warnf(global, "Refusing to overwrite %s: %s\n", outs->filename,
57 file = fopen(outs->filename, "wb");
59 warnf(global, "Failed to create the file %s: %s\n", outs->filename,
63 outs->s_isreg = TRUE;
64 outs->fopened = TRUE;
65 outs->stream = file;
66 outs->bytes = 0;
67 outs->init = 0;
78 struct OutStruct *outs = userdata;
79 struct OperationConfig *config = outs->config;
110 if(outs->filename) {
112 if(!*outs->filename)
114 if(!outs->s_isreg)
116 if(outs->fopened && !outs->stream)
118 if(!outs->fopened && outs->stream)
120 if(!outs->fopened && outs->bytes)
125 if(!outs->stream || outs->s_isreg || outs->fopened)
127 if(outs->alloc_filename || outs->is_cd_filename || outs->init)
137 if(!outs->stream && !tool_create_output_file(outs))
140 rc = fwrite(buffer, sz, nmemb, outs->stream);
144 outs->bytes += (sz * nmemb);
153 int res = fflush(outs->stream);