version 1.13, 1997/07/13 19:00:13 |
version 1.15, 1997/08/25 19:31:45 |
Line 45 __RCSID("$NetBSD$"); |
|
Line 45 __RCSID("$NetBSD$"); |
|
#endif |
#endif |
#endif /* LIBC_SCCS and not lint */ |
#endif /* LIBC_SCCS and not lint */ |
|
|
|
#include "namespace.h" |
#include <sys/types.h> |
#include <sys/types.h> |
|
|
#include <ctype.h> |
#include <ctype.h> |
#include <db.h> |
#include <db.h> |
#include <errno.h> |
#include <errno.h> |
Line 57 __RCSID("$NetBSD$"); |
|
Line 57 __RCSID("$NetBSD$"); |
|
#include <string.h> |
#include <string.h> |
#include <unistd.h> |
#include <unistd.h> |
|
|
|
#ifdef __weak_alias |
|
__weak_alias(cgetcap,_cgetcap); |
|
__weak_alias(cgetclose,_cgetclose); |
|
__weak_alias(cgetent,_cgetent); |
|
__weak_alias(cgetfirst,_cgetfirst); |
|
__weak_alias(cgetmatch,_cgetmatch); |
|
__weak_alias(cgetnext,_cgetnext); |
|
__weak_alias(cgetnum,_cgetnum); |
|
__weak_alias(cgetset,_cgetset); |
|
__weak_alias(cgetstr,_cgetstr); |
|
__weak_alias(cgetustr,_cgetustr); |
|
#endif |
|
|
#define BFRAG 1024 |
#define BFRAG 1024 |
#define BSIZE 1024 |
#define BSIZE 1024 |
#define ESC ('[' & 037) /* ASCII ESC */ |
#define ESC ('[' & 037) /* ASCII ESC */ |
Line 247 getent(cap, len, db_array, fd, name, dep |
|
Line 260 getent(cap, len, db_array, fd, name, dep |
|
*/ |
*/ |
|
|
if (fd >= 0) { |
if (fd >= 0) { |
(void)lseek(fd, (off_t)0, L_SET); |
(void)lseek(fd, (off_t)0, SEEK_SET); |
} else { |
} else { |
(void)snprintf(pbuf, sizeof(pbuf), "%s.db", *db_p); |
(void)snprintf(pbuf, sizeof(pbuf), "%s.db", *db_p); |
if ((capdbp = dbopen(pbuf, O_RDONLY, 0, DB_HASH, 0)) |
if ((capdbp = dbopen(pbuf, O_RDONLY, 0, DB_HASH, 0)) |