Skip to content

core

Core module.
More...


Modules

  dll
  env

Typedefs

typedef signed char  morapi_Int8
typedef unsigned char  morapi_Uint8
typedef signed short int  morapi_Int16
typedef unsigned short int  morapi_Uint16
typedef signed int  morapi_Int32
typedef unsigned int  morapi_Uint32
typedef signed long long int  morapi_Int64
typedef unsigned long long int  morapi_Uint64
typedef void *  morapi_ThreadId
typedef morapi_Uint16  morapi_Float16
typedef float  morapi_Float32
typedef double  morapi_Float64
typedef morapi_Uint32  morapi_Bool
typedef morapi_Int32  morapi_F32
typedef char  morapi_Char
typedef morapi_Int32  morapi_Result
typedef double  morapi_Real

Enumerations

enum   morapi_DType {
  MORAPI_DTYPE_NONE = 0x00000000, MORAPI_DTYPE_UINT8 = 0x00000001, MORAPI_DTYPE_UINT16 = 0x00000002, MORAPI_DTYPE_UINT32 = 0x00000004,
  MORAPI_DTYPE_UINT64 = 0x00000008, MORAPI_DTYPE_INT8 = 0x00000101, MORAPI_DTYPE_INT16 = 0x00000102, MORAPI_DTYPE_INT32 = 0x00000104,
  MORAPI_DTYPE_INT64 = 0x00000108, MORAPI_DTYPE_FLOAT16 = 0x00001102, MORAPI_DTYPE_FLOAT32 = 0x00001104, MORAPI_DTYPE_FLOAT64 = 0x00001108,
  MORAPI_DTYPE_QUINT8 = 0x00003001, MORAPI_DTYPE_QINT8 = 0x00003101, MORAPI_DTYPE_QUINT32 = 0x00003004, MORAPI_DTYPE_QINT32 = 0x00003104,
  MORAPI_DTYPE_CHAR = 0x00010001, MORAPI_DTYPE_BOOL = 0x00010004, MORAPI_DTYPE_GENERIC = 0x00011104
}

Functions

const morapi_Char morapi_DTypeToText (morapi_DType self)
morapi_DType  morapi_TextToDType (const morapi_Char *i_str)
morapi_Env morapi_genv (void)


Detailed Description

Core module.


Typedef Documentation


morapi_Int8

typedef signed char morapi_Int8

8 bits signed integer.


morapi_Uint8

typedef unsigned char morapi_Uint8

8 bits unsigned integer.


morapi_Int16

typedef signed short int morapi_Int16

16 bits signed integer.


morapi_Uint16

typedef unsigned short int morapi_Uint16

16 bits unsigned integer.


morapi_Int32

typedef signed int morapi_Int32

32 bits signed integer.


morapi_Uint32

typedef unsigned int morapi_Uint32

32 bits unsigned integer.


morapi_Int64

typedef signed long long int morapi_Int64

64 bits signed integer.


morapi_Uint64

typedef unsigned long long int morapi_Uint64

64 bits unsigned integer.


morapi_ThreadId

typedef void* morapi_ThreadId

Thread id.


morapi_Float16

typedef morapi_Uint16 morapi_Float16

16 bits floating-point number.


morapi_Float32

typedef float morapi_Float32

32 bits floating-point number.


morapi_Float64

typedef double morapi_Float64

64 bits floating point number.


morapi_Bool

typedef morapi_Uint32 morapi_Bool

Boolean.

Contant Value
MORAPI_TRUE (1)
MORAPI_FALSE (0)


morapi_F32

typedef morapi_Int32 morapi_F32

17.15 bits fixed-point number.


morapi_Char

typedef char morapi_Char

Charactor and string literal.


morapi_Result

typedef morapi_Int32 morapi_Result

Result.

Every function returns this type.

Constant Value Description
MORAPI_OK (0x00000000) Completes succesfully.
MORAPI_INPROGRESS (0x00000001) In progress.
MORAPI_CANCELED (0x00000002) Canceled.
MORAPI_ERROR (0x80000000) Fails.
MORAPI_ERROR_PARAM (0xC0000000) Parameters are invalid.
MORAPI_ERROR_STATE (0xA0000000) An internal state is invalid.
MORAPI_ERROR_MALLOC (0x90000000) Memory allocation error.
MORAPI_ERROR_IO (0x88000000) Input/output error.
MORAPI_ERROR_UNSUPPORTED (0x84000000) Unsupported operation.
MORAPI_ERROR_TIMEOUT (0x82000000) Time-out.
MORAPI_ERROR_UNKNOWN (0xC0000100) Unknown error.


morapi_Real

typedef double morapi_Real

A real number.


Enumeration Type Documentation


morapi_DType

enum morapi_DType

Data type.

Each bit represents the followng.

31-2827-2423-2019-1615-1211-87-43-0Description
xxxxxxxxdata size.
xxxxunsigned (0) or signed (1).
xxxxfixed (0), float (1) or quantized (3).
xxxxnormal (0) or extended (1).

For example, MORAPI_DTYPE_FLOAT16 (= 0x00001102) means

  • data size: 2
  • signed (1)
  • float (1)
  • normal (0)
Enumerator
MORAPI_DTYPE_NONE 

None.

MORAPI_DTYPE_UINT8 

Uint8.

MORAPI_DTYPE_UINT16 

Uint16.

MORAPI_DTYPE_UINT32 

Uint32.

MORAPI_DTYPE_UINT64 

Uint64.

MORAPI_DTYPE_INT8 

Int8.

MORAPI_DTYPE_INT16 

Int16.

MORAPI_DTYPE_INT32 

Int32.

MORAPI_DTYPE_INT64 

Int64.

MORAPI_DTYPE_FLOAT16 

Float16.

MORAPI_DTYPE_FLOAT32 

Float32.

MORAPI_DTYPE_FLOAT64 

Float64.

MORAPI_DTYPE_QUINT8 

Quint8.

MORAPI_DTYPE_QINT8 

Qint8.

MORAPI_DTYPE_QUINT32 

Quint32.

MORAPI_DTYPE_QINT32 

Qint32.

MORAPI_DTYPE_CHAR 

Char.

MORAPI_DTYPE_BOOL 

Bool.

MORAPI_DTYPE_GENERIC 

Generic (Float32).


Function Documentation


morapi_DTypeToText()

const morapi_Char* morapi_DTypeToText (morapi_DType self)

Converts a data type to a text.


morapi_TextToDType()

morapi_DType morapi_TextToDType (const morapi_Char * i_str)

Converts a text to a data type.


morapi_genv()

morapi_Env* morapi_genv (void )

Gets the global environment.