| version 1.10.4.2, 1996/09/19 20:02:39 |
version 1.11, 1997/01/23 14:01:54 |
| Line 44 static char rcsid[] = "$NetBSD$"; |
|
| Line 44 static char 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> |
| Line 57 static char rcsid[] = "$NetBSD$"; |
|
| Line 56 static char 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 */ |
|
|
| return (-1); |
return (-1); |
| } |
} |
| gottoprec = 0; |
gottoprec = 0; |
| (void)strcpy(toprec, ent); |
(void)strcpy(toprec, ent); /* XXX: strcpy is safe */ |
| return (0); |
return (0); |
| } |
} |
| |
|
| Line 234 getent(cap, len, db_array, fd, name, dep |
|
| Line 220 getent(cap, len, db_array, fd, name, dep |
|
| errno = ENOMEM; |
errno = ENOMEM; |
| return (-2); |
return (-2); |
| } |
} |
| (void)strcpy(record, toprec); |
(void)strcpy(record, toprec); /* XXX: strcpy is safe */ |
| myfd = 0; |
myfd = 0; |
| db_p = db_array; |
db_p = db_array; |
| rp = record + topreclen + 1; |
rp = record + topreclen + 1; |
| Line 262 getent(cap, len, db_array, fd, name, dep |
|
| Line 248 getent(cap, len, db_array, fd, name, dep |
|
| */ |
*/ |
| |
|
| if (fd >= 0) { |
if (fd >= 0) { |
| (void)lseek(fd, (off_t)0, SEEK_SET); |
(void)lseek(fd, (off_t)0, L_SET); |
| myfd = 0; |
myfd = 0; |
| } else { |
} else { |
| (void)snprintf(pbuf, sizeof(pbuf), "%s.db", *db_p); |
(void)snprintf(pbuf, sizeof(pbuf), "%s.db", *db_p); |