* directory or online at http://www.openafs.org/dl/license10.html
*/
-#ifndef TRANSARC_AFS_CONFIG_STDS_H
-#define TRANSARC_AFS_CONFIG_STDS_H 1
+#ifndef OPENAFS_AFS_CONFIG_STDS_H
+#define OPENAFS_AFS_CONFIG_STDS_H 1
#include <afs/param.h>
#include <sys/types.h>
-#define IN /* indicates a parameter is read in */
-#define OUT /* indicates a parameter is sent out (a ptr) */
-#define INOUT /* indicates a parameter is read in and sent out (a ptr) */
+#define IN /* indicates a parameter is read in */
+#define OUT /* indicates a parameter is sent out (a ptr) */
+#define INOUT /* indicates a parameter is read in and sent out (a ptr) */
#ifndef MACRO_BEGIN
#define MACRO_BEGIN do {
pragma Off(Prototype_override_warnings);
#endif /* defined(__HIGHC__) */
#endif
-/*
- * This makes including the RCS id in object files less painful. Put this near
- * the beginning of .c files (not .h files). Do NOT follow it with a
- * semi-colon. The argument should be a double quoted string containing the
- * standard RCS Header keyword.
- */
/* Now some types to enhance portability. Always use these on the wire or when
* laying out shared structures on disk. */
#error We require size of long and pointers to be equal
#endif */
-typedef short afs_int16;
-typedef unsigned short afs_uint16;
+typedef short afs_int16;
+typedef unsigned short afs_uint16;
#ifdef AFS_64BIT_ENV
-typedef int afs_int32;
-typedef unsigned int afs_uint32;
-#else /* AFS_64BIT_ENV */
-typedef long afs_int32;
-typedef unsigned long afs_uint32;
-#endif /* AFS_64BIT_ENV */
+typedef int afs_int32;
+typedef unsigned int afs_uint32;
+#if defined(AFS_NT40_ENV) && defined(_MSC_VER)
+typedef __int64 afs_int64;
+typedef unsigned __int64 afs_uint64;
+#else
+typedef long long afs_int64;
+typedef unsigned long long afs_uint64;
+#endif
+#define ZeroInt64(a) (a) = 0
+#define AssignInt64(a, b) *(a) = (b)
+#define AddInt64(a,b,c) *(c) = (afs_int64)(a) + (afs_int64)(b)
+#define AddUInt64(a,b,c) *(c) = (afs_uint64)(a) + (afs_uint64)(b)
+#define SubtractInt64(a,b,c) *(c) = (afs_int64)(a) - (afs_int64)(b)
+#define SubtractUInt64(a,b,c) *(c) = (afs_uint64)(a) - (afs_uint64)(b)
+#define CompareInt64(a,b) (afs_int64)(a) - (afs_int64)(b)
+#define CompareUInt64(a,b) (afs_uint64)(a) - (afs_uint64)(b)
+#define NonZeroInt64(a) (a)
+#define Int64ToInt32(a) (a) & 0xFFFFFFFFL
+#define FillInt64(t,h,l) (t) = (h); (t) <<= 32; (t) |= (l);
+#define SplitInt64(t,h,l) (h) = (t) >> 32; (l) = (t) & 0xFFFFFFFF;
+#else /* AFS_64BIT_ENV */
+typedef long afs_int32;
+typedef unsigned long afs_uint32;
+
+struct Int64 {
+ afs_int32 high;
+ afs_uint32 low;
+};
+typedef struct Int64 afs_int64;
+
+struct u_Int64 {
+ afs_uint32 high;
+ afs_uint32 low;
+};
+typedef struct u_Int64 afs_uint64;
+#define ZeroInt64(a) (a).high = (a).low = 0
+#define AssignInt64(a, b) (b)->high = (a).high; (b)->low = (a).low
+#define CompareInt64(a,b) (((afs_int32)(a).high - (afs_int32)(b).high) || (((a).high == (b).high) && ((a).low - (b).low)))
+#define AddInt64(a, b, c) { afs_int64 _a, _b; _a = a; _b = b; (c)->low = _a.low + _b.low; (c)->high = _a.high + _b.high + ((c)->low < _b.low); }
+#define SubtractInt64(a, b, c) { afs_int64 _a, _b; _a = a; _b = b; (c)->low = _a.low - _b.low; (c)->high = _a.high - _b.high - (_a.low < _b.low); }
+#define CompareUInt64(a,b) (((afs_uint32)(a).high - (afs_uint32)(b).high) || (((a).high == (b).high) && ((a).low - (b).low)))
+#define AddUInt64(a, b, c) { afs_uint64 _a, _b; _a = a; _b = b; (c)->low = _a.low + _b.low; (c)->high = _a.high + _b.high + ((c)->low < _b.low); }
+#define SubtractUInt64(a, b, c) { afs_uint64 _a, _b; _a = a; _b = b; (c)->low = _a.low - _b.low; (c)->high = _a.high - _b.high - (_a.low < _b.low); }
+#define NonZeroInt64(a) (a).low || (a).high
+#define Int64ToInt32(a) (a).low
+#define FillInt64(t,h,l) (t).high = (h); (t).low = (l);
+#define SplitInt64(t,h,l) (h) = (t).high; (l) = (t).low;
+#endif /* AFS_64BIT_ENV */
+
+/* AFS_64BIT_CLIENT should presently be set only for AFS_64BIT_ENV systems */
+
+#ifdef AFS_64BIT_CLIENT
+typedef afs_int64 afs_size_t;
+typedef afs_uint64 afs_offs_t;
+#else /* AFS_64BIT_CLIENT */
+typedef afs_int32 afs_size_t;
+typedef afs_uint32 afs_offs_t;
+#endif /* AFS_64BIT_CLIENT */
+
+#ifdef AFS_LARGEFILE_ENV
+typedef afs_int64 afs_foff_t;
+typedef afs_uint64 afs_fsize_t;
+typedef afs_int64 afs_sfsize_t;
+#define SplitOffsetOrSize(t,h,l) SplitInt64(t,h,l)
+#else /* !AFS_LARGEFILE_ENV */
+typedef afs_int32 afs_foff_t;
+typedef afs_uint32 afs_fsize_t;
+typedef afs_int32 afs_sfsize_t;
+#define SplitOffsetOrSize(t,h,l) (h) = 0; (l) = (t);
+#endif /* !AFS_LARGEFILE_ENV */
+
+/* Maximum integer sizes. Also what is expected by %lld, %llu in
+ * afs_snprintf. */
+#ifdef AFS_64BIT_CLIENT
+typedef afs_int64 afs_intmax_t;
+typedef afs_uint64 afs_uintmax_t;
+#else /* !AFS_64BIT_CLIENT */
+typedef afs_int32 afs_intmax_t;
+typedef afs_uint32 afs_uintmax_t;
+#endif /* !AFS_64BIT_CLIENT */
/* you still have to include <netinet/in.h> to make these work */
#if defined(AFS_64BIT_ENV) && 0
-typedef unsigned long afs_hyper_t;
+typedef unsigned long afs_hyper_t;
#define hcmp(a,b) ((a) < (b) ? -1 : ((a) > (b) ? 1 : 0))
#define hsame(a,b) ((a) == (b))
#define hadd32(a,b) ((a) += (b))
#define hshlft(a,n) ((a)<<(n))
-#else /* AFS_64BIT_ENV */
+#else /* AFS_64BIT_ENV */
-typedef struct afs_hyper_t { /* unsigned 64 bit integers */
+typedef struct afs_hyper_t { /* unsigned 64 bit integers */
unsigned int high;
unsigned int low;
} afs_hyper_t;
(a).low += (int)(i))
#define hadd(a,b) (hadd32(a,(b).low), (a).high += (b).high)
-#endif /* AFS_64BIT_ENV */
+#endif /* AFS_64BIT_ENV */
#ifndef KERNEL
#ifndef AFS_NT40_ENV
/*#define abs(x) ((x) >= 0 ? (x) : -(x))*/
#endif
-#if defined(AFS_LINUX20_ENV) && defined(KERNEL)
-/* This is here instead of osi_machdep.h so fcrypt.c can pick it up. */
-#include "../h/string.h"
-#define bcopy(F,T,C) memcpy((T), (F), (C))
-#endif
-
-
/* minumum length of string to pass to int_to_base64 */
typedef char b64_string_t[8];
+#ifndef AFS_NT40_ENV
#if defined(AFS_HPUX_ENV) || defined(AFS_USR_HPUX_ENV) || (defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV))
char *int_to_base64();
int base64_to_int();
char *int_to_base64(b64_string_t s, int a);
int base64_to_int(char *s);
#endif
-
+#endif /* AFS_NT40_ENV */
/*
* The afsUUID data type is built in to RX
*/
char node[6];
};
typedef struct afsUUID afsUUID;
-extern int xdr_afsUUID();
-#endif /* TRANSARC_CONFIG_AFS_STDS_H */
+#endif /* OPENAFS_CONFIG_AFS_STDS_H */