xref: /original-bsd/lib/libtelnet/getent.c (revision c3e32dec)
1 /*-
2  * Copyright (c) 1991, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  */
7 
8 #ifndef lint
9 static char sccsid[] = "@(#)getent.c	8.1 (Berkeley) 06/04/93";
10 #endif /* not lint */
11 
12 static char *area;
13 
14 /*ARGSUSED*/
15 getent(cp, name)
16 char *cp, *name;
17 {
18 	char *dba[2];
19 
20 	dba[0] = "/etc/gettytab";
21 	dba[1] = 0;
22 	return((cgetent(&area, dba, name) == 0) ? 1 : 0);
23 }
24 
25 #ifndef	__svr4__
26 /*ARGSUSED*/
27 char *
28 getstr(id, cpp)
29 char *id, **cpp;
30 {
31 	char *answer;
32 	return((cgetstr(area, id, &answer) > 0) ? answer : 0);
33 }
34 #endif
35