MCPcopy Create free account
hub / github.com/davisking/dlib / flush_out_buffer

Method flush_out_buffer

dlib/matlab/subprocess_stream.cpp:218–239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216 }
217
218 int flush_out_buffer (
219 )
220 {
221 int num = static_cast<int>(pptr()-pbase());
222 const int num_written = num;
223 char* buf = out_buffer;
224 while(num != 0)
225 {
226 if(write_echoing_select(fd, fd_printf))
227 return EOF;
228 int status = write(fd,buf,num);
229 if (status < 0)
230 {
231 // the write was not successful so return EOF
232 return EOF;
233 }
234 num -= status;
235 buf += status;
236 }
237 pbump(-num_written);
238 return num_written;
239 }
240
241 // output functions
242 int_type overflow (

Callers

nothing calls this directly

Calls 1

write_echoing_selectFunction · 0.85

Tested by

no test coverage detected