Skip to content

env

core

Environment.
More...


Data Structures

struct   morapi_Env

Typedefs

typedef morapi_Result(*  morapi_LogFunc) (void *, const morapi_Char *,...)
typedef morapi_Result(*  morapi_FlushFunc) (void *)

Enumerations

enum   morapi_LogLevel {
  MORAPI_LOG_LEVEL_DEBUG = 0, MORAPI_LOG_LEVEL_INFO = 1, MORAPI_LOG_LEVEL_WARN = 2, MORAPI_LOG_LEVEL_ERROR = 3,
  MORAPI_LOG_LEVEL_MSG = 4
}

Memory allocation

#define  MORAPI_SAFE_FREE(ENV, P)

Logging

#define  MORAPI_LOG_DEBUG(ENV, FORMAT, ...)
#define  MORAPI_LOG_INFO(ENV, FORMAT, ...)
#define  MORAPI_LOG_WARN(ENV, FORMAT, ...)
#define  MORAPI_LOG_ERROR(ENV, FORMAT, ...)
#define  MORAPI_LOG_ERROR_IF(ENV, COND, STATEMENT)
void  (morapi_Env *self, const morapi_Char *i_module, const morapi_Char *i_fmt,...)
void  (morapi_Env *self, const morapi_Char *i_module, const morapi_Char *i_fmt,...)


Detailed Description

Environment.


Macro Definition Documentation


MORAPI_SAFE_FREE

#define MORAPI_SAFE_FREE( ENV,
                          P)

Deallocates P if it is not NULL, and then P is set NULL.

Parameters

  • ENV : the environment (morapi_Env*).
  • P : the pointer to deallocate (void*).


MORAPI_LOG_DEBUG

#define MORAPI_LOG_DEBUG( ENV,
                          FORMAT,
                          ...)

Logs a debug message if MORAPI_ENABLE_LOG_DEBUG is defined.


MORAPI_LOG_INFO

#define MORAPI_LOG_INFO( ENV,
                         FORMAT,
                         ...)

Logs an information message.


MORAPI_LOG_WARN

#define MORAPI_LOG_WARN( ENV,
                         FORMAT,
                         ...)

Logs a warning message.


MORAPI_LOG_ERROR

#define MORAPI_LOG_ERROR( ENV,
                          FORMAT,
                          ...)

Logs an error message.


MORAPI_LOG_ERROR_IF

#define MORAPI_LOG_ERROR_IF( ENV,
                             COND,
                             STATEMENT)

If COND is true, executes STATEMENT and logs an error message.


Typedef Documentation


morapi_LogFunc

typedef morapi_Result(* morapi_LogFunc) (void *, const morapi_Char *,...)

Log function.

Compatible with fprintf().


test_decompose_api.c, and test_prof_api.c.


morapi_FlushFunc

typedef morapi_Result(* morapi_FlushFunc) (void *)

Message flush function compatible with fflush().


test_decompose_api.c, and test_prof_api.c.


Enumeration Type Documentation


morapi_LogLevel

enum morapi_LogLevel

Log level.

Enumerator
MORAPI_LOG_LEVEL_DEBUG 

debug log.

MORAPI_LOG_LEVEL_INFO 

information.

MORAPI_LOG_LEVEL_WARN 

warning.

MORAPI_LOG_LEVEL_ERROR 

error log .

MORAPI_LOG_LEVEL_MSG 

message log (no header).