Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
|
#include "precompiled.h"
#include "lib/status.h"
#include <cstring>
#include <cstdio>
#include "lib/posix/posix_errno.h"
Functions | |
StatusDefinitionBucket * | StatusAddDefinitions (StatusDefinitionBucket *bucket) |
(called via STATUS_ADD_DEFINITIONS) More... | |
static const StatusDefinition * | DefinitionFromStatus (Status status) |
static const StatusDefinition * | DefinitionFromErrno (int errno_equivalent) |
wchar_t * | StatusDescription (Status status, wchar_t *buf, size_t max_chars) |
generate textual description of a Status. More... | |
int | ErrnoFromStatus (Status status) |
Status | StatusFromErrno () |
STATUS_ADD_DEFINITIONS (statusDefs) | |
Variables | |
static StatusDefinitionBucket * | buckets |
static const StatusDefinition | statusDefs [] |
|
static |
|
static |
int ErrnoFromStatus | ( | Status | status | ) |
used in wposix - underlying functions return Status but must be translated to errno at e.g. the mmap interface level. higher-level code that calls mmap will in turn convert back to Status.
STATUS_ADD_DEFINITIONS | ( | statusDefs | ) |
StatusDefinitionBucket * StatusAddDefinitions | ( | StatusDefinitionBucket * | bucket | ) |
(called via STATUS_ADD_DEFINITIONS)
bucket | is being added; its definitions and numDefinitions must already be initialized. |
(this function must be callable as a static initializer; initializing next avoids the need for a separate dummy variable)
wchar_t * StatusDescription | ( | Status | status, |
wchar_t * | buf, | ||
size_t | max_chars | ||
) |
generate textual description of a Status.
buf | destination buffer (allows generating strings with the code's numerical value if no definition is found) |
max_chars | size of buffer [characters] |
Status StatusFromErrno | ( | ) |
NB: reset errno to 0 before calling POSIX functions to avoid confusion with previous errors.
|
static |
|
static |