diff options
Diffstat (limited to 'src/libutil/md5.h')
-rw-r--r-- | src/libutil/md5.h | 70 |
1 files changed, 1 insertions, 69 deletions
diff --git a/src/libutil/md5.h b/src/libutil/md5.h index 6301e4558..6daac5060 100644 --- a/src/libutil/md5.h +++ b/src/libutil/md5.h @@ -21,65 +21,9 @@ #ifndef _MD5_H #define _MD5_H 1 -#include <stdio.h> - -#if defined HAVE_LIMITS_H || _LIBC -# include <limits.h> -#endif - -/* The following contortions are an attempt to use the C preprocessor - to determine an unsigned integral type that is 32 bits wide. An - alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but - doing that would require that the configure script compile and *run* - the resulting executable. Locally running cross-compiled executables - is usually not possible. */ - -#ifdef _LIBC -# include <stdint.h> +#include <stdint.h> typedef uint32_t md5_uint32; typedef uintptr_t md5_uintptr; -#else -# if defined __STDC__ && __STDC__ -# define UINT_MAX_32_BITS 4294967295U -# else -# define UINT_MAX_32_BITS 0xFFFFFFFF -# endif - -/* If UINT_MAX isn't defined, assume it's a 32-bit type. - This should be valid for all systems GNU cares about because - that doesn't include 16-bit systems, and only modern systems - (that certainly have <limits.h>) have 64+-bit integral types. */ - -# ifndef UINT_MAX -# define UINT_MAX UINT_MAX_32_BITS -# endif - -# if UINT_MAX == UINT_MAX_32_BITS - typedef unsigned int md5_uint32; -# else -# if USHRT_MAX == UINT_MAX_32_BITS - typedef unsigned short md5_uint32; -# else -# if ULONG_MAX == UINT_MAX_32_BITS - typedef unsigned long md5_uint32; -# else - /* The following line is intended to evoke an error. - Using #error is not portable enough. */ - "Cannot determine unsigned 32-bit data type." -# endif -# endif -# endif -/* We have to make a guess about the integer type equivalent in size - to pointers which should always be correct. */ -typedef unsigned long int md5_uintptr; -#endif - -#undef __P -#if defined (__STDC__) && __STDC__ -# define __P(x) x -#else -# define __P(x) () -#endif /* Structure to save state of computation between the single steps. */ struct md5_ctx @@ -136,16 +80,4 @@ extern void *md5_finish_ctx __P ((struct md5_ctx *ctx, void *resbuf)); extern void *md5_read_ctx __P ((const struct md5_ctx *ctx, void *resbuf)); -/* Compute MD5 message digest for bytes read from STREAM. The - resulting message digest number will be written into the 16 bytes - beginning at RESBLOCK. */ -extern int md5_stream __P ((FILE *stream, void *resblock)); - -/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The - result is always in little endian byte order, so that a byte-wise - output yields to the wanted ASCII representation of the message - digest. */ -extern void *md5_buffer __P ((const char *buffer, size_t len, - void *resblock)); - #endif /* md5.h */ |