--- /dev/null
+2001-11-08 Sam Hartman <hartmans@mit.edu>
+
+ * yarrow.h: Don't use #error
+ (YARROW_DLL): Don't actually ever export or import from win32 dlls as Yarrow is not a public part of krb5 API
+ (yarrow_poll): Drop from the API
+ Remove MAc-specific memset and memcpy
+
+ * ytypes.h yarrow.c: Align with krb5 int types
+
HASH_CTX hash;
byte v_0[HASH_DIGEST_SIZE];
byte v_i[HASH_DIGEST_SIZE];
- uint32 big_endian_int32;
+ krb5_ui_4 big_endian_int32;
COUNTER i;
if (!y) { THROW( YARROW_BAD_ARG ); }
HASH_Update(&hash, v_i, sizeof(v_i));
HASH_Update(&hash, v_0, sizeof(v_0));
big_endian_int32 = make_big_endian32(i >> 32); /* MS word */
- HASH_Update(&hash, &big_endian_int32, sizeof(uint32));
+ HASH_Update(&hash, &big_endian_int32, sizeof(krb5_ui_4));
big_endian_int32 = make_big_endian32(i & 0xFFFFFFFF); /* LS word */
- HASH_Update(&hash, &big_endian_int32, sizeof(uint32));
+ HASH_Update(&hash, &big_endian_int32, sizeof(krb5_ui_4));
HASH_Final(&hash, v_i);
}
#ifndef YARROW_H
#define YARROW_H
-#if defined( YARROW_DETECT_FORK )
+#ifdef HAVE_UNISTD_H
+#define YARROW_DETECT_FORK
#include <unistd.h>
#endif
/* sanity checks */
#if YARROW_FAST_THRESH > YARROW_POOL_SIZE
-#error "can't have higher YARROW_FAST_THRESH than pool size"
+error "can't have higher YARROW_FAST_THRESH than pool size"
#endif
#if YARROW_SLOW_THRESH > YARROW_POOL_SIZE
-#error "can't have higher YARROW_SLOW_THRESH than pool size"
+error "can't have higher YARROW_SLOW_THRESH than pool size"
#endif
#if YARROW_FAST_INIT_THRESH > YARROW_POOL_SIZE
-#error "can't have higher YARROW_FAST_INIT_THRESH than pool size"
+error "can't have higher YARROW_FAST_INIT_THRESH than pool size"
#endif
#if YARROW_SLOW_INIT_THRESH > YARROW_POOL_SIZE
-#error "can't have higher YARROW_SLOW_INIT_THRESH than pool size"
+error "can't have higher YARROW_SLOW_INIT_THRESH than pool size"
#endif
typedef size_t estimator_fn(const void* sample, size_t size);
int slow_k_of_n_thresh;
} Yarrow_CTX;
-#if defined(WIN32)
-# if defined(YARROW_IMPL)
-# define YARROW_DLL __declspec(dllexport)
-# else
-# define YARROW_DLL __declspec(dllimport)
-# endif
-#else
# define YARROW_DLL
-#endif
+
YARROW_DLL
int Yarrow_Init( Yarrow_CTX* y, const char *filename );
-YARROW_DLL
-int Yarrow_Poll( Yarrow_CTX *y, unsigned source_id );
YARROW_DLL
int Yarrow_Input( Yarrow_CTX* y, unsigned source_id,
const char* Yarrow_Str_Error( int );
-/* portability stuff */
-
-#if defined(macintosh) && YARROW_DRIVER && TARGET_CPU_PPC
-# define mem_zero(p, n) BlockZero((p), (n))
-# define mem_copy(d, s, n) BlockMoveData((s), (d), (n))
-#else
# define mem_zero(p, n) memset((p), 0, (n))
# define mem_copy(d, s, n) memcpy((d), (s), (n))
-#endif
+
#if !defined(WIN32)
# define min(x, y) ((x) < (y) ? (x) : (y))
# define max(x, y) ((x) > (y) ? (x) : (y))
#endif
-/* end portability stuff */
+
#ifdef __cplusplus
}
#include <stddef.h>
#include <sys/types.h>
-#ifdef WIN32
-# include <winsock2.h>
-#endif
-
#define byte unsigned char
#define uint8 unsigned char
#define int8 signed char
-#define int16 signed short
-#define uint16 unsigned short
-
-#if (ULONG_MAX > 0xFFFFFFFFUL)
-# define int32 signed int
-# define uint32 unsigned int
-# define int64 signed long
-# define uint64 unsigned long
-#else
-# define int32 signed long
-# define uint32 unsigned long
-# if defined(__GNUC__)
-# define int64 signed long long
-# define uint64 unsigned long long
-# elif defined(__sgi)
-# define int64 __int64_t
-# define uint64 __uint64_t
-# elif defined(__MWERKS__)
-# define int64 signed long long
-# define uint64 unsigned long long
-# elif defined(WIN32)
-# define uint64 unsigned __int64
-# endif
-#endif
#if defined(uint64)
# define COUNTER uint64
#else
-# define COUNTER uint32
+# define COUNTER krb5_ui_4
#endif
#define COUNTER_MAX ((COUNTER)0 - 1)