Deleted Added
sdiff udiff text old ( 63248 ) new ( 81965 )
full compact
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 $";
40#endif
41#endif /* not lint */
42
43static char *area;
44
45/*ARGSUSED*/
46getent(cp, name)
47char *cp, *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 *
63Getstr(id, cpp)
64char *id, **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