Lines Matching refs:driver

59 static void stdio_out_chars_no_crlf(stdio_driver_t *driver, const char *s, int len) {  in stdio_out_chars_no_crlf()  argument
60 driver->out_chars(s, len); in stdio_out_chars_no_crlf()
63 static void stdio_out_chars_crlf(stdio_driver_t *driver, const char *s, int len) { in stdio_out_chars_crlf() argument
65 if (!driver->crlf_enabled) { in stdio_out_chars_crlf()
66 driver->out_chars(s, len); in stdio_out_chars_crlf()
72 bool prev_char_was_cr = i > 0 ? s[i - 1] == '\r' : driver->last_ended_with_cr; in stdio_out_chars_crlf()
75 driver->out_chars(&s[first_of_chunk], i - first_of_chunk); in stdio_out_chars_crlf()
77 driver->out_chars(crlf_str, 2); in stdio_out_chars_crlf()
82 driver->out_chars(&s[first_of_chunk], len - first_of_chunk); in stdio_out_chars_crlf()
85 driver->last_ended_with_cr = s[len - 1] == '\r'; in stdio_out_chars_crlf()
88 driver->out_chars(s, len); in stdio_out_chars_crlf()
101 for (stdio_driver_t *driver = drivers; driver; driver = driver->next) { in stdio_put_string() local
102 if (!driver->out_chars) continue; in stdio_put_string()
103 if (filter && filter != driver) continue; in stdio_put_string()
104 out_func(driver, s, len); in stdio_put_string()
107 out_func(driver, &c, 1); in stdio_put_string()
120 for (stdio_driver_t *driver = drivers; driver; driver = driver->next) { in stdio_get_until() local
121 if (filter && filter != driver) continue; in stdio_get_until()
122 if (driver->in_chars) { in stdio_get_until()
123 int read = driver->in_chars(buf, len); in stdio_get_until()
151 void stdio_set_driver_enabled(stdio_driver_t *driver, bool enable) { in stdio_set_driver_enabled() argument
154 if (*prev == driver) { in stdio_set_driver_enabled()
156 *prev = driver->next; in stdio_set_driver_enabled()
157 driver->next = NULL; in stdio_set_driver_enabled()
164 *prev = driver; in stdio_set_driver_enabled()
263 void stdio_filter_driver(stdio_driver_t *driver) { in stdio_filter_driver() argument
264 filter = driver; in stdio_filter_driver()
267 void stdio_set_translate_crlf(stdio_driver_t *driver, bool enabled) { in stdio_set_translate_crlf() argument
269 if (enabled && !driver->crlf_enabled) { in stdio_set_translate_crlf()
270 driver->last_ended_with_cr = false; in stdio_set_translate_crlf()
272 driver->crlf_enabled = enabled; in stdio_set_translate_crlf()
275 (void)driver; in stdio_set_translate_crlf()