Macros | Functions | Variables
SupportDefs.h File Reference

Defines basic types and definitions for the Haiku API. More...

Macros

#define max_c(a, b)   ((a)>(b)?(a):(b))
 Returns the maximum of values a and b. More...
 
#define min_c(a, b)   ((a)>(b)?(b):(a))
 Returns the minimum of the values a and b. More...
 
#define NULL   (0)
 Defines the constant NULL if it hasn't already been defined. More...
 
Format strings for printf() and scanf()
#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"
 
Format strings for several standard types
#define B_PRIuSIZE   __HAIKU_PRI_PREFIX_ADDR "u"
 size_t
 
#define B_PRIoSIZE   __HAIKU_PRI_PREFIX_ADDR "o"
 size_t
 
#define B_PRIxSIZE   __HAIKU_PRI_PREFIX_ADDR "x"
 size_t
 
#define B_PRIXSIZE   __HAIKU_PRI_PREFIX_ADDR "X"
 size_t
 
#define B_PRIdSSIZE   __HAIKU_PRI_PREFIX_ADDR "d"
 ssize_t
 
#define B_PRIiSSIZE   __HAIKU_PRI_PREFIX_ADDR "i"
 ssize_t
 
#define B_PRIuADDR   __HAIKU_PRI_PREFIX_ADDR "u"
 addr_t
 
#define B_PRIoADDR   __HAIKU_PRI_PREFIX_ADDR "o"
 addr_t
 
#define B_PRIxADDR   __HAIKU_PRI_PREFIX_ADDR "x"
 addr_t
 
#define B_PRIXADDR   __HAIKU_PRI_PREFIX_ADDR "X"
 addr_t
 
#define B_PRIdOFF   B_PRId64
 off_t
 
#define B_PRIiOFF   B_PRIi64
 off_t
 
#define B_PRIdDEV   B_PRId32
 dev_t
 
#define B_PRIiDEV   B_PRIi32
 dev_t
 
#define B_PRIdINO   B_PRId64
 ino_t
 
#define B_PRIiINO   B_PRIi64
 ino_t
 
#define B_PRIdTIME   B_PRId64
 time_t
 
#define B_PRIiTIME   B_PRIi64
 time_t
 
Deprecated defines
#define FALSE   0
 Obsolete. Use false. More...
 
#define TRUE   1
 Obsolete. Use true. More...
 

Typedefs

Fixed-Size Integer Types
typedef __haiku_int8 int8
 
typedef __haiku_uint8 uint8
 
typedef __haiku_int16 int16
 
typedef __haiku_uint16 uint16
 
typedef __haiku_int32 int32
 
typedef __haiku_uint32 uint32
 
typedef __haiku_int64 int64
 
typedef __haiku_uint64 uint64
 
Fixed-size Volatile Types
typedef volatile int8 vint8
 
typedef volatile uint8 vuint8
 
typedef volatile int16 vint16
 
typedef volatile uint16 vuint16
 
typedef volatile int32 vint32
 
typedef volatile uint32 vuint32
 
typedef volatile int64 vint64
 
typedef volatile uint64 vuint64
 
Short-hand Volatile Type Names
typedef volatile long vlong
 
typedef volatile int vint
 
typedef volatile short vshort
 
typedef volatile char vchar
 
typedef volatile unsigned long vulong
 
typedef volatile unsigned int vuint
 
typedef volatile unsigned short vushort
 
typedef volatile unsigned char vuchar
 
Character Type Formats
typedef unsigned char uchar
 
typedef unsigned short unichar
 
Descriptive Type Formats
typedef int32 status_t
 Represents one of the status codes defined in Errors.h. More...
 
typedef int64 bigtime_t
 Represents time. The unit depends on the context of the function. More...
 
typedef int64 nanotime_t
 Represents time in nanoseconds.
 
typedef uint32 type_code
 Represents a certain type of data. See TypeConstants.h for possible values. More...
 
typedef uint32 perform_code
 Defined to support 'hidden' commands or extensions to classes. More...
 

Functions

int32 atomic_add (int32 *value, int32 addValue)
 Atomically add the value of addValue to value. More...
 
int64 atomic_add64 (int64 *value, int64 addValue)
 Atomically add the value of addValue to value. More...
 
int32 atomic_and (int32 *value, int32 andValue)
 Atomically perform a bitwise AND operation of andValue to the variable andValue. More...
 
int64 atomic_and64 (int64 *value, int64 andValue)
 Atomically perform a bitwise AND operation of andValue to the variable andValue. More...
 
int32 atomic_get (int32 *value)
 Atomically return the value of value. More...
 
int64 atomic_get64 (int64 *value)
 Atomically return the value of value. More...
 
int32 atomic_get_and_set (int32 *value, int32 newValue)
 Atomically set the variable value to newvalue and return the old value. More...
 
int64 atomic_get_and_set64 (int64 *value, int64 newValue)
 Atomically set the variable value to newvalue and return the old value. More...
 
int32 atomic_or (int32 *value, int32 orValue)
 Atomically perform a bitwise OR operation of orValue to the variable andValue. More...
 
int64 atomic_or64 (int64 *value, int64 orValue)
 Atomically perform a bitwise OR operation of orValue to the variable andValue. More...
 
void atomic_set (int32 *value, int32 newValue)
 Atomically set the variable value to newvalue. More...
 
void atomic_set64 (int64 *value, int64 newValue)
 Atomically set the variable value to newvalue. More...
 
int32 atomic_test_and_set (int32 *value, int32 newValue, int32 testAgainst)
 Atomically set the variable value to newValue if the current value is testAgainst. More...
 
int64 atomic_test_and_set64 (int64 *value, int64 newValue, int64 testAgainst)
 Atomically set the variable value to newValue if the current value is testAgainst. More...
 
void * get_stack_frame (void)
 Internal function.
 

Variables

const char * B_EMPTY_STRING
 Defines an empty string. Currently defined as the string "". More...
 

Detailed Description

Defines basic types and definitions for the Haiku API.

Macro Definition Documentation

◆ FALSE

#define FALSE   0

Obsolete. Use false.

Since
BeOS R3

◆ max_c

#define max_c (   a,
 
)    ((a)>(b)?(a):(b))

Returns the maximum of values a and b.

Note
When including this header in a C file, use the C equivalent called max(a,b).
Since
Haiku R1

◆ min_c

#define min_c (   a,
 
)    ((a)>(b)?(b):(a))

Returns the minimum of the values a and b.

Note
When including this header in a C file, use the C equivalent called min(a,b).
Since
Haiku R1

◆ NULL

#define NULL   (0)

◆ TRUE

#define TRUE   1

Obsolete. Use true.

Since
BeOS R3

Typedef Documentation

◆ bigtime_t

typedef int64 bigtime_t

Represents time. The unit depends on the context of the function.

Since
BeOS R3

◆ perform_code

typedef uint32 perform_code

Defined to support 'hidden' commands or extensions to classes.

The Haiku API has none of these.

Since
Haiku R1

◆ status_t

typedef int32 status_t

Represents one of the status codes defined in Errors.h.

Since
BeOS R3

◆ type_code

typedef uint32 type_code

Represents a certain type of data. See TypeConstants.h for possible values.

Since
Haiku R1

Variable Documentation

◆ B_EMPTY_STRING

const char * B_EMPTY_STRING

Defines an empty string. Currently defined as the string "".

Since
BeOS R3