modes.c (74367) | modes.c (78146) |
---|---|
1/*- 2 * Copyright (c) 1991, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 22 unchanged lines hidden (view full) --- 31 * SUCH DAMAGE. 32 */ 33 34#ifndef lint 35/* 36static char sccsid[] = "@(#)modes.c 8.3 (Berkeley) 4/2/94"; 37*/ 38static const char rcsid[] = | 1/*- 2 * Copyright (c) 1991, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 22 unchanged lines hidden (view full) --- 31 * SUCH DAMAGE. 32 */ 33 34#ifndef lint 35/* 36static char sccsid[] = "@(#)modes.c 8.3 (Berkeley) 4/2/94"; 37*/ 38static const char rcsid[] = |
39 "$FreeBSD: head/usr.sbin/lpr/lpd/modes.c 74367 2001-03-16 21:54:12Z gad $"; | 39 "$FreeBSD: head/usr.sbin/lpr/lpd/modes.c 78146 2001-06-12 16:38:20Z gad $"; |
40#endif /* not lint */ 41 42#include <stddef.h> 43#include <string.h> 44#include <termios.h> 45#include "lp.local.h" 46#include "extern.h" 47 48struct modes { 49 const char *name; | 40#endif /* not lint */ 41 42#include <stddef.h> 43#include <string.h> 44#include <termios.h> 45#include "lp.local.h" 46#include "extern.h" 47 48struct modes { 49 const char *name; |
50 const long set; 51 const long unset; | 50 const long set; 51 const long unset; |
52}; 53 54/* 55 * The code in optlist() depends on minus options following regular 56 * options, i.e. "foo" must immediately precede "-foo". 57 */ 58struct modes cmodes[] = { 59 { "cs5", CS5, CSIZE }, --- 137 unchanged lines hidden (view full) --- 197 { "oxtabs", OXTABS, 0 }, 198 { "-oxtabs", 0, OXTABS }, 199 { NULL, 0, 0}, 200}; 201 202#define CHK(name, s) (*name == s[0] && !strcmp(name, s)) 203 204int | 52}; 53 54/* 55 * The code in optlist() depends on minus options following regular 56 * options, i.e. "foo" must immediately precede "-foo". 57 */ 58struct modes cmodes[] = { 59 { "cs5", CS5, CSIZE }, --- 137 unchanged lines hidden (view full) --- 197 { "oxtabs", OXTABS, 0 }, 198 { "-oxtabs", 0, OXTABS }, 199 { NULL, 0, 0}, 200}; 201 202#define CHK(name, s) (*name == s[0] && !strcmp(name, s)) 203 204int |
205msearch(str, ip) 206 char *str; 207 struct termios *ip; | 205msearch(char *str, struct termios *ip) |
208{ 209 struct modes *mp; 210 211 for (mp = cmodes; mp->name; ++mp) 212 if (CHK(str, mp->name)) { 213 ip->c_cflag &= ~mp->unset; 214 ip->c_cflag |= mp->set; 215 return (1); --- 21 unchanged lines hidden --- | 206{ 207 struct modes *mp; 208 209 for (mp = cmodes; mp->name; ++mp) 210 if (CHK(str, mp->name)) { 211 ip->c_cflag &= ~mp->unset; 212 ip->c_cflag |= mp->set; 213 return (1); --- 21 unchanged lines hidden --- |