* Introduced new header directory "config", which ATM contains HaikuConfig.h

and types.h. The idea is to provide a basic architecture/compiler
  abstraction by defining types and macros that allow the posix/ and os/
  headers to be mostly architecture/compiler agnostic. 
* Adjusted the posix/ and os/ headers accordingly.
* <SupportDefs.h>: Introduced B_PRI* and B_SCN* macros similar to the PRI*
  and SCN* macros defined in <inttypes.h>, just for the BeOS/Haiku [u]int*
  types and some POSIX types (e.g. off_t, dev_t, ino_t) that don't have POSIX
  macros. Also the B_PRI* and B_SCN* macros are available unconditionally,
  unlike the <inttypes.h> macros, which require __STDC_FORMAT_MACROS to be
  defined in C++ mode.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34214 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2009-11-24 19:44:07 +00:00
parent b5504a512c
commit 2222d0559d
27 changed files with 674 additions and 269 deletions
+4 -3
View File
@@ -413,6 +413,7 @@ if [ IsOptionalHaikuImagePackageAdded DevelopmentMin ] && $(TARGET_ARCH) = x86 {
AddFilesToHaikuImage develop etc : $(makefileEngineFiles) ; AddFilesToHaikuImage develop etc : $(makefileEngineFiles) ;
# headers # headers
AddHeaderDirectoryToHaikuImage config ;
AddHeaderDirectoryToHaikuImage glibc ; AddHeaderDirectoryToHaikuImage glibc ;
AddHeaderDirectoryToHaikuImage os ; AddHeaderDirectoryToHaikuImage os ;
AddHeaderDirectoryToHaikuImage posix ; AddHeaderDirectoryToHaikuImage posix ;
@@ -465,15 +466,15 @@ if [ IsOptionalHaikuImagePackageAdded Firefox ] {
InstallOptionalHaikuImagePackage InstallOptionalHaikuImagePackage
BeZillaBrowser-2.0.0.22pre-x86-gcc4-2009-09-28 BeZillaBrowser-2.0.0.22pre-x86-gcc4-2009-09-28
: $(baseURL)/BeZillaBrowser-2.0.0.22pre-x86-gcc4-2009-09-28.zip : $(baseURL)/BeZillaBrowser-2.0.0.22pre-x86-gcc4-2009-09-28.zip
: :
; ;
AddSymlinkToHaikuImage home config be Applications AddSymlinkToHaikuImage home config be Applications
: /boot/apps/BeZillaBrowser/BeZillaBrowser ; : /boot/apps/BeZillaBrowser/BeZillaBrowser ;
} else { } else {
InstallOptionalHaikuImagePackage InstallOptionalHaikuImagePackage
BeZillaBrowser-2.0.0.22pre-x86-gcc2-2009-09-27 BeZillaBrowser-2.0.0.22pre-x86-gcc2-2009-09-27
: $(baseURL)/BeZillaBrowser-2.0.0.22pre-x86-gcc2-2009-09-27.zip : $(baseURL)/BeZillaBrowser-2.0.0.22pre-x86-gcc2-2009-09-27.zip
: :
; ;
AddSymlinkToHaikuImage home config be Applications AddSymlinkToHaikuImage home config be Applications
: /boot/apps/BeZillaBrowser/BeZillaBrowser ; : /boot/apps/BeZillaBrowser/BeZillaBrowser ;
+1
View File
@@ -88,6 +88,7 @@ copy_headers()
done done
} }
copy_headers $haikuSourceDir/headers/config $tmpIncludeDir/config
copy_headers $haikuSourceDir/headers/os $tmpIncludeDir/os copy_headers $haikuSourceDir/headers/os $tmpIncludeDir/os
copy_headers $haikuSourceDir/headers/posix $tmpIncludeDir/posix copy_headers $haikuSourceDir/headers/posix $tmpIncludeDir/posix
+1
View File
@@ -126,6 +126,7 @@ copy_headers()
done done
} }
copy_headers $haikuSourceDir/headers/config $tmpIncludeDir/config
copy_headers $haikuSourceDir/headers/os $tmpIncludeDir/os copy_headers $haikuSourceDir/headers/os $tmpIncludeDir/os
copy_headers $haikuSourceDir/headers/posix $tmpIncludeDir/posix copy_headers $haikuSourceDir/headers/posix $tmpIncludeDir/posix
+70
View File
@@ -0,0 +1,70 @@
/*
* Copyright 2009, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _CONFIG_HAIKU_CONFIG_H
#define _CONFIG_HAIKU_CONFIG_H
/* Determine the architecture and define macros for some fundamental
properties:
__HAIKU_ARCH - short name of the architecture (used in paths)
__HAIKU_ARCH_<arch> - defined to 1 for the respective architecture
__HAIKU_ARCH_64_BIT - defined to 1 on 64 bit architectures
__HAIKU_BIG_ENDIAN - defined to 1 on big endian architectures
*/
#ifdef __INTEL__
# ifdef __x86_64__
# define __HAIKU_ARCH x86_64
# define __HAIKU_ARCH_X86_64 1
# define __HAIKU_ARCH_64_BIT 1
# else
# define __HAIKU_ARCH x86
# define __HAIKU_ARCH_X86 1
# endif
#elif __POWERPC__
# define __HAIKU_ARCH ppc
# define __HAIKU_ARCH_PPC 1
# define __HAIKU_BIG_ENDIAN 1
#elif __M68K__
# define __HAIKU_ARCH m68k 1
# define __HAIKU_ARCH_M68K 1
# define __HAIKU_BIG_ENDIAN 1
#elif __MIPSEL__
# define __HAIKU_ARCH mipsel
# define __HAIKU_ARCH_MIPSEL 1
#elif __ARM__
# define __HAIKU_ARCH arm
# define __HAIKU_ARCH_ARM 1
#else
# error Unsupported architecture!
#endif
/* implied properties */
#ifndef __HAIKU_ARCH_64_BIT
# define __HAIKU_ARCH_32_BIT 1
#endif
#ifndef __HAIKU_BIG_ENDIAN
# define __HAIKU_LITTLE_ENDIAN 1
#endif
/* architecture specific include macros */
#define __HAIKU_ARCH_HEADER(header) <arch/__HAIKU_ARCH/header>
#define __HAIKU_SUBDIR_ARCH_HEADER(subdir, header) \
<subdir/arch/__HAIKU_ARCH/header>
/* BeOS R5 binary compatibility (gcc 2 on x86) */
#if defined(__HAIKU_ARCH_X86) && __GNUC__ == 2
# define __HAIKU_BEOS_COMPATIBLE 1
#endif
/* BeOS R5 compatible types */
#ifdef __HAIKU_ARCH_X86
/* TODO: This should be "#ifdef __HAIKU_BEOS_COMPATIBLE", but this will
break all gcc 4 C++ optional packages. I.e. switch that at a suitable
time.
*/
# define __HAIKU_BEOS_COMPATIBLE_TYPES 1
#endif
#endif /* _CONFIG_HAIKU_CONFIG_H */
+78
View File
@@ -0,0 +1,78 @@
/*
* Copyright 2009, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _CONFIG_TYPES_H
#define _CONFIG_TYPES_H
#include <config/HaikuConfig.h>
/* fixed-width types -- the __haiku_std_[u]int* types correspond to the POSIX
[u]int*_t types, the _haiku_[u]int* types to the BeOS [u]int* types. If
__HAIKU_BEOS_COMPATIBLE_TYPES is not defined both sets are identical. Once
we drop compatibility for good, we can consolidate the types.
*/
typedef signed char __haiku_std_int8;
typedef unsigned char __haiku_std_uint8;
typedef signed short __haiku_std_int16;
typedef unsigned short __haiku_std_uint16;
typedef signed int __haiku_std_int32;
typedef unsigned int __haiku_std_uint32;
typedef signed long long __haiku_std_int64;
typedef unsigned long long __haiku_std_uint64;
typedef __haiku_std_int8 __haiku_int8;
typedef __haiku_std_uint8 __haiku_uint8;
typedef __haiku_std_int16 __haiku_int16;
typedef __haiku_std_uint16 __haiku_uint16;
#ifdef __HAIKU_BEOS_COMPATIBLE_TYPES
typedef signed long int __haiku_int32;
typedef unsigned long int __haiku_uint32;
#else
typedef __haiku_std_int32 __haiku_int32;
typedef __haiku_std_uint32 __haiku_uint32;
#endif
typedef __haiku_std_int64 __haiku_int64;
typedef __haiku_std_uint64 __haiku_uint64;
/* address types */
#ifdef __HAIKU_ARCH_64_BIT
typedef __haiku_int64 __haiku_saddr_t;
typedef __haiku_uint64 __haiku_addr_t;
#else
typedef __haiku_int32 __haiku_saddr_t;
typedef __haiku_uint32 __haiku_addr_t;
#endif
/* address type limits */
#ifdef __HAIKU_ARCH_64_BIT
# define __HAIKU_SADDR_MAX (9223372036854775807LL)
# define __HAIKU_ADDR_MAX (18446744073709551615ULL)
#else
# define __HAIKU_SADDR_MAX (2147483647)
# define __HAIKU_ADDR_MAX (4294967295U)
#endif
#define __HAIKU_SADDR_MIN (-__HAIKU_SADDR_MIN-1)
/* printf()/scanf() format prefixes */
#define __HAIKU_STD_PRI_PREFIX_32 ""
#define __HAIKU_STD_PRI_PREFIX_64 "ll"
#ifdef __HAIKU_BEOS_COMPATIBLE_TYPES
# define __HAIKU_PRI_PREFIX_32 "l"
#else
# define __HAIKU_PRI_PREFIX_32 __HAIKU_STD_PRI_PREFIX_32
#endif
#define __HAIKU_PRI_PREFIX_64 __HAIKU_STD_PRI_PREFIX_64
#ifdef __HAIKU_ARCH_64_BIT
# define __HAIKU_PRI_PREFIX_ADDR __HAIKU_STD_PRI_PREFIX_64
#else
# define __HAIKU_PRI_PREFIX_ADDR __HAIKU_STD_PRI_PREFIX_32
#endif
#endif /* _CONFIG_TYPES_H */
+15 -13
View File
@@ -38,6 +38,10 @@
// NOTE : This does NOT conform to the draft standard and is likely to change // NOTE : This does NOT conform to the draft standard and is likely to change
#include <alloc.h> #include <alloc.h>
#ifdef __HAIKU__
# include <config/types.h>
#endif
extern "C++" { extern "C++" {
class istream; class ostream; class istream; class ostream;
@@ -61,12 +65,10 @@ extern void __length_error (const char *);
#endif #endif
#if (defined(__BEOS__) || defined(__HAIKU__)) #ifdef __HAIKU__
// Needed for atomic_add(): extern "C" __haiku_int32 atomic_add(volatile __haiku_int32* value,
typedef long int32; __haiku_int32 addvalue);
typedef volatile long vint32; #endif /* __HAIKU__ */
extern "C" int32 atomic_add(vint32* value, int32 addvalue);
#endif /* __BEOS__ */
template <class charT, class traits = string_char_traits<charT>, template <class charT, class traits = string_char_traits<charT>,
class Allocator = alloc > class Allocator = alloc >
@@ -79,9 +81,9 @@ private:
charT* data () { return reinterpret_cast<charT *>(this + 1); } charT* data () { return reinterpret_cast<charT *>(this + 1); }
charT& operator[] (size_t s) { return data () [s]; } charT& operator[] (size_t s) { return data () [s]; }
#if (defined(__BEOS__) || defined(__HAIKU__)) #ifdef __HAIKU__
charT* grab () { if (selfish) return clone (); atomic_add((vint32*) &ref, 1); return data (); } charT* grab () { if (selfish) return clone (); atomic_add((volatile __haiku_int32*) &ref, 1); return data (); }
void release() { if (atomic_add((int32*) &ref, -1) == 1) delete this; } void release() { if (atomic_add((__haiku_int32*) &ref, -1) == 1) delete this; }
#else #else
charT* grab () { if (selfish) return clone (); ++ref; return data (); } charT* grab () { if (selfish) return clone (); ++ref; return data (); }
#if defined __i486__ || defined __i586__ || defined __i686__ #if defined __i486__ || defined __i586__ || defined __i686__
@@ -89,8 +91,8 @@ private:
{ {
size_t __val; size_t __val;
// This opcode exists as a .byte instead of as a mnemonic for the // This opcode exists as a .byte instead of as a mnemonic for the
// benefit of SCO OpenServer 5. The system assembler (which is // benefit of SCO OpenServer 5. The system assembler (which is
// essentially required on this target) can't assemble xaddl in // essentially required on this target) can't assemble xaddl in
//COFF mode. //COFF mode.
asm (".byte 0xf0, 0x0f, 0xc1, 0x02" // lock; xaddl %eax, (%edx) asm (".byte 0xf0, 0x0f, 0xc1, 0x02" // lock; xaddl %eax, (%edx)
: "=a" (__val) : "=a" (__val)
@@ -119,7 +121,7 @@ private:
#else #else
void release () { if (--ref == 0) delete this; } void release () { if (--ref == 0) delete this; }
#endif #endif
#endif /* __BEOS__ */ #endif /* __HAIKU__ */
inline static void * operator new (size_t, size_t); inline static void * operator new (size_t, size_t);
inline static void operator delete (void *); inline static void operator delete (void *);
inline static Rep* create (size_t); inline static Rep* create (size_t);
@@ -221,7 +223,7 @@ public:
void push_back(charT __c) void push_back(charT __c)
{ append(1, __c); } { append(1, __c); }
basic_string& assign (const basic_string& str, size_type pos = 0, basic_string& assign (const basic_string& str, size_type pos = 0,
size_type n = npos) size_type n = npos)
{ return replace (0, npos, str, pos, n); } { return replace (0, npos, str, pos, n); }
+12
View File
@@ -6,6 +6,9 @@
#define _BE_BUILD_H #define _BE_BUILD_H
#include <config/HaikuConfig.h>
#define B_BEOS_VERSION_4 0x0400 #define B_BEOS_VERSION_4 0x0400
#define B_BEOS_VERSION_4_5 0x0450 #define B_BEOS_VERSION_4_5 0x0450
#define B_BEOS_VERSION_5 0x0500 #define B_BEOS_VERSION_5 0x0500
@@ -41,6 +44,15 @@
#endif #endif
#ifdef __HAIKU_ARCH_64_BIT
# define B_HAIKU_64_BIT 1
#endif
#ifdef __HAIKU_BEOS_COMPATIBLE
# define B_HAIKU_BEOS_COMPATIBLE 1
#endif
#define _UNUSED(argument) argument #define _UNUSED(argument) argument
#define _PACKED __attribute__((packed)) #define _PACKED __attribute__((packed))
#define _PRINTFLIKE(_format_, _args_) \ #define _PRINTFLIKE(_format_, _args_) \
+13 -12
View File
@@ -6,9 +6,9 @@
* Definitions for the SCSI Common Access Method as implemented in Haiku. * Definitions for the SCSI Common Access Method as implemented in Haiku.
* *
* See also "Draft Proposed American National Standard, SCSI-2 Common * See also "Draft Proposed American National Standard, SCSI-2 Common
* Access Method Transport and SCSI Interface Module", Revision 12, * Access Method Transport and SCSI Interface Module", Revision 12,
* ANSI refernce number X3.232-199x. * ANSI refernce number X3.232-199x.
* *
*/ */
#ifndef _CAM_H #ifndef _CAM_H
@@ -18,20 +18,21 @@
#include <sys/types.h> #include <sys/types.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#ifndef U32 #ifndef U32
typedef unsigned long U32; typedef uint32 U32;
#endif #endif
#ifndef I32 #ifndef I32
typedef long I32; typedef int32 I32;
#endif #endif
#ifndef U16 #ifndef U16
typedef unsigned short U16; typedef uint16 U16;
#endif #endif
/* Haiku specific additions */ /* Haiku specific additions */
@@ -43,7 +44,7 @@ typedef struct {
uchar path; /* target SIM ID */ uchar path; /* target SIM ID */
uchar target; /* target device ID */ uchar target; /* target device ID */
uchar sgcount; /* # of sg segments (0 if non-sg operation) */ uchar sgcount; /* # of sg segments (0 if non-sg operation) */
uchar scsi_op; /* scsi operation byte */ uchar scsi_op; /* scsi operation byte */
} cam_iostat; } cam_iostat;
/* End of Haiku specific additions */ /* End of Haiku specific additions */
@@ -89,7 +90,7 @@ typedef struct {
#define HBA_ID 16 /* ASCII string len for HBA ID */ #define HBA_ID 16 /* ASCII string len for HBA ID */
#define BE_SIM_CCB_SIZE 1536 /* we want to allocate 1.5k chunks */ #define BE_SIM_CCB_SIZE 1536 /* we want to allocate 1.5k chunks */
#define BE_SIM_SCSIIO_SIZE 88 /* sizeof(CAM_CCB_SCSIIO) - SIM_PRIV */ #define BE_SIM_SCSIIO_SIZE 88 /* sizeof(CAM_CCB_SCSIIO) - SIM_PRIV */
#define SIM_PRIV (BE_SIM_CCB_SIZE - BE_SIM_SCSIIO_SIZE) /* Length of SIM private data area */ #define SIM_PRIV (BE_SIM_CCB_SIZE - BE_SIM_SCSIIO_SIZE) /* Length of SIM private data area */
/* SIM_PRIV (sim private data area) Terms and Conditions: /* SIM_PRIV (sim private data area) Terms and Conditions:
@@ -97,7 +98,7 @@ typedef struct {
- the size of SIM_PRIV shall be such that sizeof(CCB_SIZE_UNION) = 1.5k - the size of SIM_PRIV shall be such that sizeof(CCB_SIZE_UNION) = 1.5k
- all CCB's shall be allocated from locked, contiguous memory - all CCB's shall be allocated from locked, contiguous memory
- CCB's shall be aligned on 512 byte boundaries - CCB's shall be aligned on 512 byte boundaries
- SIM_PRIV will be >= 1408 bytes - SIM_PRIV will be >= 1408 bytes
- this provides 128 8byte sg entries (512mb worth of pages, worstcase fragmentation) - this provides 128 8byte sg entries (512mb worth of pages, worstcase fragmentation)
- and 256 bytes for sense data and 128 bytes for whatever else the SIM needs - and 256 bytes for sense data and 128 bytes for whatever else the SIM needs
@@ -116,7 +117,7 @@ typedef struct ccb_header
uint16 cam_ccb_len; /* Length of the entire CCB */ uint16 cam_ccb_len; /* Length of the entire CCB */
uchar cam_func_code; /* XPT function code */ uchar cam_func_code; /* XPT function code */
uchar cam_status; /* Returned CAM subsystem status */ uchar cam_status; /* Returned CAM subsystem status */
uchar cam_hrsvd0; /* Reserved field, for alignment */ uchar cam_hrsvd0; /* Reserved field, for alignment */
uchar cam_path_id; /* Path ID for the request */ uchar cam_path_id; /* Path ID for the request */
uchar cam_target_id; /* Target device ID */ uchar cam_target_id; /* Target device ID */
uchar cam_target_lun; /* Target LUN number */ uchar cam_target_lun; /* Target LUN number */
@@ -174,7 +175,7 @@ typedef struct ccb_scsiio
uchar* cam_pdrv_ptr; /* Ptr used by the Peripheral driver */ uchar* cam_pdrv_ptr; /* Ptr used by the Peripheral driver */
CCB_HEADER* cam_next_ccb; /* Ptr to the next CCB for action */ CCB_HEADER* cam_next_ccb; /* Ptr to the next CCB for action */
uchar* cam_req_map; /* Ptr for mapping info on the Req. */ uchar* cam_req_map; /* Ptr for mapping info on the Req. */
void (*cam_cbfcnp)(struct ccb_scsiio*); void (*cam_cbfcnp)(struct ccb_scsiio*);
/* Callback on completion function */ /* Callback on completion function */
uchar* cam_data_ptr; /* Pointer to the data buf/SG list */ uchar* cam_data_ptr; /* Pointer to the data buf/SG list */
uint32 cam_dxfer_len; /* Data xfer length */ uint32 cam_dxfer_len; /* Data xfer length */
@@ -642,7 +643,7 @@ enum {
typedef struct cam_for_driver_module_info cam_for_driver_module_info; typedef struct cam_for_driver_module_info cam_for_driver_module_info;
struct cam_for_driver_module_info { struct cam_for_driver_module_info {
bus_manager_info minfo; bus_manager_info minfo;
CCB_HEADER* (*xpt_ccb_alloc)(void); CCB_HEADER* (*xpt_ccb_alloc)(void);
void (*xpt_ccb_free)(void* ccb); void (*xpt_ccb_free)(void* ccb);
long (*xpt_action)(CCB_HEADER* ccbh); long (*xpt_action)(CCB_HEADER* ccbh);
@@ -657,7 +658,7 @@ struct cam_for_driver_module_info {
typedef struct cam_for_sim_module_info cam_for_sim_module_info; typedef struct cam_for_sim_module_info cam_for_sim_module_info;
struct cam_for_sim_module_info { struct cam_for_sim_module_info {
bus_manager_info minfo; bus_manager_info minfo;
long (*xpt_bus_register)(CAM_SIM_ENTRY* sim); long (*xpt_bus_register)(CAM_SIM_ENTRY* sim);
long (*xpt_bus_deregister)(long path); long (*xpt_bus_deregister)(long path);
}; };
+98 -34
View File
@@ -1,5 +1,5 @@
/* /*
* Copyright 2004-2007, Haiku, Inc. All Rights Reserved. * Copyright 2004-2009, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Author: * Author:
@@ -9,39 +9,32 @@
#define _SUPPORT_DEFS_H #define _SUPPORT_DEFS_H
/* this must be located before the include of sys/types.h */
#if !defined(_SYS_TYPES_H) && !defined(_SYS_TYPES_H_)
typedef unsigned long ulong;
typedef unsigned int uint;
typedef unsigned short ushort;
#endif
#include <BeBuild.h> #include <BeBuild.h>
#include <Errors.h> #include <Errors.h>
#include <inttypes.h>
#include <sys/types.h> #include <sys/types.h>
/* Shorthand type formats */ /* fixed-size integer types */
typedef signed char int8; typedef __haiku_int8 int8;
typedef unsigned char uint8; typedef __haiku_uint8 uint8;
typedef volatile signed char vint8; typedef __haiku_int16 int16;
typedef volatile unsigned char vuint8; typedef __haiku_uint16 uint16;
typedef __haiku_int32 int32;
typedef __haiku_uint32 uint32;
typedef __haiku_int64 int64;
typedef __haiku_uint64 uint64;
typedef short int16; /* shorthand types */
typedef unsigned short uint16; typedef volatile int8 vint8;
typedef volatile short vint16; typedef volatile uint8 vuint8;
typedef volatile unsigned short vuint16; typedef volatile int16 vint16;
typedef volatile uint16 vuint16;
typedef long int32; typedef volatile int32 vint32;
typedef unsigned long uint32; typedef volatile uint32 vuint32;
typedef volatile long vint32; typedef volatile int64 vint64;
typedef volatile unsigned long vuint32; typedef volatile uint64 vuint64;
typedef long long int64;
typedef unsigned long long uint64;
typedef volatile long long vint64;
typedef volatile unsigned long long vuint64;
typedef volatile long vlong; typedef volatile long vlong;
typedef volatile int vint; typedef volatile int vint;
@@ -56,14 +49,85 @@ typedef volatile unsigned char vuchar;
typedef unsigned char uchar; typedef unsigned char uchar;
typedef unsigned short unichar; typedef unsigned short unichar;
/* descriptive types */
/* Descriptive formats */
typedef int32 status_t; typedef int32 status_t;
typedef int64 bigtime_t; typedef int64 bigtime_t;
typedef uint32 type_code; typedef uint32 type_code;
typedef uint32 perform_code; typedef uint32 perform_code;
/* printf()/scanf() format strings for [u]int* types */
# define B_PRId8 "d"
# define B_PRIi8 "i"
# define B_PRId16 "d"
# define B_PRIi16 "i"
# define B_PRId32 __HAIKU_PRI_PREFIX_32 "d"
# define B_PRIi32 __HAIKU_PRI_PREFIX_32 "i"
# define B_PRId64 __HAIKU_PRI_PREFIX_64 "d"
# define B_PRIi64 __HAIKU_PRI_PREFIX_64 "i"
# define B_PRIu8 "u"
# define B_PRIo8 "o"
# define B_PRIx8 "x"
# define B_PRIX8 "X"
# define B_PRIu16 "u"
# define B_PRIo16 "o"
# define B_PRIx16 "x"
# define B_PRIX16 "X"
# define B_PRIu32 __HAIKU_PRI_PREFIX_32 "u"
# define B_PRIo32 __HAIKU_PRI_PREFIX_32 "o"
# define B_PRIx32 __HAIKU_PRI_PREFIX_32 "x"
# define B_PRIX32 __HAIKU_PRI_PREFIX_32 "X"
# define B_PRIu64 __HAIKU_PRI_PREFIX_64 "u"
# define B_PRIo64 __HAIKU_PRI_PREFIX_64 "o"
# define B_PRIx64 __HAIKU_PRI_PREFIX_64 "x"
# define B_PRIX64 __HAIKU_PRI_PREFIX_64 "X"
# define B_SCNd8 "hhd"
# define B_SCNi8 "hhi"
# define B_SCNd16 "hd"
# define B_SCNi16 "hi"
# define B_SCNd32 __HAIKU_PRI_PREFIX_32 "d"
# define B_SCNi32 __HAIKU_PRI_PREFIX_32 "i"
# define B_SCNd64 __HAIKU_PRI_PREFIX_64 "d"
# define B_SCNi64 __HAIKU_PRI_PREFIX_64 "i"
# define B_SCNu8 "hhu"
# define B_SCNo8 "hho"
# define B_SCNx8 "hhx"
# define B_SCNu16 "hu"
# define B_SCNo16 "ho"
# define B_SCNx16 "hx"
# define B_SCNu32 __HAIKU_PRI_PREFIX_32 "u"
# define B_SCNo32 __HAIKU_PRI_PREFIX_32 "o"
# define B_SCNx32 __HAIKU_PRI_PREFIX_32 "x"
# define B_SCNu64 __HAIKU_PRI_PREFIX_64 "u"
# define B_SCNo64 __HAIKU_PRI_PREFIX_64 "o"
# define B_SCNx64 __HAIKU_PRI_PREFIX_64 "x"
/* printf() format strings for some standard types */
/* size_t */
#define B_PRIuSIZE __HAIKU_PRI_PREFIX_ADDR "u"
#define B_PRIoSIZE __HAIKU_PRI_PREFIX_ADDR "o"
#define B_PRIxSIZE __HAIKU_PRI_PREFIX_ADDR "x"
#define B_PRIXSIZE __HAIKU_PRI_PREFIX_ADDR "X"
/* ssize_t */
#define B_PRIdSSIZE __HAIKU_PRI_PREFIX_ADDR "d"
#define B_PRIiSSIZE __HAIKU_PRI_PREFIX_ADDR "i"
/* addr_t */
#define B_PRIuADDR __HAIKU_PRI_PREFIX_ADDR "u"
#define B_PRIoADDR __HAIKU_PRI_PREFIX_ADDR "o"
#define B_PRIxADDR __HAIKU_PRI_PREFIX_ADDR "x"
#define B_PRIXADDR __HAIKU_PRI_PREFIX_ADDR "X"
/* off_t */
#define B_PRIdOFF B_PRId64
#define B_PRIiOFF B_PRIi64
/* dev_t */
#define B_PRIdDEV B_PRId32
#define B_PRIiDEV B_PRIi32
/* ino_t */
#define B_PRIdINO B_PRId64
#define B_PRIiINO B_PRIi64
/* Empty string ("") */ /* Empty string ("") */
#ifdef __cplusplus #ifdef __cplusplus
extern const char *B_EMPTY_STRING; extern const char *B_EMPTY_STRING;
@@ -78,9 +142,9 @@ extern const char *B_EMPTY_STRING;
# ifndef max # ifndef max
# define max(a,b) ((a)>(b)?(a):(b)) # define max(a,b) ((a)>(b)?(a):(b))
# endif # endif
#endif #endif
/* min() and max() won't work in C++ */ /* min() and max() are functions in C++ */
#define min_c(a,b) ((a)>(b)?(b):(a)) #define min_c(a,b) ((a)>(b)?(b):(a))
#define max_c(a,b) ((a)>(b)?(a):(b)) #define max_c(a,b) ((a)>(b)?(a):(b))
@@ -88,7 +152,7 @@ extern const char *B_EMPTY_STRING;
/* Grandfathering */ /* Grandfathering */
#ifndef __cplusplus #ifndef __cplusplus
# include <stdbool.h> # include <stdbool.h>
#endif #endif
#ifndef NULL #ifndef NULL
# define NULL (0) # define NULL (0)
@@ -104,14 +168,14 @@ extern int32 atomic_set(vint32 *value, int32 newValue);
extern int32 atomic_test_and_set(vint32 *value, int32 newValue, int32 testAgainst); extern int32 atomic_test_and_set(vint32 *value, int32 newValue, int32 testAgainst);
extern int32 atomic_add(vint32 *value, int32 addValue); extern int32 atomic_add(vint32 *value, int32 addValue);
extern int32 atomic_and(vint32 *value, int32 andValue); extern int32 atomic_and(vint32 *value, int32 andValue);
extern int32 atomic_or(vint32 *value, int32 orValue); extern int32 atomic_or(vint32 *value, int32 orValue);
extern int32 atomic_get(vint32 *value); extern int32 atomic_get(vint32 *value);
extern int64 atomic_set64(vint64 *value, int64 newValue); extern int64 atomic_set64(vint64 *value, int64 newValue);
extern int64 atomic_test_and_set64(vint64 *value, int64 newValue, int64 testAgainst); extern int64 atomic_test_and_set64(vint64 *value, int64 newValue, int64 testAgainst);
extern int64 atomic_add64(vint64 *value, int64 addValue); extern int64 atomic_add64(vint64 *value, int64 addValue);
extern int64 atomic_and64(vint64 *value, int64 andValue); extern int64 atomic_and64(vint64 *value, int64 andValue);
extern int64 atomic_or64(vint64 *value, int64 orValue); extern int64 atomic_or64(vint64 *value, int64 orValue);
extern int64 atomic_get64(vint64 *value); extern int64 atomic_get64(vint64 *value);
/* Other stuff */ /* Other stuff */
+9 -5
View File
@@ -1,8 +1,12 @@
/*
* Copyright 2003-2008 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _ENDIAN_H_ #ifndef _ENDIAN_H_
#define _ENDIAN_H_ #define _ENDIAN_H_
/*
** Distributed under the terms of the OpenBeOS License.
*/ #include <config/HaikuConfig.h>
/* Defines architecture dependent endian constants. /* Defines architecture dependent endian constants.
@@ -10,11 +14,11 @@
* significant byte, "1" the least significant one. * significant byte, "1" the least significant one.
*/ */
#if defined(__INTEL__) || defined(__ARM__) || defined(__MIPSEL__) #if defined(__HAIKU_LITTLE_ENDIAN)
# define LITTLE_ENDIAN 1234 # define LITTLE_ENDIAN 1234
# define BIG_ENDIAN 0 # define BIG_ENDIAN 0
# define BYTE_ORDER LITTLE_ENDIAN # define BYTE_ORDER LITTLE_ENDIAN
#elif defined(__POWERPC__) || defined(__M68K__) #elif defined(__HAIKU_BIG_ENDIAN)
# define BIG_ENDIAN 4321 # define BIG_ENDIAN 4321
# define LITTLE_ENDIAN 0 # define LITTLE_ENDIAN 0
# define BYTE_ORDER BIG_ENDIAN # define BYTE_ORDER BIG_ENDIAN
+91 -90
View File
@@ -1,6 +1,6 @@
/* /*
* Copyright 2002-2008 Haiku inc. All rights reserved. * Copyright 2002-2009 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License * Distributed under the terms of the MIT License.
*/ */
#ifndef _INTTYPES_H_ #ifndef _INTTYPES_H_
#define _INTTYPES_H_ #define _INTTYPES_H_
@@ -30,24 +30,24 @@ typedef struct {
# define PRIiLEAST16 "i" # define PRIiLEAST16 "i"
# define PRIiFAST16 "i" # define PRIiFAST16 "i"
# define PRId32 "d" # define PRId32 __HAIKU_STD_PRI_PREFIX_32 "d"
# define PRIdLEAST32 "d" # define PRIdLEAST32 PRId32
# define PRIdFAST32 "d" # define PRIdFAST32 PRId32
# define PRIi32 "i" # define PRIi32 __HAIKU_STD_PRI_PREFIX_32 "i"
# define PRIiLEAST32 "i" # define PRIiLEAST32 PRIi32
# define PRIiFAST32 "i" # define PRIiFAST32 PRIi32
# define PRId64 "lld" # define PRId64 __HAIKU_STD_PRI_PREFIX_64 "d"
# define PRIdLEAST64 "lld" # define PRIdLEAST64 PRId64
# define PRIdFAST64 "lld" # define PRIdFAST64 PRId64
# define PRIi64 "lli" # define PRIi64 __HAIKU_STD_PRI_PREFIX_64 "i"
# define PRIiLEAST64 "lli" # define PRIiLEAST64 PRIi64
# define PRIiFAST64 "lli" # define PRIiFAST64 PRIi64
# define PRIdMAX "lld" # define PRIdMAX PRId64
# define PRIdPTR "d" # define PRIdPTR __HAIKU_PRI_PREFIX_ADDR "d"
# define PRIiMAX "lli" # define PRIiMAX PRIi64
# define PRIiPTR "i" # define PRIiPTR __HAIKU_PRI_PREFIX_ADDR "i"
/* fprintf() macros for unsigned integers */ /* fprintf() macros for unsigned integers */
# define PRIu8 "u" # define PRIu8 "u"
@@ -76,40 +76,40 @@ typedef struct {
# define PRIXLEAST16 "X" # define PRIXLEAST16 "X"
# define PRIXFAST16 "X" # define PRIXFAST16 "X"
# define PRIu32 "u" # define PRIu32 __HAIKU_STD_PRI_PREFIX_32 "u"
# define PRIuLEAST32 "u" # define PRIuLEAST32 PRIu32
# define PRIuFAST32 "u" # define PRIuFAST32 PRIu32
# define PRIo32 "o" # define PRIo32 __HAIKU_STD_PRI_PREFIX_32 "o"
# define PRIoLEAST32 "o" # define PRIoLEAST32 PRIo32
# define PRIoFAST32 "o" # define PRIoFAST32 PRIo32
# define PRIx32 "x" # define PRIx32 __HAIKU_STD_PRI_PREFIX_32 "x"
# define PRIxLEAST32 "x" # define PRIxLEAST32 PRIx32
# define PRIxFAST32 "x" # define PRIxFAST32 PRIx32
# define PRIX32 "X" # define PRIX32 __HAIKU_STD_PRI_PREFIX_32 "X"
# define PRIXLEAST32 "X" # define PRIXLEAST32 PRIX32
# define PRIXFAST32 "X" # define PRIXFAST32 PRIX32
# define PRIu64 "llu" # define PRIu64 __HAIKU_STD_PRI_PREFIX_64 "u"
# define PRIuLEAST64 "llu" # define PRIuLEAST64 PRIu64
# define PRIuFAST64 "llu" # define PRIuFAST64 PRIu64
# define PRIo64 "llo" # define PRIo64 __HAIKU_STD_PRI_PREFIX_64 "o"
# define PRIoLEAST64 "llo" # define PRIoLEAST64 PRIo64
# define PRIoFAST64 "llo" # define PRIoFAST64 PRIo64
# define PRIx64 "llx" # define PRIx64 __HAIKU_STD_PRI_PREFIX_64 "x"
# define PRIxLEAST64 "llx" # define PRIxLEAST64 PRIx64
# define PRIxFAST64 "llx" # define PRIxFAST64 PRIx64
# define PRIX64 "llX" # define PRIX64 __HAIKU_STD_PRI_PREFIX_64 "X"
# define PRIXLEAST64 "llX" # define PRIXLEAST64 PRIX64
# define PRIXFAST64 "llX" # define PRIXFAST64 PRIX64
# define PRIuMAX "llu" # define PRIuMAX PRIu64
# define PRIuPTR "u" # define PRIuPTR __HAIKU_PRI_PREFIX_ADDR "u"
# define PRIoMAX "llo" # define PRIoMAX PRIo64
# define PRIoPTR "o" # define PRIoPTR __HAIKU_PRI_PREFIX_ADDR "o"
# define PRIxMAX "llx" # define PRIxMAX PRIx64
# define PRIxPTR "x" # define PRIxPTR __HAIKU_PRI_PREFIX_ADDR "x"
# define PRIXMAX "llX" # define PRIXMAX PRIX64
# define PRIXPTR "X" # define PRIXPTR __HAIKU_PRI_PREFIX_ADDR "X"
/* fscanf() macros for signed integers */ /* fscanf() macros for signed integers */
# define SCNd8 "hhd" # define SCNd8 "hhd"
@@ -126,24 +126,24 @@ typedef struct {
# define SCNiLEAST16 "hi" # define SCNiLEAST16 "hi"
# define SCNiFAST16 "i" # define SCNiFAST16 "i"
# define SCNd32 "d" # define SCNd32 __HAIKU_STD_PRI_PREFIX_32 "d"
# define SCNdLEAST32 "d" # define SCNdLEAST32 SCNd32
# define SCNdFAST32 "d" # define SCNdFAST32 SCNd32
# define SCNi32 "i" # define SCNi32 __HAIKU_STD_PRI_PREFIX_32 "i"
# define SCNiLEAST32 "i" # define SCNiLEAST32 SCNi32
# define SCNiFAST32 "i" # define SCNiFAST32 SCNi32
# define SCNd64 "lld" # define SCNd64 __HAIKU_STD_PRI_PREFIX_64 "d"
# define SCNdLEAST64 "lld" # define SCNdLEAST64 SCNd64
# define SCNdFAST64 "lld" # define SCNdFAST64 SCNd64
# define SCNi64 "lli" # define SCNi64 __HAIKU_STD_PRI_PREFIX_64 "i"
# define SCNiLEAST64 "lli" # define SCNiLEAST64 SCNi64
# define SCNiFAST64 "lli" # define SCNiFAST64 SCNi64
# define SCNdMAX "lld" # define SCNdMAX SCNd64
# define SCNdPTR "d" # define SCNdPTR __HAIKU_PRI_PREFIX_ADDR "d"
# define SCNiMAX "lli" # define SCNiMAX SCNi64
# define SCNiPTR "i" # define SCNiPTR __HAIKU_PRI_PREFIX_ADDR "i"
/* fscanf() macros for unsigned integers */ /* fscanf() macros for unsigned integers */
# define SCNu8 "hhu" # define SCNu8 "hhu"
@@ -166,32 +166,32 @@ typedef struct {
# define SCNxLEAST16 "hx" # define SCNxLEAST16 "hx"
# define SCNxFAST16 "x" # define SCNxFAST16 "x"
# define SCNu32 "u" # define SCNu32 __HAIKU_STD_PRI_PREFIX_32 "u"
# define SCNuLEAST32 "u" # define SCNuLEAST32 SCNu32
# define SCNuFAST32 "u" # define SCNuFAST32 SCNu32
# define SCNo32 "o" # define SCNo32 __HAIKU_STD_PRI_PREFIX_32 "o"
# define SCNoLEAST32 "o" # define SCNoLEAST32 SCNo32
# define SCNoFAST32 "o" # define SCNoFAST32 SCNo32
# define SCNx32 "x" # define SCNx32 __HAIKU_STD_PRI_PREFIX_32 "x"
# define SCNxLEAST32 "x" # define SCNxLEAST32 SCNx32
# define SCNxFAST32 "x" # define SCNxFAST32 SCNx32
# define SCNu64 "llu" # define SCNu64 __HAIKU_STD_PRI_PREFIX_64 "u"
# define SCNuLEAST64 "llu" # define SCNuLEAST64 SCNu64
# define SCNuFAST64 "llu" # define SCNuFAST64 SCNu64
# define SCNo64 "llo" # define SCNo64 __HAIKU_STD_PRI_PREFIX_64 "o"
# define SCNoLEAST64 "llo" # define SCNoLEAST64 SCNo64
# define SCNoFAST64 "llo" # define SCNoFAST64 SCNo64
# define SCNx64 "llx" # define SCNx64 __HAIKU_STD_PRI_PREFIX_64 "x"
# define SCNxLEAST64 "llx" # define SCNxLEAST64 SCNx64
# define SCNxFAST64 "llx" # define SCNxFAST64 SCNx64
# define SCNuMAX "llu" # define SCNuMAX SCNu64
# define SCNuPTR "u" # define SCNuPTR __HAIKU_PRI_PREFIX_ADDR "u"
# define SCNoMAX "llo" # define SCNoMAX SCNo64
# define SCNoPTR "o" # define SCNoPTR __HAIKU_PRI_PREFIX_ADDR "o"
# define SCNxMAX "llx" # define SCNxMAX SCNx64
# define SCNxPTR "x" # define SCNxPTR __HAIKU_PRI_PREFIX_ADDR "x"
#endif /* !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) */ #endif /* !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) */
@@ -211,4 +211,5 @@ extern uintmax_t strtoumax(const char *string, char **_end, int base);
} }
#endif #endif
#endif /* _INTTYPES_H_ */ #endif /* _INTTYPES_H_ */
+13 -6
View File
@@ -1,7 +1,14 @@
/*
* Copyright 2001-2009 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _LIBC_LIMITS_H_ #ifndef _LIBC_LIMITS_H_
#define _LIBC_LIMITS_H_ #define _LIBC_LIMITS_H_
/* Note: The header guard is checked in gcc's limits.h. */ /* Note: The header guard is checked in gcc's limits.h. */
#include <config/types.h>
#include <float.h> /* for DBL_DIG, FLT_DIG, etc */ #include <float.h> /* for DBL_DIG, FLT_DIG, etc */
/* _GCC_LIMITS_H_ is defined by GCC's internal limits.h to avoid /* _GCC_LIMITS_H_ is defined by GCC's internal limits.h to avoid
@@ -13,7 +20,7 @@
#define LONGLONG_MIN (-9223372036854775807LL - 1) /* these are Be specific */ #define LONGLONG_MIN (-9223372036854775807LL - 1) /* these are Be specific */
#define LONGLONG_MAX (9223372036854775807LL) #define LONGLONG_MAX (9223372036854775807LL)
#define ULONGLONG_MAX (0xffffffffffffffffULL) #define ULONGLONG_MAX (0xffffffffffffffffULL)
#define ULLONG_MAX ULONGLONG_MAX #define ULLONG_MAX ULONGLONG_MAX
#define LLONG_MAX LONGLONG_MAX #define LLONG_MAX LONGLONG_MAX
@@ -43,7 +50,7 @@
#define PIPE_MAX (512) #define PIPE_MAX (512)
#define PTHREAD_KEYS_MAX 256 #define PTHREAD_KEYS_MAX 256
#define PTHREAD_STACK_MIN 4096 #define PTHREAD_STACK_MIN 4096
#define SSIZE_MAX (2147483647L) #define SSIZE_MAX __HAIKU_SADDR_MAX
#define TTY_NAME_MAX (256) #define TTY_NAME_MAX (256)
#define TZNAME_MAX (32) #define TZNAME_MAX (32)
#define SYMLINK_MAX (1024) #define SYMLINK_MAX (1024)
@@ -55,12 +62,12 @@
#define _POSIX_LOGIN_NAME_MAX (9) #define _POSIX_LOGIN_NAME_MAX (9)
#define _POSIX_MAX_CANON (255) #define _POSIX_MAX_CANON (255)
#define _POSIX_MAX_INPUT (255) #define _POSIX_MAX_INPUT (255)
#define _POSIX_NAME_MAX (255) #define _POSIX_NAME_MAX (255)
#define _POSIX_NGROUPS_MAX (8) #define _POSIX_NGROUPS_MAX (8)
#define _POSIX_OPEN_MAX (128) #define _POSIX_OPEN_MAX (128)
#define _POSIX_PATH_MAX (1024) #define _POSIX_PATH_MAX (1024)
#define _POSIX_PIPE_BUF (512) #define _POSIX_PIPE_BUF (512)
#define _POSIX_SSIZE_MAX (2147483647L) #define _POSIX_SSIZE_MAX __HAIKU_SADDR_MAX
#define _POSIX_STREAM_MAX (8) #define _POSIX_STREAM_MAX (8)
#define _POSIX_TTY_NAME_MAX (256) #define _POSIX_TTY_NAME_MAX (256)
#define _POSIX_TZNAME_MAX (3) #define _POSIX_TZNAME_MAX (3)
+13 -9
View File
@@ -23,6 +23,10 @@
#ifndef _REGEX_H #ifndef _REGEX_H
#define _REGEX_H 1 #define _REGEX_H 1
#include <config/types.h>
/* Allow the use in C++ code. */ /* Allow the use in C++ code. */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@@ -41,15 +45,15 @@ extern "C" {
wide enough to hold a value of a pointer. For most ANSI compilers wide enough to hold a value of a pointer. For most ANSI compilers
ptrdiff_t and size_t should be likely OK. Still size of these two ptrdiff_t and size_t should be likely OK. Still size of these two
types is 2 for Microsoft C. Ugh... */ types is 2 for Microsoft C. Ugh... */
typedef long int s_reg_t; typedef __haiku_saddr_t s_reg_t;
typedef unsigned long int active_reg_t; typedef __haiku_addr_t active_reg_t;
/* The following bits are used to determine the regexp syntax we /* The following bits are used to determine the regexp syntax we
recognize. The set/not-set meanings are chosen so that Emacs syntax recognize. The set/not-set meanings are chosen so that Emacs syntax
remains the value 0. The bits are given in alphabetical order, and remains the value 0. The bits are given in alphabetical order, and
the definitions shifted by one from the previous bit; thus, when we the definitions shifted by one from the previous bit; thus, when we
add or remove a bit, only one other definition need change. */ add or remove a bit, only one other definition need change. */
typedef unsigned long int reg_syntax_t; typedef __haiku_uint32 reg_syntax_t;
/* If this bit is not set, then \ inside a bracket expression is literal. /* If this bit is not set, then \ inside a bracket expression is literal.
If set, then such a \ quotes the following character. */ If set, then such a \ quotes the following character. */
@@ -170,7 +174,7 @@ typedef unsigned long int reg_syntax_t;
stored in the pattern buffer, so changing this does not affect stored in the pattern buffer, so changing this does not affect
already-compiled regexps. */ already-compiled regexps. */
extern reg_syntax_t re_syntax_options; extern reg_syntax_t re_syntax_options;
/* Define combinations of the above bits for the standard possibilities. /* Define combinations of the above bits for the standard possibilities.
(The [[[ comments delimit what gets put into the Texinfo file, so (The [[[ comments delimit what gets put into the Texinfo file, so
don't delete them!) */ don't delete them!) */
@@ -240,7 +244,7 @@ extern reg_syntax_t re_syntax_options;
| RE_NO_BK_PARENS | RE_NO_BK_REFS \ | RE_NO_BK_PARENS | RE_NO_BK_REFS \
| RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD) | RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD)
/* [[[end syntaxes]]] */ /* [[[end syntaxes]]] */
/* Maximum number of duplicates an interval can allow. Some systems /* Maximum number of duplicates an interval can allow. Some systems
(erroneously) define this in other header files, but we want our (erroneously) define this in other header files, but we want our
value, so remove any previous define. */ value, so remove any previous define. */
@@ -315,7 +319,7 @@ typedef enum
REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */ REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */
REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */ REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */
} reg_errcode_t; } reg_errcode_t;
/* This data structure represents a compiled pattern. Before calling /* This data structure represents a compiled pattern. Before calling
the pattern compiler, the fields `buffer', `allocated', `fastmap', the pattern compiler, the fields `buffer', `allocated', `fastmap',
`translate', and `no_sub' can be set. After the pattern has been `translate', and `no_sub' can be set. After the pattern has been
@@ -395,7 +399,7 @@ struct re_pattern_buffer
}; };
typedef struct re_pattern_buffer regex_t; typedef struct re_pattern_buffer regex_t;
/* Type for byte offsets within the string. POSIX mandates this. */ /* Type for byte offsets within the string. POSIX mandates this. */
typedef int regoff_t; typedef int regoff_t;
@@ -426,7 +430,7 @@ typedef struct
regoff_t rm_so; /* Byte offset from string's start to substring's start. */ regoff_t rm_so; /* Byte offset from string's start to substring's start. */
regoff_t rm_eo; /* Byte offset from string's start to substring's end. */ regoff_t rm_eo; /* Byte offset from string's start to substring's end. */
} regmatch_t; } regmatch_t;
/* Declarations for routines. */ /* Declarations for routines. */
/* To avoid duplicating every routine declaration -- once with a /* To avoid duplicating every routine declaration -- once with a
@@ -556,7 +560,7 @@ extern void regfree _RE_ARGS ((regex_t *__preg));
#endif /* C++ */ #endif /* C++ */
#endif /* regex.h */ #endif /* regex.h */
/* /*
Local variables: Local variables:
make-backup-files: t make-backup-files: t
+5 -14
View File
@@ -1,26 +1,17 @@
/* /*
* Copyright 2004-2005, Haiku, Inc. * Copyright 2004-2009, Haiku, Inc.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
#ifndef _SETJMP_H_ #ifndef _SETJMP_H_
#define _SETJMP_H_ #define _SETJMP_H_
#include <config/HaikuConfig.h>
#include <signal.h> #include <signal.h>
/* include architecture specific definitions */ /* include architecture specific definitions */
#ifdef __INTEL__ #include __HAIKU_ARCH_HEADER(arch_setjmp.h)
#include <arch/x86/arch_setjmp.h>
#elif __POWERPC__
#include <arch/ppc/arch_setjmp.h>
#elif __M68K__
#include <arch/m68k/arch_setjmp.h>
#elif __MIPSEL__
#include <arch/mipsel/arch_setjmp.h>
#elif __ARM__
#include <arch/arm/arch_setjmp.h>
#else
#error #include <arch/<cpu>/arch_setjmp.h>
#endif
typedef struct __jmp_buf_tag { typedef struct __jmp_buf_tag {
__jmp_buf regs; /* saved registers, stack & program pointer */ __jmp_buf regs; /* saved registers, stack & program pointer */
+2 -14
View File
@@ -10,7 +10,7 @@
typedef int sig_atomic_t; typedef int sig_atomic_t;
typedef long sigset_t; typedef __haiku_int32 sigset_t;
typedef void (*sighandler_t)(int); typedef void (*sighandler_t)(int);
/* GNU-like signal handler typedef */ /* GNU-like signal handler typedef */
@@ -249,19 +249,7 @@ int pthread_sigmask(int how, const sigset_t *set, sigset_t *oset);
typedef struct vregs vregs; typedef struct vregs vregs;
/* include architecture specific definitions */ /* include architecture specific definitions */
#ifdef __INTEL__ #include __HAIKU_ARCH_HEADER(signal.h)
#include <arch/x86/signal.h>
#elif __POWERPC__
#include <arch/ppc/signal.h>
#elif __M68K__
#include <arch/m68k/signal.h>
#elif __MIPSEL__
#include <arch/mipsel/signal.h>
#elif __ARM__
#include <arch/arm/signal.h>
#else
#error #include <arch/<cpu>/signal.h>
#endif
#endif /* _SIGNAL_H_ */ #endif /* _SIGNAL_H_ */
+22 -20
View File
@@ -1,25 +1,26 @@
/* /*
* Copyright 2003-2008, Haiku Inc. All Rights Reserved. * Copyright 2003-2009, Haiku Inc. All Rights Reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
#ifndef _STDINT_H_ #ifndef _STDINT_H_
#define _STDINT_H_ #define _STDINT_H_
/* ToDo: this is a compiler and architecture dependent header */ #include <config/types.h>
/* Exact-width integer types */ /* Exact-width integer types */
typedef signed char int8_t; typedef __haiku_std_int8 int8_t;
typedef unsigned char uint8_t; typedef __haiku_std_uint8 uint8_t;
typedef signed short int16_t; typedef __haiku_std_int16 int16_t;
typedef unsigned short uint16_t; typedef __haiku_std_uint16 uint16_t;
typedef signed int int32_t; typedef __haiku_std_int32 int32_t;
typedef unsigned int uint32_t; typedef __haiku_std_uint32 uint32_t;
typedef signed long long int64_t; typedef __haiku_std_int64 int64_t;
typedef unsigned long long uint64_t; typedef __haiku_std_uint64 uint64_t;
/* Minimum-width integer types */ /* Minimum-width integer types */
typedef int8_t int_least8_t; typedef int8_t int_least8_t;
@@ -48,12 +49,12 @@ typedef int64_t int_fast64_t;
typedef uint64_t uint_fast64_t; typedef uint64_t uint_fast64_t;
/* Integer types capable of holding object pointers */ /* Integer types capable of holding object pointers */
typedef int32_t intptr_t; typedef __haiku_saddr_t intptr_t;
typedef uint32_t uintptr_t; typedef __haiku_addr_t uintptr_t;
/* Greatest-width integer types */ /* Greatest-width integer types */
typedef signed long long intmax_t; typedef int64_t intmax_t;
typedef unsigned long long uintmax_t; typedef uint64_t uintmax_t;
/* Limits of exact-width integer types */ /* Limits of exact-width integer types */
#define INT8_MIN (-128) #define INT8_MIN (-128)
@@ -107,9 +108,9 @@ typedef unsigned long long uintmax_t;
#define UINT_FAST64_MAX UINT64_MAX #define UINT_FAST64_MAX UINT64_MAX
/* Limits of Integer types capable of holding object pointers */ /* Limits of Integer types capable of holding object pointers */
#define INTPTR_MIN INT32_MIN #define INTPTR_MIN __HAIKU_SADDR_MIN
#define INTPTR_MAX INT32_MAX #define INTPTR_MAX __HAIKU_SADDR_MAX
#define UINTPTR_MAX UINT32_MAX #define UINTPTR_MAX __HAIKU_ADDR_MAX
/* Limits of Greatest-width integer types */ /* Limits of Greatest-width integer types */
#define INTMAX_MIN INT64_MIN #define INTMAX_MIN INT64_MIN
@@ -117,13 +118,13 @@ typedef unsigned long long uintmax_t;
#define UINTMAX_MAX UINT64_MAX #define UINTMAX_MAX UINT64_MAX
/* Limits of other integer types */ /* Limits of other integer types */
#define PTDIFF_MIN INT32_MIN #define PTDIFF_MIN __HAIKU_SADDR_MIN
#define PTDIFF_MAX INT32_MAX #define PTDIFF_MAX __HAIKU_SADDR_MAX
#define SIG_ATOMIC_MIN INT32_MIN #define SIG_ATOMIC_MIN INT32_MIN
#define SIG_ATOMIC_MAX INT32_MAX #define SIG_ATOMIC_MAX INT32_MAX
#define SIZE_MAX UINT32_MAX #define SIZE_MAX __HAIKU_ADDR_MAX
#define WINT_MIN 0 #define WINT_MIN 0
#define WINT_MAX ((wint_t)-1) #define WINT_MAX ((wint_t)-1)
@@ -155,4 +156,5 @@ typedef uint16_t u_int16_t;
typedef uint32_t u_int32_t; typedef uint32_t u_int32_t;
typedef uint64_t u_int64_t; typedef uint64_t u_int64_t;
#endif /* _STDINT_H_ */ #endif /* _STDINT_H_ */
+6 -3
View File
@@ -1,16 +1,19 @@
/* /*
* Copyright 2008, Haiku Inc. All Rights Reserved. * Copyright 2008-2009, Haiku Inc. All Rights Reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
#ifndef _SYS_MSG_H #ifndef _SYS_MSG_H
#define _SYS_MSG_H #define _SYS_MSG_H
#include <config/types.h>
#include <sys/cdefs.h> #include <sys/cdefs.h>
#include <sys/ipc.h> #include <sys/ipc.h>
#include <sys/types.h> #include <sys/types.h>
typedef unsigned long msgqnum_t; typedef __haiku_uint32 msgqnum_t;
typedef unsigned long msglen_t; typedef __haiku_uint32 msglen_t;
/* No error if big message */ /* No error if big message */
#define MSG_NOERROR 010000 #define MSG_NOERROR 010000
+4 -1
View File
@@ -5,13 +5,16 @@
#ifndef _SYS_RESOURCE_H #ifndef _SYS_RESOURCE_H
#define _SYS_RESOURCE_H #define _SYS_RESOURCE_H
#include <config/types.h>
#include <sys/cdefs.h> #include <sys/cdefs.h>
#include <sys/time.h> #include <sys/time.h>
/* getrlimit()/setrlimit() definitions */ /* getrlimit()/setrlimit() definitions */
typedef unsigned long rlim_t; typedef __haiku_addr_t rlim_t;
struct rlimit { struct rlimit {
rlim_t rlim_cur; /* current soft limit */ rlim_t rlim_cur; /* current soft limit */
+5 -3
View File
@@ -1,11 +1,13 @@
/* /*
* Copyright 2002-2006, Haiku Inc. All Rights Reserved. * Copyright 2002-2009, Haiku Inc. All Rights Reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
#ifndef _SYS_SELECT_H #ifndef _SYS_SELECT_H
#define _SYS_SELECT_H #define _SYS_SELECT_H
#include <config/types.h>
#include <sys/time.h> #include <sys/time.h>
#include <signal.h> #include <signal.h>
@@ -22,7 +24,7 @@
# define FD_SETSIZE 1024 # define FD_SETSIZE 1024
#endif #endif
typedef unsigned long fd_mask; typedef __haiku_uint32 fd_mask;
#ifndef _howmany #ifndef _howmany
# define _howmany(x, y) (((x) + ((y) - 1)) / (y)) # define _howmany(x, y) (((x) + ((y) - 1)) / (y))
@@ -55,7 +57,7 @@ extern "C" {
extern int pselect(int numBits, struct fd_set *readBits, struct fd_set *writeBits, extern int pselect(int numBits, struct fd_set *readBits, struct fd_set *writeBits,
struct fd_set *errorBits, const struct timespec *timeout, const sigset_t *sigMask); struct fd_set *errorBits, const struct timespec *timeout, const sigset_t *sigMask);
extern int select(int numBits, struct fd_set *readBits, struct fd_set *writeBits, extern int select(int numBits, struct fd_set *readBits, struct fd_set *writeBits,
struct fd_set *errorBits, struct timeval *timeout); struct fd_set *errorBits, struct timeval *timeout);
#ifdef __cplusplus #ifdef __cplusplus
+2 -2
View File
@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2008, Haiku Inc. All Rights Reserved. * Copyright 2002-2009, Haiku Inc. All Rights Reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
#ifndef _SYS_STAT_H_ #ifndef _SYS_STAT_H_
@@ -24,7 +24,7 @@ struct stat {
struct timespec st_mtim; /* last modification time */ struct timespec st_mtim; /* last modification time */
struct timespec st_ctim; /* last change time, not creation time */ struct timespec st_ctim; /* last change time, not creation time */
struct timespec st_crtim; /* creation time */ struct timespec st_crtim; /* creation time */
unsigned int st_type; /* attribute/index type */ __haiku_uint32 st_type; /* attribute/index type */
blkcnt_t st_blocks; /* number of blocks allocated for object */ blkcnt_t st_blocks; /* number of blocks allocated for object */
}; };
+29 -25
View File
@@ -1,11 +1,13 @@
/* /*
* Copyright 2002-2006, Haiku Inc. All Rights Reserved. * Copyright 2002-2009, Haiku Inc. All Rights Reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
#ifndef _SYS_TYPES_H #ifndef _SYS_TYPES_H
#define _SYS_TYPES_H #define _SYS_TYPES_H
#include <config/types.h>
#include <BeBuild.h> #include <BeBuild.h>
@@ -17,36 +19,38 @@ typedef unsigned char u_char;
/* sysV compatibility */ /* sysV compatibility */
#ifndef _SUPPORT_DEFS_H typedef unsigned long ulong;
typedef unsigned long ulong; typedef unsigned short ushort;
typedef unsigned short ushort; typedef unsigned int uint;
typedef unsigned int uint;
#endif
typedef unsigned char unchar; typedef unsigned char unchar;
typedef long long blkcnt_t; typedef __haiku_int64 blkcnt_t;
typedef int blksize_t; typedef __haiku_std_int32 blksize_t;
typedef long long fsblkcnt_t; typedef __haiku_int64 fsblkcnt_t;
typedef long long fsfilcnt_t; typedef __haiku_int64 fsfilcnt_t;
typedef long long off_t; typedef __haiku_int64 off_t;
typedef long long ino_t; typedef __haiku_int64 ino_t;
typedef int cnt_t; typedef __haiku_std_int32 cnt_t;
typedef long dev_t; typedef __haiku_int32 dev_t;
typedef long pid_t; typedef __haiku_int32 pid_t;
typedef long id_t; typedef __haiku_int32 id_t;
typedef unsigned int uid_t; typedef __haiku_std_uint32 uid_t;
typedef unsigned int gid_t; typedef __haiku_std_uint32 gid_t;
typedef unsigned int mode_t; typedef __haiku_std_uint32 mode_t;
typedef unsigned int umode_t; typedef __haiku_std_uint32 umode_t;
typedef int nlink_t; typedef __haiku_std_int32 nlink_t;
typedef int daddr_t; #ifdef __HAIKU_BEOS_COMPATIBLE_TYPES
typedef char * caddr_t; typedef int daddr_t; /* disk address */
#else
typedef off_t daddr_t; /* disk address */
#endif
typedef char* caddr_t;
typedef unsigned long addr_t; typedef __haiku_addr_t addr_t;
typedef long key_t; typedef __haiku_int32 key_t;
#include <null.h> #include <null.h>
#include <size_t.h> #include <size_t.h>
+3 -3
View File
@@ -1,5 +1,5 @@
/* /*
* Copyright 2004-2008, Haiku Inc. All Rights Reserved. * Copyright 2004-2009, Haiku Inc. All Rights Reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
#ifndef _TERMIOS_H_ #ifndef _TERMIOS_H_
@@ -9,7 +9,7 @@
#include <sys/types.h> #include <sys/types.h>
typedef unsigned long tcflag_t; typedef __haiku_uint32 tcflag_t;
typedef unsigned char speed_t; typedef unsigned char speed_t;
typedef unsigned char cc_t; typedef unsigned char cc_t;
@@ -54,7 +54,7 @@ struct termios {
#define IUCLC 0x200 /* map all upper case to lower */ #define IUCLC 0x200 /* map all upper case to lower */
#define IXON 0x400 /* enable input SW flow control */ #define IXON 0x400 /* enable input SW flow control */
#define IXANY 0x800 /* any character will restart input */ #define IXANY 0x800 /* any character will restart input */
#define IXOFF 0x1000 /* enable output SW flow control */ #define IXOFF 0x1000 /* enable output SW flow control */
/* c_oflag - output control modes */ /* c_oflag - output control modes */
#define OPOST 0x01 /* enable postprocessing of output */ #define OPOST 0x01 /* enable postprocessing of output */
+5 -5
View File
@@ -9,10 +9,10 @@
#include <sys/types.h> #include <sys/types.h>
typedef long clock_t; typedef __haiku_int32 clock_t;
typedef long time_t; typedef __haiku_int32 time_t;
typedef long suseconds_t; typedef __haiku_int32 suseconds_t;
typedef unsigned long useconds_t; typedef __haiku_uint32 useconds_t;
#define CLOCKS_PER_SEC 1000 #define CLOCKS_PER_SEC 1000
#define CLK_TCK CLOCKS_PER_SEC #define CLK_TCK CLOCKS_PER_SEC
@@ -64,7 +64,7 @@ extern char *asctime_r(const struct tm *timep, char *buffer);
extern char *ctime(const time_t *timer); extern char *ctime(const time_t *timer);
extern char *ctime_r(const time_t *timer, char *buffer); extern char *ctime_r(const time_t *timer, char *buffer);
extern struct tm *gmtime(const time_t *timer); extern struct tm *gmtime(const time_t *timer);
extern struct tm *gmtime_r(const time_t *timer, struct tm *tm); extern struct tm *gmtime_r(const time_t *timer, struct tm *tm);
extern struct tm *localtime(const time_t *timer); extern struct tm *localtime(const time_t *timer);
extern struct tm *localtime_r(const time_t *timer, struct tm *tm); extern struct tm *localtime_r(const time_t *timer, struct tm *tm);
extern int nanosleep(const struct timespec *, struct timespec *); extern int nanosleep(const struct timespec *, struct timespec *);
+76 -1
View File
@@ -1,5 +1,5 @@
/* /*
* Copyright 2007-2008, Ingo Weinhold, [email protected]. * Copyright 2007-2009, Ingo Weinhold, [email protected].
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
#ifndef _FSSH_API_WRAPPER_H #ifndef _FSSH_API_WRAPPER_H
@@ -1503,6 +1503,81 @@
#define gid_t fssh_gid_t #define gid_t fssh_gid_t
#define pid_t fssh_pid_t #define pid_t fssh_pid_t
#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS)
/* printf()/scanf() format strings for [u]int* types */
#define B_PRId8 FSSH_B_PRId8
#define B_PRIi8 FSSH_B_PRIi8
#define B_PRId16 FSSH_B_PRId16
#define B_PRIi16 FSSH_B_PRIi16
#define B_PRId32 FSSH_B_PRId32
#define B_PRIi32 FSSH_B_PRIi32
#define B_PRId64 FSSH_B_PRId64
#define B_PRIi64 FSSH_B_PRIi64
#define B_PRIu8 FSSH_B_PRIu8
#define B_PRIo8 FSSH_B_PRIo8
#define B_PRIx8 FSSH_B_PRIx8
#define B_PRIX8 FSSH_B_PRIX8
#define B_PRIu16 FSSH_B_PRIu16
#define B_PRIo16 FSSH_B_PRIo16
#define B_PRIx16 FSSH_B_PRIx16
#define B_PRIX16 FSSH_B_PRIX16
#define B_PRIu32 FSSH_B_PRIu32
#define B_PRIo32 FSSH_B_PRIo32
#define B_PRIx32 FSSH_B_PRIx32
#define B_PRIX32 FSSH_B_PRIX32
#define B_PRIu64 FSSH_B_PRIu64
#define B_PRIo64 FSSH_B_PRIo64
#define B_PRIx64 FSSH_B_PRIx64
#define B_PRIX64 FSSH_B_PRIX64
#define B_SCNd8 FSSH_B_SCNd8
#define B_SCNi8 FSSH_B_SCNi8
#define B_SCNd16 FSSH_B_SCNd16
#define B_SCNi16 FSSH_B_SCNi16
#define B_SCNd32 FSSH_B_SCNd32
#define B_SCNi32 FSSH_B_SCNi32
#define B_SCNd64 FSSH_B_SCNd64
#define B_SCNi64 FSSH_B_SCNi64
#define B_SCNu8 FSSH_B_SCNu8
#define B_SCNo8 FSSH_B_SCNo8
#define B_SCNx8 FSSH_B_SCNx8
#define B_SCNu16 FSSH_B_SCNu16
#define B_SCNu16 FSSH_B_SCNu16
#define B_SCNx16 FSSH_B_SCNx16
#define B_SCNu32 FSSH_B_SCNu32
#define B_SCNo32 FSSH_B_SCNo32
#define B_SCNx32 FSSH_B_SCNx32
#define B_SCNu64 FSSH_B_SCNu64
#define B_SCNo64 FSSH_B_SCNo64
#define B_SCNx64 FSSH_B_SCNx64
/* printf() format strings for some standard types */
/* size_t */
#define B_PRIuSIZE FSSH_B_PRIuSIZE
#define B_PRIoSIZE FSSH_B_PRIoSIZE
#define B_PRIxSIZE FSSH_B_PRIxSIZE
#define B_PRIXSIZE FSSH_B_PRIXSIZE
/* ssize_t */
#define B_PRIdSSIZE FSSH_B_PRIdSSIZE
#define B_PRIiSSIZE FSSH_B_PRIiSSIZE
/* addr_t */
#define B_PRIuADDR FSSH_B_PRIuADDR
#define B_PRIoADDR FSSH_B_PRIoADDR
#define B_PRIxADDR FSSH_B_PRIxADDR
#define B_PRIXADDR FSSH_B_PRIXADDR
/* off_t */
#define B_PRIdOFF FSSH_B_PRIdOFF
#define B_PRIiOFF FSSH_B_PRIiOFF
/* dev_t */
#define B_PRIdDEV FSSH_B_PRIdDEV
#define B_PRIiDEV FSSH_B_PRIiDEV
/* ino_t */
#define B_PRIdINO FSSH_B_PRIdINO
#define B_PRIiINO FSSH_B_PRIiINO
#endif /* !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) */
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// #pragma mark - fssh_uio.h // #pragma mark - fssh_uio.h
+6 -6
View File
@@ -1,5 +1,5 @@
/* /*
* Copyright 2005-2007, Haiku Inc. All Rights Reserved. * Copyright 2005-2009, Haiku Inc. All Rights Reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
#ifndef _FSSH_TIME_H_ #ifndef _FSSH_TIME_H_
@@ -9,10 +9,10 @@
#include "fssh_defs.h" #include "fssh_defs.h"
typedef long fssh_clock_t; typedef int32_t fssh_clock_t;
typedef long fssh_time_t; typedef int32_t fssh_time_t;
typedef long fssh_suseconds_t; typedef int32_t fssh_suseconds_t;
typedef unsigned long fssh_useconds_t; typedef uint32_t fssh_useconds_t;
#define FSSH_CLOCKS_PER_SEC 1000 #define FSSH_CLOCKS_PER_SEC 1000
#define FSSH_CLK_TCK FSSH_CLOCKS_PER_SEC #define FSSH_CLK_TCK FSSH_CLOCKS_PER_SEC
@@ -66,7 +66,7 @@ extern char *fssh_ctime(const fssh_time_t *timer);
extern char *fssh_ctime_r(const fssh_time_t *timer, char *buffer); extern char *fssh_ctime_r(const fssh_time_t *timer, char *buffer);
extern struct fssh_tm *fssh_gmtime(const fssh_time_t *timer); extern struct fssh_tm *fssh_gmtime(const fssh_time_t *timer);
extern struct fssh_tm *fssh_gmtime_r(const fssh_time_t *timer, extern struct fssh_tm *fssh_gmtime_r(const fssh_time_t *timer,
struct fssh_tm *tm); struct fssh_tm *tm);
extern struct fssh_tm *fssh_localtime(const fssh_time_t *timer); extern struct fssh_tm *fssh_localtime(const fssh_time_t *timer);
extern struct fssh_tm *fssh_localtime_r(const fssh_time_t *timer, extern struct fssh_tm *fssh_localtime_r(const fssh_time_t *timer,
struct fssh_tm *tm); struct fssh_tm *tm);
+90
View File
@@ -1,8 +1,14 @@
/*
* Copyright 2007-2009, Ingo Weinhold, bonefish@cs.tu-berlin.de.
* Distributed under the terms of the MIT License.
*/
#ifndef _FSSH_TYPES_H #ifndef _FSSH_TYPES_H
#define _FSSH_TYPES_H #define _FSSH_TYPES_H
#include <inttypes.h> #include <inttypes.h>
typedef uint32_t fssh_ulong; typedef uint32_t fssh_ulong;
typedef volatile int32_t vint32_t; typedef volatile int32_t vint32_t;
typedef volatile int64_t vint64_t; typedef volatile int64_t vint64_t;
@@ -35,4 +41,88 @@ typedef int32_t fssh_pid_t;
#define NULL (0) #define NULL (0)
#endif #endif
// NOTE: For this to work the __STDC_FORMAT_MACROS feature macro must be
// defined.
/* printf()/scanf() format strings for [u]int* types */
#define FSSH_B_PRId8 PRId8
#define FSSH_B_PRIi8 PRIi8
#define FSSH_B_PRId16 PRId16
#define FSSH_B_PRIi16 PRIi16
#define FSSH_B_PRId32 PRId32
#define FSSH_B_PRIi32 PRIi32
#define FSSH_B_PRId64 PRId64
#define FSSH_B_PRIi64 PRIi64
#define FSSH_B_PRIu8 PRIu8
#define FSSH_B_PRIo8 PRIo8
#define FSSH_B_PRIx8 PRIx8
#define FSSH_B_PRIX8 PRIX8
#define FSSH_B_PRIu16 PRIu16
#define FSSH_B_PRIo16 PRIo16
#define FSSH_B_PRIx16 PRIx16
#define FSSH_B_PRIX16 PRIX16
#define FSSH_B_PRIu32 PRIu32
#define FSSH_B_PRIo32 PRIo32
#define FSSH_B_PRIx32 PRIx32
#define FSSH_B_PRIX32 PRIX32
#define FSSH_B_PRIu64 PRIu64
#define FSSH_B_PRIo64 PRIo64
#define FSSH_B_PRIx64 PRIx64
#define FSSH_B_PRIX64 PRIX64
#define FSSH_B_SCNd8 SCNd8
#define FSSH_B_SCNi8 SCNi8
#define FSSH_B_SCNd16 SCNd16
#define FSSH_B_SCNi16 SCNi16
#define FSSH_B_SCNd32 SCNd32
#define FSSH_B_SCNi32 SCNi32
#define FSSH_B_SCNd64 SCNd64
#define FSSH_B_SCNi64 SCNi64
#define FSSH_B_SCNu8 SCNu8
#define FSSH_B_SCNo8 SCNo8
#define FSSH_B_SCNx8 SCNx8
#define FSSH_B_SCNu16 SCNu16
#define FSSH_B_SCNu16 SCNu16
#define FSSH_B_SCNx16 SCNx16
#define FSSH_B_SCNu32 SCNu32
#define FSSH_B_SCNo32 SCNo32
#define FSSH_B_SCNx32 SCNx32
#define FSSH_B_SCNu64 SCNu64
#define FSSH_B_SCNo64 SCNo64
#define FSSH_B_SCNx64 SCNx64
/* printf() format strings for some standard types */
/* size_t */
#define FSSH_B_PRIuSIZE FSSH_B_PRIu32
#define FSSH_B_PRIoSIZE FSSH_B_PRIo32
#define FSSH_B_PRIxSIZE FSSH_B_PRIx32
#define FSSH_B_PRIXSIZE FSSH_B_PRIX32
/* ssize_t */
#define FSSH_B_PRIdSSIZE FSSH_B_PRId32
#define FSSH_B_PRIiSSIZE FSSH_B_PRIi32
/* addr_t */
#ifdef HAIKU_HOST_PLATFORM_64_BIT
# define FSSH_B_PRIuADDR FSSH_B_PRIu64
# define FSSH_B_PRIoADDR FSSH_B_PRIo64
# define FSSH_B_PRIxADDR FSSH_B_PRIx64
# define FSSH_B_PRIXADDR FSSH_B_PRIX64
#else
# define FSSH_B_PRIuADDR FSSH_B_PRIu32
# define FSSH_B_PRIoADDR FSSH_B_PRIo32
# define FSSH_B_PRIxADDR FSSH_B_PRIx32
# define FSSH_B_PRIXADDR FSSH_B_PRIX32
#endif
/* off_t */
#define FSSH_B_PRIdOFF FSSH_B_PRId64
#define FSSH_B_PRIiOFF FSSH_B_PRIi64
/* dev_t */
#define FSSH_B_PRIdDEV FSSH_B_PRId32
#define FSSH_B_PRIiDEV FSSH_B_PRIi32
/* ino_t */
#define FSSH_B_PRIdINO FSSH_B_PRId64
#define FSSH_B_PRIiINO FSSH_B_PRIi64
#endif // _FSSH_TYPES_H #endif // _FSSH_TYPES_H
+1
View File
@@ -5,6 +5,7 @@ SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src add-ons kernel file_systems bfs ] ;
# set some additional defines # set some additional defines
{ {
local defines = local defines =
__STDC_FORMAT_MACROS
#BFS_BIG_ENDIAN_ONLY #BFS_BIG_ENDIAN_ONLY
BFS_SHELL BFS_SHELL
; ;