Lines Matching defs:new
226 static void set_option(struct termios *new, char *option)
231 if (!set_flag(&new->c_cflag, cflags, ARRAY_LEN(cflags), option, on) &&
232 !set_flag(&new->c_iflag, iflags, ARRAY_LEN(iflags), option, on) &&
233 !set_flag(&new->c_oflag, oflags, ARRAY_LEN(oflags), option, on) &&
234 !set_flag(&new->c_lflag, lflags, ARRAY_LEN(lflags), option, on))
238 static void set_options(struct termios* new, ...)
243 va_start(va, new);
244 while ((option = va_arg(va, char *))) set_option(new, option);
258 static int set_special_character(struct termios *new, int *i, char *char_name)
275 new->c_cc[chars[j].value] = ch;
325 struct termios new = old;
332 else if (!strcmp(arg, "line")) new.c_line = get_arg(&i, N_TTY, NR_LDISCS);
333 else if (!strcmp(arg, "min")) new.c_cc[VMIN] = get_arg(&i, 0, 255);
334 else if (!strcmp(arg, "time")) new.c_cc[VTIME] = get_arg(&i, 0, 255);
338 cfsetispeed(&new, new_speed);
339 cfsetospeed(&new, new_speed);
341 cfsetispeed(&new, speed(get_arg(&i, 0, 4000000)));
343 cfsetospeed(&new, speed(get_arg(&i, 0, 4000000)));
347 else if (sscanf(arg, "%x:%x:%x:%x:%n", &new.c_iflag, &new.c_oflag,
348 &new.c_cflag, &new.c_lflag, &n) == 4)
355 new.c_cc[j] = value;
358 } else if (set_special_character(&new, &i, arg));
361 set_options(&new, "brkint", "ignpar", "istrip", "icrnl", "ixon",
364 set_options(&new, "parenb", "cs7", "-parodd", NULL);
366 set_options(&new, "parenb", "cs7", "parodd", NULL);
369 set_options(&new, "-parenb", "cs8", NULL);
372 set_options(&new, "-ignbrk", "-brkint", "-ignpar", "-parmrk", "-inpck",
375 new.c_cc[VMIN] = 1;
376 new.c_cc[VTIME] = 0;
378 set_options(&new, "-icrnl", "-ocrnl", NULL);
380 set_options(&new, "icrnl", "ocrnl", "-inlcr", "-igncr", NULL);
382 new.c_cc[VERASE] = 0x7f;
383 new.c_cc[VKILL] = 0x15;
384 } else if (!strcmp(arg, "sane")) make_sane(&new);
393 set_option(&new, arg);
396 tcsetattr(TT.fd, TCSAFLUSH, &new);
398 if (memcmp(&old, &new, sizeof(old)))