*** empty log message ***

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@880 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
1996-10-22 22:32:57 +00:00
parent 190fed0b4e
commit b96bc32e40
8 changed files with 153 additions and 20 deletions

40
include/Makefile.in Normal file
View File

@@ -0,0 +1,40 @@
HEADERS = krb5.h asn1.h des.h bits.h cache.h config_file.h
srcdir = @srcdir@
VPATH = $(srcdir)
top_srcdir = @top_srcdir@
CC = @CC@
CFLAGS = @CFLAGS@
LN_S = ln -s
all:
for i in $(HEADERS) ; do \
if [ ! -h $$i -a ! -e $$i ]; then X="$$X $$i"; fi \
done; \
if [ ! -z "$$X" ]; then $(MAKE) $$X; fi
clean:
rm -f $(HEADERS) bits *.o core
krb5.h:
$(LN_S) $(top_srcdir)/lib/krb5/krb5.h .
cache.h:
$(LN_S) $(top_srcdir)/lib/krb5/cache.h .
config_file.h:
$(LN_S) $(top_srcdir)/lib/krb5/config_file.h .
asn1.h:
$(LN_S) ../lib/asn1/asn1.h .
des.h:
$(LN_S) $(top_srcdir)/lib/des/des.h .
bits.h: bits
./bits > bits.h
bits: bits.o
$(CC) -o bits bits.o

76
include/bits.c Normal file
View File

@@ -0,0 +1,76 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
RCSID("$Id$");
#endif
#include <stdio.h>
#include <string.h>
#include <ctype.h>
void strupr(char *s)
{
char *p = s;
while(*p){
if(islower(*p))
*p = toupper(*p);
p++;
}
}
#define BITSIZE(TYPE) \
{ \
int b = 0; TYPE x = 1; char *pre = "u_"; \
char tmp[128], tmp2[128]; \
while(x){ x <<= 1; b++; if(x < 0) pre=""; } \
if(b >= len){ \
int tabs; \
sprintf(tmp, "%sint%d_t" , pre, len); \
sprintf(tmp2, "typedef %s %s;", #TYPE, tmp); \
strupr(tmp); \
tabs = 5 - strlen(tmp2) / 8; \
printf("#ifndef HAVE_%s\n", tmp); \
printf("#define HAVE_%s\n", tmp); \
printf("%s", tmp2); \
while(tabs-- > 0) printf("\t"); \
printf("/* %2d bits */\n", b); \
printf("#endif /* HAVE_%s */\n", tmp); \
continue; \
} \
}
int main()
{
int i, b, len;
int sizes[] = { 8, 16, 32, 64 };
printf("#ifndef __BITS_H__\n");
printf("#define __BITS_H__\n");
printf("\n");
for(i = 0; i < sizeof(sizes) / sizeof(sizes[0]); i++){
len = sizes[i];
BITSIZE(char);
BITSIZE(short);
BITSIZE(int);
BITSIZE(long);
#ifdef HAVE_LONG_LONG
BITSIZE(long long);
#endif
printf("/* There is no %d bit type */\n", len);
break;
}
printf("\n");
for(i = 0; i < sizeof(sizes) / sizeof(sizes[0]); i++){
len = sizes[i];
BITSIZE(unsigned char);
BITSIZE(unsigned short);
BITSIZE(unsigned int);
BITSIZE(unsigned long);
#ifdef HAVE_LONG_LONG
BITSIZE(unsigned long long);
#endif
printf("/* There is no %d bit type */\n", len);
break;
}
printf("\n");
printf("#endif /* __BITS_H__ */\n");
return 0;
}

8
kuser/Makefile.am Normal file
View File

@@ -0,0 +1,8 @@
AUTOHEADER_FLAGS = no-dependencies
INCLUDES = -I$(top_builddir)/include
bin_PROGRAMS = kinit klist
LDADD = -L$(top_builddir)/lib/krb5 -lkrb5 -L$(top_builddir)/lib/des -ldes -L$(top_builddir)/lib/asn1 -lasn1

4
lib/Makefile.am Normal file
View File

@@ -0,0 +1,4 @@
# $Id$
AUTOMAKE_OPTIONS = foreign no-dependencies
SUBDIRS = asn1 des krb5

15
lib/krb5/Makefile.am Normal file
View File

@@ -0,0 +1,15 @@
# $Id$
AUTOMAKE_OPTIONS = no-dependencies
INCLUDES = -I$(top_builddir)/include
lib_LIBRARIES = krb5
krb5_SOURCES = cache.c config_file.y constants.c context.c data.c \
get_addrs.c get_cred.c get_in_tkt.c get_in_tkt_pw.c get_port.c \
krbhst.c misc.c principal.c principal_p.c send_to_kdc.c str2key.c
config_file.c: config_file.y
$(YACC) -p __k5cf_ $<
mv -f y.tab.c config_file.c

View File

@@ -3,7 +3,7 @@
krb5_error_code
krb5_cc_resolve(krb5_context context,
char *residual,
const char *residual,
krb5_ccache *id);
char *

View File

@@ -13,6 +13,8 @@
#include <sys/bitypes.h>
#endif
#include <bits.h>
#include "config_file.h"
/* simple constants */
@@ -22,17 +24,6 @@
#define FALSE 0
#endif
#if 1
/* types */
typedef int int32_t;
typedef short int16_t;
typedef char int8_t;
typedef unsigned int u_int32_t;
typedef unsigned short u_int16_t;
typedef unsigned char u_int8_t;
#endif
typedef int krb5_boolean;
typedef int32_t krb5_error_code;
@@ -222,7 +213,7 @@ typedef struct krb5_auth_context{
typedef u_int32_t krb5_flags;
#include <foo.h>
#include <asn1.h>
typedef struct {
KDC_REP part1;

View File

@@ -1,6 +1,10 @@
#ifndef __KRB5_LOCL_H__
#define __KRB5_LOCL_H__
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <errno.h>
#include <ctype.h>
#include <string.h>
@@ -12,9 +16,6 @@
#include <sys/types.h>
#include <sys/ioctl.h>
extern int ioctl(int, int, ...);
#include <sys/param.h>
#include <time.h>
#include <sys/time.h>
@@ -61,6 +62,4 @@ krb5_sendto_kdc (krb5_context context,
#define ALLOC(N, X) ((X*)malloc((N) * sizeof(X)))
#define FREE(X) do{if(X)free(X);}while(0)
#define RCSID(X) static char *rcsid[] = { (char*)rcsid, X }
#endif /* __KRB5_LOCL_H__ */