getent.c (63248) | getent.c (81965) |
---|---|
1/*- 2 * Copyright (c) 1991, 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 --- 22 unchanged lines hidden (view full) --- 31 * SUCH DAMAGE. 32 */ 33 34#ifndef lint 35#if 0 36static char sccsid[] = "@(#)getent.c 8.2 (Berkeley) 12/15/93"; 37#else 38static const char rcsid[] = | 1/*- 2 * Copyright (c) 1991, 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 --- 22 unchanged lines hidden (view full) --- 31 * SUCH DAMAGE. 32 */ 33 34#ifndef lint 35#if 0 36static char sccsid[] = "@(#)getent.c 8.2 (Berkeley) 12/15/93"; 37#else 38static const char rcsid[] = |
39 "$FreeBSD: head/contrib/telnet/libtelnet/getent.c 63248 2000-07-16 05:48:49Z peter $"; | 39 "$FreeBSD: head/contrib/telnet/libtelnet/getent.c 81965 2001-08-20 12:28:40Z markm $"; |
40#endif 41#endif /* not lint */ 42 | 40#endif 41#endif /* not lint */ 42 |
43#ifdef HAS_CGETENT 44#include <stdlib.h> 45#endif 46 |
|
43static char *area; 44 45/*ARGSUSED*/ | 47static char *area; 48 49/*ARGSUSED*/ |
46getent(cp, name) 47char *cp, *name; | 50int 51getent(char *cp, char *name) |
48{ 49#ifdef HAS_CGETENT 50 char *dba[2]; 51 52 dba[0] = "/etc/gettytab"; 53 dba[1] = 0; 54 return((cgetent(&area, dba, name) == 0) ? 1 : 0); 55#else 56 return(0); 57#endif 58} 59 60#ifndef SOLARIS 61/*ARGSUSED*/ 62char * | 52{ 53#ifdef HAS_CGETENT 54 char *dba[2]; 55 56 dba[0] = "/etc/gettytab"; 57 dba[1] = 0; 58 return((cgetent(&area, dba, name) == 0) ? 1 : 0); 59#else 60 return(0); 61#endif 62} 63 64#ifndef SOLARIS 65/*ARGSUSED*/ 66char * |
63Getstr(id, cpp) 64char *id, **cpp; | 67Getstr(char *id, char **cpp) |
65{ 66# ifdef HAS_CGETENT 67 char *answer; 68 return((cgetstr(area, id, &answer) > 0) ? answer : 0); 69# else 70 return(0); 71# endif 72} 73#endif | 68{ 69# ifdef HAS_CGETENT 70 char *answer; 71 return((cgetstr(area, id, &answer) > 0) ? answer : 0); 72# else 73 return(0); 74# endif 75} 76#endif |