Neonode zForce(TM) SDK

Classes | Macros | Typedefs | Functions
zForce.h File Reference

Main structure for the SDK library. More...

Go to the source code of this file.

## Classes
struct | zForce
| Main struct. More...

## Macros
#define | zForceErrno (*zForce_ErrnoLocation())
| Macro to retrieve (or set) the errno value. Works the same as normal errno.

## Typedefs
typedef struct zForce | zForce

## Functions
DLLEXTERNAL zForce * | zForce_GetInstance (void)
| Get a zForce Instance. More...
DLLEXTERNAL bool | zForce_Initialize (OsAbstractionLayer *osAbstractionLayer)
| Initializes zForce. More...
DLLEXTERNAL void | zForce_Uninitialize (void)
| Uninitializes zForce. More...
DLLEXTERNAL int * | zForce_ErrnoLocation (void)
| Retrieves a pointer to the zForce errno. More...

## Detailed Description

Main structure for the SDK library.

This structure contains the overrides and is always instantiated at the beginning of execution when using the library.

Copyright
  COPYRIGHT NOTICE: (c) 2017-2022 Neonode Technologies AB. All rights reserved.

## Typedef Documentation

## ◆ zForce

typedef struct zForce zForce

See also
  struct zForce

## Function Documentation

## ◆ zForce_ErrnoLocation()

DLLEXTERNAL int* zForce_ErrnoLocation | ( | void |  | ) |

Retrieves a pointer to the zForce errno.

Retrieves the pointer to the errno value of the C library the zForce SDK was compiled with, which is not always the same as the program utilizing the zForce SDK was compiled with. Example of this is if you in Windows compile your program in Debug mode. The zForce SDK DLL will access one errno, and the application has a separate errno value.

Returns
  A pointer to the errno value.

## ◆ zForce_GetInstance()

DLLEXTERNAL zForce* zForce_GetInstance | ( | void |  | ) |

Get a zForce Instance.

Get a zForceInstance. This is a singleton so subsequent calls returns the same instance.
On failure, errno is set.

- EZFORCENOTINITIALIZED - zForce not initialized.
- EMUTEXNOTINITIALIZED - Internal Error. Mutex not initialized.
- EMUTEXLOCKFAILED - Internal Error. Mutex Lock failed.

Returns
  Pointer to zForce structure.

## ◆ zForce_Initialize()

DLLEXTERNAL bool zForce_Initialize | ( | OsAbstractionLayer * | osAbstractionLayer | ) |

Initializes zForce.

Initializes the zForce SDK. Must be called only once.
On error, errno is set.

- EALREADYINITIALIZED - zForce_Initialize has already been called.
- EMUTEXINITIALIZATIONFAILED - Failed initializing mutex.
- EZFORCEINITIALIZATIONFAILED - zForce Initialization failed.
- EZFORCENOTINITIALIZED - zForce not Initialized.

Parameters

  osAbstractionLayer | Pointer to OsAbstractionLayer instance or NULL. Non-NULL members of the OsAbstractionLayer are copied so the supplied instance of OsAbstractionLayer can be freed by the caller after this call returns. If this argument is NULL, or any members of the supplied OsAbstractionLayer instance are NULL, default / OS specific functions are used instead.

Returns
  True if successful, false if not, and errno set accordingly. See above for errno values.

## ◆ zForce_Uninitialize()

DLLEXTERNAL void zForce_Uninitialize | ( | void |  | ) |

Uninitializes zForce.

Unitializes zForce, freeing all allocated resources. No part of the zForce SDK should be used after this call.
On failure, errno is set.

- EMUTEXDESTROYFAILED - Mutex Destroy failed.
- EBADMUTEX - Bad Mutex pointer.

Returns
  No return value.