Defines basic types and definitions for the Haiku API. More...
Defines | |
| #define | max_c(a, b) ((a)>(b)?(a):(b)) |
| Returns the maximum of values a and b. | |
| #define | min_c(a, b) ((a)>(b)?(b):(a)) |
| Returns the minimum of the values a and b. | |
| #define | NULL (0) |
Defines the constant NULL if it hasn't already been defined. | |
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_PRId32 |
| time_t | |
| #define | B_PRIiTIME B_PRIi32 |
| time_t | |
Deprecated defines | |
| #define | FALSE 0 |
Obsolete. Use false. | |
| #define | TRUE 1 |
Obsolete. Use true. | |
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 |
| Sets the large or mini icon used by an application of this type for files of the given type. | |
| typedef int64 | bigtime_t |
| Represents time. The unit depends on the context of the function. | |
| typedef int64 | nanotime_t |
| Represents time in nanoseconds. | |
| typedef uint32 | type_code |
| Represents a certain type of data. See TypeConstants.h for possible values. | |
| typedef uint32 | perform_code |
| Defined to support 'hidden' commands or extensions to classes. | |
Functions | |
| int32 | atomic_add (vint32 *value, int32 addValue) |
| Atomically add the value of addValue to value. | |
| int64 | atomic_add64 (vint64 *value, int64 addValue) |
| Atomically add the value of addValue to value. | |
| int32 | atomic_and (vint32 *value, int32 andValue) |
| Atomically perform a bitwise AND operation of andValue to the variable andValue. | |
| int64 | atomic_and64 (vint64 *value, int64 andValue) |
| Atomically perform a bitwise AND operation of andValue to the variable andValue. | |
| int32 | atomic_get (vint32 *value) |
Atomically return the value of value. | |
| int64 | atomic_get64 (vint64 *value) |
Atomically return the value of value. | |
| int32 | atomic_or (vint32 *value, int32 orValue) |
| Atomically perform a bitwise OR operation of orValue to the variable andValue. | |
| int64 | atomic_or64 (vint64 *value, int64 orValue) |
| Atomically perform a bitwise OR operation of orValue to the variable andValue. | |
| int32 | atomic_set (vint32 *value, int32 newValue) |
| Atomically set the variable value to newvalue. | |
| int64 | atomic_set64 (vint64 *value, int64 newValue) |
| Atomically set the variable value to newvalue. | |
| int32 | atomic_test_and_set (vint32 *value, int32 newValue, int32 testAgainst) |
| Atomically set the variable value to newValue if the current value is testAgainst. | |
| int64 | atomic_test_and_set64 (vint64 *value, int64 newValue, int64 testAgainst) |
| Atomically set the variable value to newValue if the current value is testAgainst. | |
| void * | get_stack_frame (void) |
| Internal function. | |
Variables | |
| const char * | B_EMPTY_STRING |
| Defines an empty string. Currently defined as the string "". | |
Defines basic types and definitions for the Haiku API.
| #define max_c | ( | a, | |
| b | |||
| ) | ((a)>(b)?(a):(b)) |
Returns the maximum of values a and b.
max(a,b). | #define min_c | ( | a, | |
| b | |||
| ) | ((a)>(b)?(b):(a)) |
Returns the minimum of the values a and b.
min(a,b). | typedef uint32 perform_code |
Defined to support 'hidden' commands or extensions to classes.
The Haiku API has none of these.
| typedef int32 status_t |
Sets the large or mini icon used by an application of this type for files of the given type.
Represents one of the status codes defined in Error.h.
BMimeType::SetIconForType(const char* type, const uint8* data, size_t dataSize) This can be confusing, so here's how this function is intended to be used:
BMimeType object should be set to the MIME signature of an application to whom you want to assign custom icons for custom MIME types.type parameter specifies the file type whose custom icon you are setting.The type of the BMimeType object is not required to actually be a subtype of "application/"; that is the intended use however, and application-specific icons are not expected to be present for non-application types.
The icon is copied from the BBitmap pointed to by icon. The bitmap must be the proper size: 32x32 for the large icon, 16x16 for the mini icon.
If you want to erase the current icon, pass NULL as the icon argument.
| type | Pointer to a pre-allocated string containing the MIME type whose custom icon you wish to set. |
| icon | Pointer to a pre-allocated BBitmap of proper size and colorspace containing the new icon, or NULL to clear the current icon. |
| icon_size | Value that specifies which icon to update. Currently B_LARGE_ICON and B_MINI_ICON are supported. |
B_OK on success or another error code on failure.