Add OpenAFS build machinery for libhcrypto
[openafs.git] / src / crypto / hcrypto / roken.h
1 #define rk_UNCONST(x) ((void *)(uintptr_t)(const void *)(x))
2
3 #ifndef min
4 #define min(a,b) (((a)<(b))?(a):(b))
5 #endif
6
7 #ifndef ROKEN_LIB_FUNCTION
8 #ifdef _WIN32
9 #define ROKEN_LIB_FUNCTION
10 #define ROKEN_LIB_CALL     __cdecl
11 #else
12 #define ROKEN_LIB_FUNCTION
13 #define ROKEN_LIB_CALL
14 #endif
15 #endif
16
17 typedef int rk_socket_t;
18
19 ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
20     ct_memcmp(const void *, const void *, size_t);
21
22 ROKEN_LIB_FUNCTION void ROKEN_LIB_CALL rk_cloexec(int);
23
24 ROKEN_LIB_FUNCTION void ROKEN_LIB_CALL rk_cloexec_file(FILE *);
25
26 ROKEN_LIB_FUNCTION ssize_t ROKEN_LIB_CALL
27     net_write (rk_socket_t, const void *, size_t);
28
29 ROKEN_LIB_FUNCTION ssize_t ROKEN_LIB_CALL
30     net_read (rk_socket_t, void *, size_t);
31
32 ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL issuid(void);
33
34 #ifndef HAVE_STRLCPY
35 #define strlcpy rk_strlcpy
36 ROKEN_LIB_FUNCTION size_t ROKEN_LIB_CALL
37     strlcpy (char *, const char *, size_t);
38 #endif
39
40 /* This is a bodge, but it's only used by the tests */
41 #define emalloc(x) malloc(x)