Banjo API 0.0.1
C99 game development API
Loading...
Searching...
No Matches
Core

Files

file  assert.h

Data Structures

struct  bj_build_info

Macros

#define BJ_VERSION_MAJOR(version)
#define BJ_VERSION_MINOR(version)
#define BJ_VERSION_PATCH(version)
#define BJ_MAKE_VERSION(major, minor, patch)
#define BJ_VERSION_MAJOR_NUMBER   0
#define BJ_VERSION_MINOR_NUMBER   1
#define BJ_VERSION_PATCH_NUMBER   0
#define BJ_VERSION   BJ_MAKE_VERSION(BJ_VERSION_MAJOR_NUMBER, BJ_VERSION_MINOR_NUMBER, BJ_VERSION_PATCH_NUMBER)
#define BJ_NAME   "Banjo"
#define BJ_FALSE   ((bj_bool)0)
#define BJ_TRUE   ((bj_bool)1)

Typedefs

typedef uint32_t bj_bool

Functions

const bj_build_infobj_build_information (void)

Platform detection

One of these will be defined to indicate the target OS.

#define BJ_OS_UNKNOWN

Compiler detection

One of these will be defined to indicate the compiler in use.

Additionally BJ_COMPILER_NAME and BJ_COMPILER_VERSION are provided.

#define BJ_COMPILER_NAME   "Doxygen"
#define BJ_COMPILER_VERSION   0

Build configuration

Exactly one of BJ_BUILD_DEBUG or BJ_BUILD_RELEASE is defined.

#define BJ_BUILD_RELEASE
#define BJ_BUILD_DEBUG

Export/visibility helpers

BANJO_EXPORT marks public symbols.

BANJO_NO_EXPORT hides symbols.

#define BANJO_EXPORT
#define BANJO_NO_EXPORT

Restrict qualifier macro

#define BJ_RESTRICT   restrict

Array parameter helper macros

#define BJ_CONST_ARRAY(T, n, name)
#define BJ_ARRAY(T, n, name)
#define BJ_CONST_ARRAY_2D(T, n, m, name)
#define BJ_ARRAY_2D(T, n, m, name)

Inline helper macro

#define BJ_INLINE   inline

Detailed Description

General-purpose API.


Data Structure Documentation

◆ bj_build_info

struct bj_build_info

Structure holding build information of the binary.

Data Fields
const char * compiler_name Compiler name string.
int compiler_version Compiler version number.
bj_bool config_checks_abort Checks abort execution on failure.
bj_bool config_checks_log Checks log failures.
bj_bool config_fastmath Built with fast-math optimizations.
bj_bool config_log_color Colored log output enabled.
bj_bool config_pedantic Extra runtime checks enabled.
bj_bool debug Non-zero if built with debug info.
bj_bool feature_alsa Built with ALSA audio.
bj_bool feature_emscripten Built with Emscripten support.
bj_bool feature_mme Built with Windows MME audio.
bj_bool feature_win32 Built with Win32 window support.
bj_bool feature_x11 Built with X11 window support.
const char * p_name API name (see BJ_NAME).
uint32_t version Packed API version (see BJ_VERSION).

Macro Definition Documentation

◆ BANJO_EXPORT

#define BANJO_EXPORT

◆ BANJO_NO_EXPORT

#define BANJO_NO_EXPORT

◆ BJ_ARRAY

#define BJ_ARRAY ( T,
n,
name )
Value:
T name[BJ_RESTRICT static (n)]
#define BJ_RESTRICT
BJ_RESTRICT expands to the appropriate restrict qualifier per toolchain.
Definition api.h:183

◆ BJ_ARRAY_2D

#define BJ_ARRAY_2D ( T,
n,
m,
name )
Value:
T name[BJ_RESTRICT static (n)][m]

Expands to array parameter declarations appropriate for the toolchain.

BJ_CONST_ARRAY/BJ_ARRAY are 1-D. BJ_CONST_ARRAY_2D/BJ_ARRAY_2D are 2-D (rows=n, cols=m).

◆ BJ_BUILD_DEBUG

#define BJ_BUILD_DEBUG

Set when Banjo was built on debug mode (NDEBUG not defined).

◆ BJ_BUILD_RELEASE

#define BJ_BUILD_RELEASE

Set when Banjo was built on release mode (NDEBUG defined).

◆ BJ_COMPILER_NAME

#define BJ_COMPILER_NAME   "Doxygen"

◆ BJ_COMPILER_VERSION

#define BJ_COMPILER_VERSION   0

◆ BJ_CONST_ARRAY

#define BJ_CONST_ARRAY ( T,
n,
name )
Value:
const T name[BJ_RESTRICT static (n)]

◆ BJ_CONST_ARRAY_2D

#define BJ_CONST_ARRAY_2D ( T,
n,
m,
name )
Value:
const T name[BJ_RESTRICT static (n)][m]

◆ BJ_FALSE

#define BJ_FALSE   ((bj_bool)0)

Boolean false value (0).

See also
bj_bool
BJ_TRUE

◆ BJ_INLINE

#define BJ_INLINE   inline

BJ_INLINE expands to an inline specifier appropriate for the toolchain.

If BJ_API_FORCE_INLINE is defined, stronger inlining is requested.

◆ BJ_MAKE_VERSION

#define BJ_MAKE_VERSION ( major,
minor,
patch )
Value:
((((uint32_t)(major)) << 22U) | (((uint32_t)(minor)) << 12U) | ((uint32_t)(patch)))

Construct a packed 32-bit version value: [major:10 | minor:10 | patch:12].

Parameters
majorMajor version in [0, 1023].
minorMinor version in [0, 1023].
patchPatch version in [0, 4095].
Returns
Packed version suitable for BJ_VERSION_* macros.

◆ BJ_NAME

#define BJ_NAME   "Banjo"

Library name string.

◆ BJ_OS_UNKNOWN

#define BJ_OS_UNKNOWN

◆ BJ_RESTRICT

#define BJ_RESTRICT   restrict

BJ_RESTRICT expands to the appropriate restrict qualifier per toolchain.

◆ BJ_TRUE

#define BJ_TRUE   ((bj_bool)1)

Boolean true value (1).

See also
bj_bool
BJ_FALSE

◆ BJ_VERSION

Current API version as a packed 32-bit representation.

◆ BJ_VERSION_MAJOR

#define BJ_VERSION_MAJOR ( version)
Value:
(((version) >> 22U) & 0x3FFU)

Extract major version from a 32-bit version value.

Parameters
versionPacked version from BJ_MAKE_VERSION.
Returns
Major version in [0, 1023].

◆ BJ_VERSION_MAJOR_NUMBER

#define BJ_VERSION_MAJOR_NUMBER   0

Current major version number.

◆ BJ_VERSION_MINOR

#define BJ_VERSION_MINOR ( version)
Value:
(((version) >> 12U) & 0x3FFU)

Extract minor version from a 32-bit version value.

Parameters
versionPacked version from BJ_MAKE_VERSION.
Returns
Minor version in [0, 1023].

◆ BJ_VERSION_MINOR_NUMBER

#define BJ_VERSION_MINOR_NUMBER   1

Current minor version number.

◆ BJ_VERSION_PATCH

#define BJ_VERSION_PATCH ( version)
Value:
((version) & 0xFFFU)

Extract patch version from a 32-bit version value.

Parameters
versionPacked version from BJ_MAKE_VERSION.
Returns
Patch version in [0, 4095].

◆ BJ_VERSION_PATCH_NUMBER

#define BJ_VERSION_PATCH_NUMBER   0

Current patch version number.

Typedef Documentation

◆ bj_bool

typedef uint32_t bj_bool

Boolean type used throughout the Banjo API.

Defined as a 32-bit unsigned integer for portability and ABI clarity.

See also
BJ_FALSE
BJ_TRUE

Function Documentation

◆ bj_build_information()

const bj_build_info * bj_build_information ( void )

Get runtime build information for the loaded Banjo binaries.

The returned pointer is owned by the library and remains valid for the lifetime of the process. The content is immutable.

Returns
Pointer to a bj_build_info structure describing the runtime build.