version 1.55.4.2, 2006/05/11 23:31:08 |
version 1.56, 2006/03/08 00:24:06 |
|
|
#define _LIB_LIBKERN_LIBKERN_H_ |
#define _LIB_LIBKERN_LIBKERN_H_ |
|
|
#include <sys/types.h> |
#include <sys/types.h> |
#include <sys/inttypes.h> |
|
#include <sys/null.h> |
#include <sys/null.h> |
|
|
#ifndef LIBKERN_INLINE |
#ifndef LIBKERN_INLINE |
|
|
} |
} |
#endif |
#endif |
|
|
/* |
/* nth bit, BIT(0) == 0x1. */ |
* Return the number of elements in a statically-allocated array, |
#define BIT(n) (((n) == 32) ? 0 : ((uint32_t)1 << (n))) |
* __x. |
|
*/ |
|
#define __arraycount(__x) (sizeof(__x) / sizeof(__x[0])) |
|
|
|
/* __BIT(n): nth bit, where __BIT(0) == 0x1. */ |
/* bits m through n, m < n. */ |
#define __BIT(__n) (((__n) == 32) ? 0 : ((uint32_t)1 << (__n))) |
#define BITS(m, n) ((BIT(MAX((m), (n)) + 1) - 1) ^ (BIT(MIN((m), (n))) - 1)) |
|
|
/* __BITS(m, n): bits m through n, m < n. */ |
|
#define __BITS(__m, __n) \ |
|
((__BIT(MAX((__m), (__n)) + 1) - 1) ^ (__BIT(MIN((__m), (__n))) - 1)) |
|
|
|
/* find least significant bit that is set */ |
/* find least significant bit that is set */ |
#define __LOWEST_SET_BIT(__mask) ((((__mask) - 1) & (__mask)) ^ (__mask)) |
#define _LOWEST_SET_BIT(__mask) ((((__mask) - 1) & (__mask)) ^ (__mask)) |
|
|
#define SHIFTOUT(__x, __mask) (((__x) & (__mask)) / __LOWEST_SET_BIT(__mask)) |
#define SHIFTOUT(__x, __mask) (((__x) & (__mask)) / _LOWEST_SET_BIT(__mask)) |
#define SHIFTIN(__x, __mask) ((__x) * __LOWEST_SET_BIT(__mask)) |
#define SHIFTIN(__x, __mask) ((__x) * _LOWEST_SET_BIT(__mask)) |
#define SHIFTOUT_MASK(__mask) SHIFTOUT((__mask), (__mask)) |
#define SHIFTOUT_MASK(__mask) SHIFTOUT((__mask), (__mask)) |
|
|
#ifdef NDEBUG /* tradition! */ |
#ifdef NDEBUG /* tradition! */ |
|
|
#endif |
#endif |
#endif |
#endif |
|
|
#ifdef __COVERITY__ |
|
#ifndef DIAGNOSTIC |
|
#define DIAGNOSTIC |
|
#endif |
|
#endif |
|
|
|
#ifndef DIAGNOSTIC |
#ifndef DIAGNOSTIC |
#define _DIAGASSERT(a) (void)0 |
#define _DIAGASSERT(a) (void)0 |
#ifdef lint |
#ifdef lint |
Line 303 int ffs __P((int)); |
|
Line 289 int ffs __P((int)); |
|
|
|
void __assert __P((const char *, const char *, int, const char *)) |
void __assert __P((const char *, const char *, int, const char *)) |
__attribute__((__noreturn__)); |
__attribute__((__noreturn__)); |
unsigned int |
|
bcdtobin __P((unsigned int)); |
|
unsigned int |
|
bintobcd __P((unsigned int)); |
|
u_int32_t |
u_int32_t |
inet_addr __P((const char *)); |
inet_addr __P((const char *)); |
struct in_addr; |
struct in_addr; |
Line 331 size_t strlcpy __P((char *, const char |
|
Line 313 size_t strlcpy __P((char *, const char |
|
size_t strlcat __P((char *, const char *, size_t)); |
size_t strlcat __P((char *, const char *, size_t)); |
int strncasecmp __P((const char *, const char *, size_t)); |
int strncasecmp __P((const char *, const char *, size_t)); |
u_long strtoul __P((const char *, char **, int)); |
u_long strtoul __P((const char *, char **, int)); |
uintmax_t strtoumax __P((const char *, char **, int)); |
|
#endif /* !_LIB_LIBKERN_LIBKERN_H_ */ |
#endif /* !_LIB_LIBKERN_LIBKERN_H_ */ |