From b96bc32e405f2b1b275fc5a3b625cfdcb0967034 Mon Sep 17 00:00:00 2001 From: Johan Danielsson Date: Tue, 22 Oct 1996 22:32:57 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@880 ec53bebd-3082-4978-b11e-865c3cabbd6b --- include/Makefile.in | 40 +++++++++++++++++++++++ include/bits.c | 76 ++++++++++++++++++++++++++++++++++++++++++++ kuser/Makefile.am | 8 +++++ lib/Makefile.am | 4 +++ lib/krb5/Makefile.am | 15 +++++++++ lib/krb5/cache.h | 6 ++-- lib/krb5/krb5.h | 15 ++------- lib/krb5/krb5_locl.h | 9 +++--- 8 files changed, 153 insertions(+), 20 deletions(-) create mode 100644 include/Makefile.in create mode 100644 include/bits.c create mode 100644 kuser/Makefile.am create mode 100644 lib/Makefile.am create mode 100644 lib/krb5/Makefile.am diff --git a/include/Makefile.in b/include/Makefile.in new file mode 100644 index 000000000..cef519503 --- /dev/null +++ b/include/Makefile.in @@ -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 + diff --git a/include/bits.c b/include/bits.c new file mode 100644 index 000000000..99efc76aa --- /dev/null +++ b/include/bits.c @@ -0,0 +1,76 @@ +#ifdef HAVE_CONFIG_H +#include +RCSID("$Id$"); +#endif +#include +#include +#include + +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; +} diff --git a/kuser/Makefile.am b/kuser/Makefile.am new file mode 100644 index 000000000..b5df6194f --- /dev/null +++ b/kuser/Makefile.am @@ -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 diff --git a/lib/Makefile.am b/lib/Makefile.am new file mode 100644 index 000000000..9b0fe2651 --- /dev/null +++ b/lib/Makefile.am @@ -0,0 +1,4 @@ +# $Id$ + +AUTOMAKE_OPTIONS = foreign no-dependencies +SUBDIRS = asn1 des krb5 diff --git a/lib/krb5/Makefile.am b/lib/krb5/Makefile.am new file mode 100644 index 000000000..1c3d77943 --- /dev/null +++ b/lib/krb5/Makefile.am @@ -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 diff --git a/lib/krb5/cache.h b/lib/krb5/cache.h index 7e798ce41..05bdc30cb 100644 --- a/lib/krb5/cache.h +++ b/lib/krb5/cache.h @@ -2,9 +2,9 @@ #define __CACHE_H__ krb5_error_code -krb5_cc_resolve (krb5_context context, - char *residual, - krb5_ccache *id); +krb5_cc_resolve(krb5_context context, + const char *residual, + krb5_ccache *id); char * krb5_cc_get_name (krb5_context context, diff --git a/lib/krb5/krb5.h b/lib/krb5/krb5.h index facffa2f6..aa360a364 100644 --- a/lib/krb5/krb5.h +++ b/lib/krb5/krb5.h @@ -13,6 +13,8 @@ #include #endif +#include + #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 +#include typedef struct { KDC_REP part1; diff --git a/lib/krb5/krb5_locl.h b/lib/krb5/krb5_locl.h index 5172d5aa1..deac9ebfa 100644 --- a/lib/krb5/krb5_locl.h +++ b/lib/krb5/krb5_locl.h @@ -1,6 +1,10 @@ #ifndef __KRB5_LOCL_H__ #define __KRB5_LOCL_H__ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -12,9 +16,6 @@ #include #include -extern int ioctl(int, int, ...); - - #include #include #include @@ -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__ */