Home | History | Annotate | Line # | Download | only in tvctrl
tvctrl.c revision 1.4
      1  1.4    itohy /*	$NetBSD: tvctrl.c,v 1.4 1999/01/13 10:23:40 itohy Exp $	*/
      2  1.2    perry 
      3  1.1      oki #include <sys/types.h>
      4  1.1      oki #include <sys/ioctl.h>
      5  1.3  minoura #include <machine/iteioctl.h>
      6  1.4    itohy #include <err.h>
      7  1.4    itohy #include <stdio.h>
      8  1.4    itohy #include <stdlib.h>
      9  1.1      oki 
     10  1.4    itohy int main __P((int, char *[]));
     11  1.4    itohy 
     12  1.4    itohy int
     13  1.1      oki main(argc, argv)
     14  1.4    itohy 	int argc;
     15  1.4    itohy 	char *argv[];
     16  1.1      oki {
     17  1.4    itohy 	unsigned long num;
     18  1.4    itohy 	unsigned char ctl;
     19  1.4    itohy 	char *ep;
     20  1.4    itohy 
     21  1.4    itohy 	if (argc < 2) {
     22  1.4    itohy 		fprintf(stderr, "usage: %s control_number [...]\n", argv[0]);
     23  1.4    itohy 		return 1;
     24  1.4    itohy 	}
     25  1.4    itohy 	while (argv++, --argc != 0) {
     26  1.4    itohy 		num = strtoul(argv[0], &ep, 10);
     27  1.4    itohy 		if (num > 255 || *ep != '\0')
     28  1.4    itohy 			errx(1, "illegal number -- %s", argv[0]);
     29  1.4    itohy 
     30  1.4    itohy 		ctl = num;
     31  1.4    itohy 		if (ioctl(0, ITETVCTRL, &ctl))
     32  1.4    itohy 			err(1, "ioctl(ITETVCTRL)");
     33  1.4    itohy 	}
     34  1.4    itohy 
     35  1.4    itohy 	return 0;
     36  1.1      oki }
     37