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.2 (Berkeley) 12/15/93";
10 #endif /* not lint */
11
12 static char *area;
13
14 /*ARGSUSED*/
getent(cp,name)15 getent(cp, name)
16 char *cp, *name;
17 {
18 #ifdef HAS_CGETENT
19 char *dba[2];
20
21 dba[0] = "/etc/gettytab";
22 dba[1] = 0;
23 return((cgetent(&area, dba, name) == 0) ? 1 : 0);
24 #else
25 return(0);
26 #endif
27 }
28
29 #ifndef SOLARIS
30 /*ARGSUSED*/
31 char *
getstr(id,cpp)32 getstr(id, cpp)
33 char *id, **cpp;
34 {
35 # ifdef HAS_CGETENT
36 char *answer;
37 return((cgetstr(area, id, &answer) > 0) ? answer : 0);
38 # else
39 return(0);
40 # endif
41 }
42 #endif
43