MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / test_tty

Function test_tty

test/test.c:266–295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

264static char * stdout_sep = "\r";
265static char * stderr_sep = "\r";
266static void test_tty(void)
267{
268#if defined(__MINGW32__)
269 HANDLE handle;
270 handle = (HANDLE) _get_osfhandle(_fileno(stdout));
271 if ((handle != INVALID_HANDLE_VALUE) && (GetFileType(handle) == FILE_TYPE_CHAR))
272 {
273 stdout_tty = 1;
274 }
275 handle = (HANDLE) _get_osfhandle(_fileno(stderr));
276 if ((handle != INVALID_HANDLE_VALUE) && (GetFileType(handle) == FILE_TYPE_CHAR))
277 {
278 stderr_tty = 1;
279 }
280#else
281 if (isatty(1) == 1)
282 {
283 stdout_tty = 1;
284 }
285 if (isatty(2) == 1)
286 {
287 stderr_tty = 1;
288 }
289#endif
290
291/*
292 if (stdout_tty == 1) stdout_sep = "\r";
293 if (stderr_tty == 1) stderr_sep = "\r";
294*/
295}
296
297/****************************************************************************
298 * hb_error_handler

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected