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 81965 2001-08-20 12:28:40Z markm $"; |
40#endif 41#endif /* not lint */ 42 |
43#ifdef HAS_CGETENT 44#include <stdlib.h> 45#endif 46 |
47static char *area; 48 49/*ARGSUSED*/ |
50int 51getent(char *cp, char *name) |
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 * |
67Getstr(char *id, char **cpp) |
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 |