Invoke the new 'unifdef:' target, and make this lib a complete subset

of the crypto (master) code.
This commit is contained in:
Mark Murray 2001-11-30 21:55:10 +00:00
parent 6f3933fa6f
commit 018925b883
4 changed files with 51 additions and 58 deletions

View File

@ -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);
}

View File

@ -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

View File

@ -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

View File

@ -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;