std1.0.0-beta-7 SafeC docs

std :: audio::audio_error

Struct std::AudioError

#include <std/audio/audio_error.h> source

struct AudioError {
    int code;
    char message[AUDIO_ERROR_MESSAGE_MAX];
}

Fields

§int codesource

AUDIO_OK or AUDIO_ERR_*

NUL-terminated, "" when ok

Methods

§static struct AudioError none()source · definition

AUDIO_OK, empty message.

§static struct AudioError make(int code, const &char message)source · definition

'code' with 'message' (truncated to fit).

§static struct AudioError make2(int code, const &char prefix, const &char detail)source · definition

'code' with "<prefix>: <detail>" — the usual "what failed: why".

§static struct AudioError make_code(int code, const &char prefix, long long value)source · definition

'code' with "<prefix> (<value>)", e.g. an HRESULT or OSStatus.

§int ok() constsource · definition

1 when code is AUDIO_OK or AUDIO_ERR_WARNING

§int failed() constsource · definition

!ok()