00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef __LIBC_LIBC_H__
00011 #define __LIBC_LIBC_H__ 1
00012
00013
00014 #undef __linux__
00015 #undef __NetBSD__
00016 #undef __FreeBSD__
00017
00018 #ifdef __GNUC__
00019 #define __GNUC_PREREQ__(x, y) \
00020 ((__GNUC__ == (x) && __GNUC_MINOR__ >= (y)) || \
00021 (__GNUC__ > (x)))
00022 #else
00023 #define __GNUC_PREREQ__(x, y) 0
00024 #endif
00025
00026 #define NULL ((void*)0)
00027
00028 #define ABS(Number) (((Number) < 0)?-(Number):(Number))
00029 #define MAX(X,Y) (((X) > (Y))?(X):(Y))
00030 #define MIN(X,Y) (((X) < (Y))?(X):(Y))
00031
00032 #define ROUNDUP(X, Y) ((((X)+((Y)-1))/(Y))*(Y))
00033
00034 #define ARRAY_COUNT(Array) (sizeof (Array)/sizeof ((Array)[0]))
00035
00036 #define OFFSETOF(Type, Member) ((size_t)(unsigned long)(&((Type *)0)->Member))
00037
00038 #define NBBY 8
00039 #define HOWMANY(x, y) (((x) + ((y) - 1)) / (y))
00040
00041 #ifndef FALSE
00042 #define FALSE (1 == 0)
00043 #endif
00044
00045 #ifndef TRUE
00046 #define TRUE (1 == 1)
00047 #endif
00048
00049 typedef int (*t_printf_fn)(const char *fmt, ...);
00050
00051
00052
00053
00054
00055 #define LITTLE_ENDIAN 1234
00056 #define BIG_ENDIAN 4321
00057 #define PDP_ENDIAN 3412
00058
00059 #include <machdep/endian.h>
00060
00061
00062
00063
00064 #if BYTE_ORDER == LITTLE_ENDIAN
00065 #define _QUAD_HIGHWORD 1
00066 #define _QUAD_LOWWORD 0
00067 #endif
00068
00069 #if BYTE_ORDER == BIG_ENDIAN
00070 #define _QUAD_HIGHWORD 0
00071 #define _QUAD_LOWWORD 1
00072 #endif
00073
00074 #include <sysinterf/types.h>
00075 #include <sysinterf/signal.h>
00076
00077 #ifdef __LSEOS_RELEASE_SPECIFIC__
00078 struct s_tcb_full;
00079 struct s_as_full;
00080 #endif
00081 struct s_tcb_export;
00082 struct s_as_export;
00083 struct s_runqop;
00084 struct s_usig;
00085 struct s_core_info;
00086 struct s_ucred;
00087 struct s_memdef;
00088 struct s_procdef;
00089 struct rusage;
00090 struct rlimit;
00091
00092 #include <machdep/machdep.h>
00093
00094 #include <core.h>
00095
00096 #include <third-party/boot.h>
00097 #include <third-party/elf.h>
00098
00099 #include <sysinterf/sysinterf.h>
00100 #include <posix/posix.h>
00101 #include <conven/conven.h>
00102 #include <quad/quad.h>
00103 #include <estring/estring.h>
00104 #include <printf/printf.h>
00105 #include <stream/stream.h>
00106
00107 #endif