Lines Matching +defs:val +defs:sp
127 unsigned long val;
361 static void sane(register struct termios *sp)
375 sp->c_cflag |= tp->mask;
377 sp->c_cflag &= ~tp->mask;
381 sp->c_iflag |= tp->mask;
383 sp->c_iflag &= ~tp->mask;
387 sp->c_oflag |= tp->mask;
389 sp->c_oflag &= ~tp->mask;
393 sp->c_lflag |= tp->mask;
395 sp->c_lflag &= ~tp->mask;
400 sp->c_cc[tp->mask] = cntl(tp->val);
405 static int gin(char *arg,struct termios *sp)
410 sp->c_iflag = strtol(arg,&arg,16);
413 sp->c_oflag = strtol(arg,&arg,16);
416 sp->c_cflag = strtol(arg,&arg,16);
419 sp->c_lflag = strtol(arg,&arg,16);
424 sp->c_cc[i] = strtol(arg,&arg,16);
429 sp->c_line =
437 cfsetispeed(sp, i);
441 cfsetospeed(sp, i);
447 static void gout(struct termios *sp)
450 sfprintf(sfstdout,":%x",sp->c_iflag);
451 sfprintf(sfstdout,":%x",sp->c_oflag);
452 sfprintf(sfstdout,":%x",sp->c_cflag);
453 sfprintf(sfstdout,":%x",sp->c_lflag);
455 sfprintf(sfstdout,":%x",sp->c_cc[i]);
457 sfprintf(sfstdout,":%x", sp->c_line);
461 sfprintf(sfstdout,":%x",cfgetispeed(sp));
462 sfprintf(sfstdout,":%x",cfgetospeed(sp));
466 static void output(struct termios *sp, int flags)
473 unsigned int ispeed = cfgetispeed(sp);
474 unsigned int ospeed = cfgetospeed(sp);
477 gout(sp);
480 tty = *sp;
499 if(sp->c_cflag&tp->mask)
505 if(sp->c_iflag&tp->mask)
511 if((sp->c_oflag&tp->mask)==tp->val)
517 if(sp->c_lflag&tp->mask)
534 off = sp->c_cc[tp->mask];
555 if((sp->c_cflag&CSIZE)!=tp->mask)
557 if(flags || (sp->c_cflag&CSIZE) != (tty.c_cflag&CSIZE))
601 static const Tty_t *getspeed(unsigned long val)
606 if(Ttable[i].type==SPEED && Ttable[i].mask==val)
633 static void set(char *argv[], struct termios *sp)
658 sp->c_cc[tp->mask] = c;
660 sp->c_cc[tp->mask] = _POSIX_VDISABLE;
667 sp->c_cflag &= ~tp->mask;
669 sp->c_cflag |= tp->mask;
673 sp->c_iflag &= ~tp->mask;
675 sp->c_iflag |= tp->mask;
678 sp->c_oflag &= ~tp->mask;
679 sp->c_oflag |= tp->val;
683 sp->c_lflag &= ~tp->mask;
685 sp->c_lflag |= tp->mask;
690 sp->c_oflag &= ~tp->mask;
692 sp->c_oflag |= tp->val;
725 if (tp = getspeed(*tp->name == 'i' ? cfgetispeed(sp) : cfgetospeed(sp)))
739 sp->c_line = c;
746 cfsetispeed(sp, c);
748 cfsetospeed(sp, c);
754 sp->c_cc[tp->mask] = c;
759 cfsetospeed(sp, tp->mask);
760 cfsetispeed(sp, tp->mask);
763 sp->c_cflag &= ~CSIZE;
764 sp->c_cflag |= tp->mask;
767 sane(sp);
773 sp->c_iflag |= IUCLC;
774 sp->c_oflag |= OLCUC;
778 sp->c_iflag &= ~IUCLC;
779 sp->c_oflag &= ~OLCUC;
788 static void listchars(Sfio_t *sp,int type)
795 sfprintf(sp,"[+%s \a%c\a?%s.]",Ttable[i].name,c,Ttable[i].description);
799 static void listgroup(Sfio_t *sp,int type, const char *description)
802 sfprintf(sp,"[+");
806 sfprintf(sp,"%s ",Ttable[i].name);
808 sfprintf(sp,"?%s.]",description);
811 static void listmask(Sfio_t *sp,unsigned int mask,const char *description)
814 sfprintf(sp,"[+");
818 sfprintf(sp,"%s ",Ttable[i].name);
820 sfprintf(sp,"?%s.]",description);
823 static void listfields(Sfio_t *sp,int field)
829 sfprintf(sp,"[+%s (-%s)?%s.]",Ttable[i].name,Ttable[i].name,Ttable[i].description);
833 static void listmode(Sfio_t *sp,const char *name)
835 sfprintf(sp,"[+%s?%s.]",name,lookup(name)->description);
838 static int infof(Opt_t* op, Sfio_t* sp, const char* s, Optdisc_t* dp)
843 sfprintf(sp,"[+Control Modes.]{");
844 listfields(sp,C_FLAG);
845 listgroup(sp,SPEED,"Attempt to set input and output baud rate to number given. A value of \b0\b causes immediate hangup");
846 listchars(sp,NUM);
847 listgroup(sp,SIZE,"Number of bits in a character");
848 sfprintf(sp,"}[+Input Modes.]{");
849 listfields(sp,I_FLAG);
850 sfprintf(sp,"}[+Output Modes.]{");
851 listfields(sp,O_FLAG);
853 listmask(sp,CRDLY,"Carriage return delay style");
856 listmask(sp,NLDLY,"Newline delay style");
859 listmask(sp,TABDLY,"Horizontal tab delay style");
862 listmask(sp,BSDLY,"Backspace delay style");
865 listmask(sp,FFDLY,"Form feed delay style");
868 listmask(sp,VTDLY,"Vertical tab delay style");
870 sfprintf(sp,"}[+Local Modes.]{");
871 listfields(sp,L_FLAG);
872 sfprintf(sp,"}[+Control Assignments.?If \ac\a is \bundef\b or an empty "
874 listchars(sp,WIND);
875 listchars(sp,CHAR);
876 sfprintf(sp,"}[+Combination Modes.]{");
877 listmode(sp,"ek");
878 listmode(sp,"evenp");
879 listmode(sp,"lcase");
880 listmode(sp,"oddp");
881 listmode(sp,"parity");
882 listmode(sp,"sane");
883 listmode(sp,"tabs");
884 listmode(sp,"LCASE");
885 sfputc(sp,'}');