1/* 2 * Copyright 2007, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Documentation by: 6 * Niels Sascha Reedijk <niels.reedijk@gmail.com> 7 * Corresponds to: 8 * /trunk/headers/os/support/SupportDefs.h rev 19972 9 */ 10 11/*! 12 \file SupportDefs.h 13 \ingroup support 14 \brief Defines basic types and definitions for the Haiku API. 15*/ 16 17/*! 18 \name Short byte long Type Formats 19*/ 20 21//! @{ 22 23/*! 24 \typedef typedef signed char int8 25*/ 26 27/*! 28 \typedef typedef unsigned char uint8 29*/ 30 31/*! 32 \typedef typedef volatile signed char vint8 33*/ 34 35/*! 36 \typedef typedef volatile unsigned char vuint8 37*/ 38 39//! @} 40 41/*! 42 \name Short 2-byte long Type Formats 43*/ 44 45//! @{ 46 47/*! 48 \typedef typedef short int16 49*/ 50 51/*! 52 \typedef typedef unsigned short uint16 53*/ 54 55/*! 56 \typedef typedef volatile short vint16 57*/ 58 59/*! 60 \typedef typedef volatile unsigned short vuint16 61*/ 62 63//! @} 64 65/*! 66 \name Short 4-byte long Type Formats 67*/ 68 69//! @{ 70 71/*! 72 \typedef typedef long int32 73*/ 74 75/*! 76 \typedef typedef unsigned long uint32 77*/ 78 79/*! 80 \typedef typedef volatile long vint32 81*/ 82 83/*! 84 \typedef typedef volatile unsigned long vuint32 85*/ 86 87//! @} 88 89/*! 90 \name Short 8-byte long Type Formats 91*/ 92 93//! @{ 94 95/*! 96 \typedef typedef long long int64 97*/ 98 99/*! 100 \typedef typedef unsigned long long uint64 101*/ 102 103/*! 104 \typedef typedef volatile long long vint64 105*/ 106 107/*! 108 \typedef typedef volatile unsigned long long vuint64 109*/ 110 111//! @} 112 113/*! 114 \name Short volatile Type Formats 115*/ 116 117//! @{ 118 119/*! 120 \typedef typedef volatile long vlong 121*/ 122 123/*! 124 \typedef typedef volatile int vint 125*/ 126 127/*! 128 \typedef typedef volatile short vshort 129*/ 130 131/*! 132 \typedef typedef volatile char vchar 133*/ 134 135/*! 136 \typedef typedef volatile unsigned long vulong 137*/ 138 139/*! 140 \typedef typedef volatile unsigned int vuint 141*/ 142 143/*! 144 \typedef typedef volatile unsigned short vushort 145*/ 146 147/*! 148 \typedef typedef volatile unsigned char vuchar 149*/ 150 151//! @} 152 153/*! 154 \name Character Type Formats 155*/ 156 157//! @{ 158 159/*! 160 \typedef typedef unsigned char uchar 161*/ 162 163/*! 164 \typedef typedef unsigned short unichar 165*/ 166 167//! @} 168 169/*! 170 \name Descriptive Type Formats 171*/ 172 173//! @{ 174 175/*! 176 \typedef typedef int32 status_t 177 \brief Represents one of the status codes defined in Error.h 178*/ 179 180/*! 181 \typedef typedef int64 bigtime_t 182 \brief Represents time. The unit depends on the context of the function. 183*/ 184 185/*! 186 \typedef typedef uint32 type_code 187 \brief Represents a certain type of data. See TypeConstants.h for possible 188 values. 189*/ 190 191/*! 192 \typedef typedef uint32 perform_code 193 \brief Unused. Defined by Be to support 'hidden' commands or 194 extensions to classes. The Haiku API has none of these. 195*/ 196 197//! @} 198 199//////////////// Odds and ends 200 201/*! 202 \var const char *B_EMPTY_STRING 203 \brief Defines an empty string. Currently defined as the C-string "". 204*/ 205 206/*! 207 \def min_c(a,b) 208 \brief Returns the minimum of the values a and b. 209 210 \note When including this header in a C file, use the C equivalent called 211 \c min(a,b). 212*/ 213 214/*! 215 \def max_c(a,b) 216 \brief Returns the maximum of values a and b. 217 218 \note When including this header in a C file, use the C equivalent called 219 \c max(a,b). 220*/ 221 222/*! 223 \def NULL 224 \brief Defines the constant \c NULL if it hasn't been defined anywhere before. 225*/ 226 227/*! 228 \addtogroup support_globals 229*/ 230 231//! @{ 232 233/*! 234 \fn int32 atomic_set(vint32 *value, int32 newValue) 235 \brief Undocumented. 236 \sa atomic_set64() for a version that works on \c long \c long 237 \sa atomic_test_and_set(), atomic_add(), atomic_and(), 238 atomic_or(), atomic_get() 239*/ 240 241/*! 242 \fn int32 atomic_test_and_set(vint32 *value, int32 newValue, int32 testAgainst) 243 \brief Undocumented. 244 \sa atomic_test_and_set64() for a version that works on \c long \c long 245 \sa atomic_set(), atomic_add(), atomic_and(), 246 atomic_or(), atomic_get() 247*/ 248 249/*! 250 \fn int32 atomic_add(vint32 *value, int32 addValue) 251 \brief Undocumented. 252 \sa atomic_add64() for a version that works on \c long \c long 253 \sa atomic_set(), atomic_test_and_set(), atomic_and(), 254 atomic_or(), atomic_get() 255*/ 256 257/*! 258 \fn int32 atomic_and(vint32 *value, int32 andValue) 259 \brief Undocumented. 260 \sa atomic_and64() for a version that works on \c long \c long 261 \sa atomic_set(), atomic_test_and_set(), atomic_add(), 262 atomic_or(), atomic_get() 263*/ 264 265 266/*! 267 \fn int32 atomic_or(vint32 *value, int32 orValue) 268 \brief Undocumented. 269 \sa atomic_or64() for a version that works on \c long \c long 270 \sa atomic_set(), atomic_test_and_set(), atomic_add(), atomic_and(), 271 atomic_get() 272*/ 273 274/*! 275 \fn int32 atomic_get(vint32 *value) 276 \brief Undocumented. 277 \sa atomic_get64() for a version that works on \c long \c long 278 \sa atomic_set(), atomic_test_and_set(), atomic_add(), atomic_and(), 279 atomic_or() 280*/ 281 282/*! 283 \fn int64 atomic_set64(vint64 *value, int64 newValue) 284 \brief Undocumented. 285 \sa atomic_set() for a version that works on an \c int32 286 \sa atomic_test_and_set64(), atomic_add64(), atomic_and64(), 287 atomic_or64(), atomic_get64() 288*/ 289 290/*! 291 \fn int64 atomic_test_and_set64(vint64 *value, int64 newValue, int64 testAgainst) 292 \brief Undocumented. 293 \sa atomic_test_and_set() for a version that works on an \c int32 294 \sa atomic_set64(), atomic_add64(), atomic_and64(), 295 atomic_or64(), atomic_get64() 296*/ 297 298/*! 299 \fn int64 atomic_add64(vint64 *value, int64 addValue) 300 \brief Undocumented. 301 \sa atomic_add() for a version that works on an \c int32 302 \sa atomic_set64(), atomic_test_and_set64(), atomic_and64(), 303 atomic_or64(), atomic_get64() 304*/ 305 306/*! 307 \fn int64 atomic_and64(vint64 *value, int64 andValue) 308 \brief Undocumented. 309 \sa atomic_and() for a version that works on an \c int32 310 \sa atomic_set64(), atomic_test_and_set64(), atomic_add64(), 311 atomic_or64(), atomic_get64() 312*/ 313 314/*! 315 \fn int64 atomic_or64(vint64 *value, int64 orValue) 316 \brief Undocumented. 317 \sa atomic_or() for a version that works on an \c int32 318 \sa atomic_set64(), atomic_test_and_set64(), atomic_add64(), atomic_and64(), 319 atomic_get64() 320*/ 321 322/*! 323 \fn int64 atomic_get64(vint64 *value) 324 \brief Undocumented. 325 \sa atomic_get() for a version that works on an \c int32 326 \sa atomic_set64(), atomic_test_and_set64(), atomic_add64(), atomic_and64(), 327 atomic_or64() 328*/ 329 330//! @} 331 332/*! 333 \fn void* get_stack_frame(void) 334 \brief This is internal, I guess. Else this needs to be documented. 335 \internal 336*/ 337 338//! @{ 339 340/*! 341 \def FALSE 342 \brief Obsolete. Use \c false. 343*/ 344 345/*! 346 \def TRUE 347 \brief Obsolete. Use \c true. 348*/ 349 350//! @} 351