/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Copyright (c) 1983 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Stolen from ucb/lpr/printjob.c
*/
#include <string.h>
#include "uucp.h"
static int parse_modes(char *modes);
static void setty(int);
int
char *modes;
int fd;
{
if (parse_modes(modes))
return (0);
}
struct mds {
char *string;
unsigned long set;
unsigned long reset;
};
/* Control Modes */
"parenb", PARENB, 0,
"-parenb", 0, PARENB,
"parodd", PARODD, 0,
"-parodd", 0, PARODD,
"cstopb", CSTOPB, 0,
"-cstopb", 0, CSTOPB,
"stopb", CSTOPB, 0,
"-stopb", 0, CSTOPB,
"hupcl", HUPCL, 0,
"hup", HUPCL, 0,
"-hupcl", 0, HUPCL,
"-hup", 0, HUPCL,
"clocal", CLOCAL, 0,
"-clocal", 0, CLOCAL,
"nohang", CLOCAL, 0,
"-nohang", 0, CLOCAL,
#if 0 /* this bit isn't supported */
"loblk", LOBLK, 0,
"-loblk", 0, LOBLK,
#endif
"cread", CREAD, 0,
"-cread", 0, CREAD,
#ifndef CRTSCTS
#endif
"crtscts", CRTSCTS, 0,
"-crtscts", 0, CRTSCTS,
#ifndef CRTSXOFF
#endif
"crtsxoff", CRTSXOFF, 0,
"-crtsxoff", 0, CRTSXOFF,
0
};
/* Input Modes */
"ignbrk", IGNBRK, 0,
"-ignbrk", 0, IGNBRK,
"brkint", BRKINT, 0,
"-brkint", 0, BRKINT,
"ignpar", IGNPAR, 0,
"-ignpar", 0, IGNPAR,
"parmrk", PARMRK, 0,
"-parmrk", 0, PARMRK,
"inpck", INPCK, 0,
"-inpck", 0, INPCK,
"istrip", ISTRIP, 0,
"-istrip", 0, ISTRIP,
"inlcr", INLCR, 0,
"-inlcr", 0, INLCR,
"igncr", IGNCR, 0,
"-igncr", 0, IGNCR,
"icrnl", ICRNL, 0,
"-icrnl", 0, ICRNL,
"nl", 0, ICRNL,
"iuclc", IUCLC, 0,
"-iuclc", 0, IUCLC,
"lcase", IUCLC, 0,
"-lcase", 0, IUCLC,
"LCASE", IUCLC, 0,
"-LCASE", 0, IUCLC,
"ixon", IXON, 0,
"-ixon", 0, IXON,
"ixany", IXANY, 0,
"-ixany", 0, IXANY,
"decctlq", 0, IXANY,
"-decctlq", IXANY, 0,
"ixoff", IXOFF, 0,
"-ixoff", 0, IXOFF,
"tandem", IXOFF, 0,
"-tandem", 0, IXOFF,
"imaxbel", IMAXBEL, 0,
"-imaxbel", 0, IMAXBEL,
"pass8", 0, ISTRIP,
"-pass8", ISTRIP, 0,
"raw", 0, (unsigned long)-1,
0
};
/* Local Modes */
"isig", ISIG, 0,
"-isig", 0, ISIG,
"noisig", 0, ISIG,
"-noisig", ISIG, 0,
"iexten", IEXTEN, 0,
"-iexten", 0, IEXTEN,
"icanon", ICANON, 0,
"-icanon", 0, ICANON,
"cbreak", 0, ICANON,
"-cbreak", ICANON, 0,
"xcase", XCASE, 0,
"-xcase", 0, XCASE,
"lcase", XCASE, 0,
"-lcase", 0, XCASE,
"LCASE", XCASE, 0,
"-LCASE", 0, XCASE,
"echo", ECHO, 0,
"-echo", 0, ECHO,
"echoe", ECHOE, 0,
"-echoe", 0, ECHOE,
"crterase", ECHOE, 0,
"-crterase", 0, ECHOE,
"echok", ECHOK, 0,
"-echok", 0, ECHOK,
"lfkc", ECHOK, 0,
"-lfkc", 0, ECHOK,
"echonl", ECHONL, 0,
"-echonl", 0, ECHONL,
"noflsh", NOFLSH, 0,
"-noflsh", 0, NOFLSH,
"tostop", TOSTOP, 0,
"-tostop", 0, TOSTOP,
"echoctl", ECHOCTL, 0,
"-echoctl", 0, ECHOCTL,
"ctlecho", ECHOCTL, 0,
"-ctlecho", 0, ECHOCTL,
"echoprt", ECHOPRT, 0,
"-echoprt", 0, ECHOPRT,
"prterase", ECHOPRT, 0,
"-prterase", 0, ECHOPRT,
"echoke", ECHOKE, 0,
"-echoke", 0, ECHOKE,
"crtkill", ECHOKE, 0,
"-crtkill", 0, ECHOKE,
#if 0 /* this bit isn't supported yet */
"defecho", DEFECHO, 0,
"-defecho", 0, DEFECHO,
#endif
0,
};
/* Output Modes */
"opost", OPOST, 0,
"-opost", 0, OPOST,
"nopost", 0, OPOST,
"-nopost", OPOST, 0,
"olcuc", OLCUC, 0,
"-olcuc", 0, OLCUC,
"lcase", OLCUC, 0,
"-lcase", 0, OLCUC,
"LCASE", OLCUC, 0,
"-LCASE", 0, OLCUC,
"onlcr", ONLCR, 0,
"-onlcr", 0, ONLCR,
"nl", 0, ONLCR,
"ocrnl", OCRNL, 0,
"-ocrnl", 0, OCRNL,
"onocr", ONOCR, 0,
"-onocr", 0, ONOCR,
"onlret", ONLRET, 0,
"-onlret", 0, ONLRET,
"ofill", OFILL, 0,
"-ofill", 0, OFILL,
"ofdel", OFDEL, 0,
"-ofdel", 0, OFDEL,
#if 0 /* these bits aren't supported yet */
"pageout", PAGEOUT, 0,
"-pageout", 0, PAGEOUT,
"wrap", WRAP, 0,
"-wrap", 0, WRAP,
#endif
"litout", 0, OPOST,
"-litout", OPOST, 0,
"raw", 0, OPOST,
"-raw", OPOST, 0,
"cooked", OPOST, 0,
0,
};
/*
* Parse a set of modes.
*/
static int
char *modes;
{
char *curtoken;
int match;
int i;
termios_clear.c_iflag = 0;
termios_clear.c_oflag = 0;
termios_clear.c_cflag = 0;
termios_clear.c_lflag = 0;
termios_set.c_iflag = 0;
termios_set.c_oflag = 0;
termios_set.c_cflag = 0;
termios_set.c_lflag = 0;
match = 0;
match++;
}
}
match++;
}
}
match++;
}
}
match++;
}
}
if (!match) {
return (0);
}
}
return (1);
}
/*
* setup tty lines.
*/
static void
{
return;
}
return;
}
}