diff options
author | markm <markm@FreeBSD.org> | 2001-11-30 21:55:10 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 2001-11-30 21:55:10 +0000 |
commit | 33f349996fd8350d4e5943fea640bf1b77088e70 (patch) | |
tree | 651c3cac194a459245d30fafaa3baf897285aa10 /lib/libtelnet | |
parent | aa8360c1cd7a7e842c08ab62bfc84fa95a2826c3 (diff) | |
download | FreeBSD-src-33f349996fd8350d4e5943fea640bf1b77088e70.zip FreeBSD-src-33f349996fd8350d4e5943fea640bf1b77088e70.tar.gz |
Invoke the new 'unifdef:' target, and make this lib a complete subset
of the crypto (master) code.
Diffstat (limited to 'lib/libtelnet')
-rw-r--r-- | lib/libtelnet/genget.c | 9 | ||||
-rw-r--r-- | lib/libtelnet/getent.c | 40 | ||||
-rw-r--r-- | lib/libtelnet/misc-proto.h | 25 | ||||
-rw-r--r-- | lib/libtelnet/misc.c | 35 |
4 files changed, 51 insertions, 58 deletions
diff --git a/lib/libtelnet/genget.c b/lib/libtelnet/genget.c index e46b1cb..e24bb44 100644 --- a/lib/libtelnet/genget.c +++ b/lib/libtelnet/genget.c @@ -32,6 +32,7 @@ */ #include <sys/cdefs.h> + __FBSDID("$FreeBSD$"); #ifndef lint @@ -43,6 +44,8 @@ static const char sccsid[] = "@(#)genget.c 8.2 (Berkeley) 5/30/95"; #include <ctype.h> +#include "misc-proto.h" + #define LOWER(x) (isupper(x) ? tolower(x) : (x)) /* * The prefix function returns 0 if *s1 is not a prefix @@ -51,7 +54,7 @@ static const char sccsid[] = "@(#)genget.c 8.2 (Berkeley) 5/30/95"; * the length of *s1 is returned. */ int -isprefix(char *s1, char *s2) +isprefix(char *s1, const char *s2) { char *os1; char c1, c2; @@ -98,7 +101,7 @@ genget(char *name, char **table, int stlen) * Function call version of Ambiguous() */ int -Ambiguous(char *s) +Ambiguous(char **s) { - return((char **)s == &ambiguous); + return(s == &ambiguous); } diff --git a/lib/libtelnet/getent.c b/lib/libtelnet/getent.c index ee6f03f..d6e8d9c 100644 --- a/lib/libtelnet/getent.c +++ b/lib/libtelnet/getent.c @@ -32,6 +32,7 @@ */ #include <sys/cdefs.h> + __FBSDID("$FreeBSD$"); #ifndef lint @@ -40,37 +41,36 @@ static char sccsid[] = "@(#)getent.c 8.2 (Berkeley) 12/15/93"; #endif #endif /* not lint */ -#ifdef HAS_CGETENT #include <stdlib.h> -#endif +#include <string.h> + +#include "misc-proto.h" static char *area; +static char gettytab[] = "/etc/gettytab"; /*ARGSUSED*/ int -getent(char *cp, char *name) +getent(char *cp __unused, const char *name) { -#ifdef HAS_CGETENT - char *dba[2]; + int retval; + char *tempnam, *dba[2] = { gettytab, NULL }; - dba[0] = "/etc/gettytab"; - dba[1] = 0; - return((cgetent(&area, dba, name) == 0) ? 1 : 0); -#else - return(0); -#endif + tempnam = strdup(name); + retval = cgetent(&area, dba, tempnam) == 0 ? 1 : 0; + free(tempnam); + return(retval); } -#ifndef SOLARIS /*ARGSUSED*/ char * -Getstr(char *id, char **cpp) +Getstr(const char *id, char **cpp __unused) { -# ifdef HAS_CGETENT - char *answer; - return((cgetstr(area, id, &answer) > 0) ? answer : 0); -# else - return(0); -# endif + int retval; + char *answer, *tempid; + + tempid = strdup(id); + retval = cgetstr(area, tempid, &answer); + free(tempid); + return((retval > 0) ? answer : NULL); } -#endif diff --git a/lib/libtelnet/misc-proto.h b/lib/libtelnet/misc-proto.h index c0d2068..5f4f9fc 100644 --- a/lib/libtelnet/misc-proto.h +++ b/lib/libtelnet/misc-proto.h @@ -65,17 +65,24 @@ #endif #endif -void auth_encrypt_init P((char *, char *, char *, int)); -void auth_encrypt_connect P((int)); -void printd P((unsigned char *, int)); +void auth_encrypt_init(char *, char *, const char *, int); +void auth_encrypt_connect(int); +void printd(const unsigned char *, int); + +int isprefix(char *, const char *); +char **genget(char *, char **, int); +int Ambiguous(char **); + +int getent(char *, const char *); +char *Getstr(const char *, char **); /* * These functions are imported from the application */ -int net_write P((unsigned char *, int)); -void net_encrypt P((void)); -int telnet_spin P((void)); -char *telnet_getenv P((char *)); -char *telnet_gets P((char *, char *, int, int)); -void printsub P((int, unsigned char *, int)); +int net_write(unsigned char *, int); +void net_encrypt(void); +int telnet_spin(void); +char *telnet_getenv(char *); +char *telnet_gets(const char *, char *, int, int); +void printsub(char, unsigned char *, int); #endif diff --git a/lib/libtelnet/misc.c b/lib/libtelnet/misc.c index e7cd1f0..981208e 100644 --- a/lib/libtelnet/misc.c +++ b/lib/libtelnet/misc.c @@ -32,6 +32,7 @@ */ #include <sys/cdefs.h> + __FBSDID("$FreeBSD$"); #ifndef lint @@ -42,6 +43,8 @@ static const char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 6/4/93"; #include <stdio.h> #include <stdlib.h> +#include <string.h> + #include "misc.h" char *RemoteHostName; @@ -49,12 +52,10 @@ char *LocalHostName; char *UserNameRequested = 0; int ConnectedCount = 0; - void -auth_encrypt_init(local, remote, name, server) - char *local; - char *remote; - char *name; - int server; +#define undef1 __unused + +void +auth_encrypt_init(char *local, char *remote, const char *name undef1, int server undef1) { RemoteHostName = remote; LocalHostName = local; @@ -64,27 +65,9 @@ auth_encrypt_init(local, remote, name, server) } } - void -auth_encrypt_user(name) - char *name; -{ - extern char *strdup(); - - if (UserNameRequested) - free(UserNameRequested); - UserNameRequested = name ? strdup(name) : 0; -} - - void -auth_encrypt_connect(cnt) - int cnt; -{ -} - void -printd(data, cnt) - unsigned char *data; - int cnt; +void +printd(const unsigned char *data, int cnt) { if (cnt > 16) cnt = 16; |