getttyent.c (90045) | getttyent.c (148401) |
---|---|
1/* 2 * Copyright (c) 1989, 1993 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 --- 21 unchanged lines hidden (view full) --- 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 */ 33 34#if defined(LIBC_SCCS) && !defined(lint) 35static char sccsid[] = "@(#)getttyent.c 8.1 (Berkeley) 6/4/93"; 36#endif /* LIBC_SCCS and not lint */ 37#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 1989, 1993 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 --- 21 unchanged lines hidden (view full) --- 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 */ 33 34#if defined(LIBC_SCCS) && !defined(lint) 35static char sccsid[] = "@(#)getttyent.c 8.1 (Berkeley) 6/4/93"; 36#endif /* LIBC_SCCS and not lint */ 37#include <sys/cdefs.h> |
38__FBSDID("$FreeBSD: head/lib/libc/gen/getttyent.c 90045 2002-02-01 01:32:19Z obrien $"); | 38__FBSDID("$FreeBSD: head/lib/libc/gen/getttyent.c 148401 2005-07-25 17:57:15Z mdodd $"); |
39 40#include <ttyent.h> 41#include <stdio.h> 42#include <stdlib.h> 43#include <ctype.h> 44#include <string.h> 45 46static char zapchar; --- 53 unchanged lines hidden (view full) --- 100 break; 101 } 102 103#define scmp(e) !strncmp(p, e, sizeof(e) - 1) && isspace((unsigned char)p[sizeof(e) - 1]) 104#define vcmp(e) !strncmp(p, e, sizeof(e) - 1) && p[sizeof(e) - 1] == '=' 105 106 zapchar = 0; 107 tty.ty_name = p; | 39 40#include <ttyent.h> 41#include <stdio.h> 42#include <stdlib.h> 43#include <ctype.h> 44#include <string.h> 45 46static char zapchar; --- 53 unchanged lines hidden (view full) --- 100 break; 101 } 102 103#define scmp(e) !strncmp(p, e, sizeof(e) - 1) && isspace((unsigned char)p[sizeof(e) - 1]) 104#define vcmp(e) !strncmp(p, e, sizeof(e) - 1) && p[sizeof(e) - 1] == '=' 105 106 zapchar = 0; 107 tty.ty_name = p; |
108 tty.ty_status = 0; 109 tty.ty_window = NULL; 110 tty.ty_group = _TTYS_NOGROUP; 111 |
|
108 p = skip(p); 109 if (!*(tty.ty_getty = p)) 110 tty.ty_getty = tty.ty_type = NULL; 111 else { 112 p = skip(p); 113 if (!*(tty.ty_type = p)) 114 tty.ty_type = NULL; 115 else { 116 /* compatibility kludge: handle network/dialup specially */ 117 if (scmp(_TTYS_DIALUP)) 118 tty.ty_status |= TTY_DIALUP; 119 else if (scmp(_TTYS_NETWORK)) 120 tty.ty_status |= TTY_NETWORK; 121 p = skip(p); 122 } 123 } | 112 p = skip(p); 113 if (!*(tty.ty_getty = p)) 114 tty.ty_getty = tty.ty_type = NULL; 115 else { 116 p = skip(p); 117 if (!*(tty.ty_type = p)) 118 tty.ty_type = NULL; 119 else { 120 /* compatibility kludge: handle network/dialup specially */ 121 if (scmp(_TTYS_DIALUP)) 122 tty.ty_status |= TTY_DIALUP; 123 else if (scmp(_TTYS_NETWORK)) 124 tty.ty_status |= TTY_NETWORK; 125 p = skip(p); 126 } 127 } |
124 tty.ty_status = 0; 125 tty.ty_window = NULL; 126 tty.ty_group = _TTYS_NOGROUP; | |
127 128 for (; *p; p = skip(p)) { 129 if (scmp(_TTYS_OFF)) 130 tty.ty_status &= ~TTY_ON; 131 else if (scmp(_TTYS_ON)) 132 tty.ty_status |= TTY_ON; 133 else if (scmp(_TTYS_SECURE)) 134 tty.ty_status |= TTY_SECURE; --- 132 unchanged lines hidden --- | 128 129 for (; *p; p = skip(p)) { 130 if (scmp(_TTYS_OFF)) 131 tty.ty_status &= ~TTY_ON; 132 else if (scmp(_TTYS_ON)) 133 tty.ty_status |= TTY_ON; 134 else if (scmp(_TTYS_SECURE)) 135 tty.ty_status |= TTY_SECURE; --- 132 unchanged lines hidden --- |