Adaptive Framework  0.9.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Files | Functions

Files

file  afw_os.h
 Adaptive Framework OS Specific Header for unix-like systems.
 

Functions

void afw_os_environment_initialize (afw_xctx_t *xctx)
 afw_os environment initialize More...
 
afw_uint32_t afw_os_get_pid ()
 Return a process id or similar number. More...
 
const afw_utf8_tafw_os_get_dso_suffix ()
 Return the suffix appended to dso file names for this system. More...
 
const afw_log_tafw_os_log_create (const afw_object_t *properties, const afw_pool_t *p, afw_xctx_t *xctx)
 Create an instance of the OS log. More...
 
const afw_log_factory_tafw_os_log_factory_get ()
 Get the factory for OS log. More...
 
const afw_utf8_tafw_os_backtrace (afw_error_code_t code, int max_backtrace, afw_xctx_t *xctx)
 Provide a backtrace if possible. More...
 

Detailed Description

OS specific functions

Function Documentation

◆ afw_os_backtrace()

const afw_utf8_t* afw_os_backtrace ( afw_error_code_t  code,
int  max_backtrace,
afw_xctx_t xctx 
)

Provide a backtrace if possible.

Parameters
codeError code or 0. Code afw_error_code_memory or others might influence whether producing backtrace is possible.
max_backtrace.
xctxof caller.
Returns
backtrace or NULL if not possible.

IMPORTANT Implementation of this function must not do anything that might throw an error or change xctx->error or a recursive error producing a stack overflow will occur.

If max_backtrace is -1 or greater than the implementation's max, the max is used. If 0 is specifed, no trace occurs.

Definition at line 729 of file nix/afw_os.c.

◆ afw_os_environment_initialize()

void afw_os_environment_initialize ( afw_xctx_t xctx)

afw_os environment initialize

Parameters
xctxof caller

This is called when the Adaptive Framework is being initialized. Pool xctx->p will last for the life of the environment. Any afw_environment_register functions can be called from here. One possible use is to register an afw_log_factory so that the system's log can be configured by environment configuration.

Definition at line 607 of file nix/afw_os.c.

◆ afw_os_get_dso_suffix()

const afw_utf8_t* afw_os_get_dso_suffix ( )

Return the suffix appended to dso file names for this system.

Returns
suffix such as ".so" or ".dll".

Definition at line 643 of file nix/afw_os.c.

◆ afw_os_get_pid()

afw_uint32_t afw_os_get_pid ( )

Return a process id or similar number.

Returns
process id or similar number specific to system.

Definition at line 174 of file win/afw_os.c.

◆ afw_os_log_create()

const afw_log_t* afw_os_log_create ( const afw_object_t properties,
const afw_pool_t p,
afw_xctx_t xctx 
)

Create an instance of the OS log.

Parameters
properties
pto use for log's resources.
xctxof caller.
Returns
log instance

Definition at line 75 of file nix/afw_os_log.c.

◆ afw_os_log_factory_get()

const afw_log_factory_t* afw_os_log_factory_get ( )

Get the factory for OS log.

Returns
factory singleton instance.

Definition at line 67 of file nix/afw_os_log.c.