Neonode zForce(TM) SDK
OsAbstractionLayer.h
Go to the documentation of this file.
1 
12 #ifndef ZFORCE_OSABSTRACTIONLAYER_H
13 #define ZFORCE_OSABSTRACTIONLAYER_H
14 
15 #ifndef ZFORCECOMMON_H
16  #error Please include "zForceCommon.h" before this file.
17 #endif // ZFORCECOMMON_H
18 
19 typedef void zForceMutex;
20 typedef void zForceSemaphore;
21 typedef void zForceThread;
22 
25 {
27  void ( * EntryPoint)(void *);
28  void * Arguments;
29 };
30 
39 {
52  void * ( * Malloc)(size_t size);
53 
63  void ( * Free)(void * memoryPointer);
64 
76  void * ( * Realloc)(void * memoryPointer, size_t size);
77 
91  bool ( * InitializeMutex)(zForceMutex ** zForceMutex);
92 
106  bool ( * LockMutex)(zForceMutex * zForceMutex);
107 
121  bool ( * UnlockMutex)(zForceMutex * zForceMutex);
122 
136  bool ( * DestroyMutex)(zForceMutex * zForceMutex);
137 
157  bool ( * InitializeSemaphore)
158  (zForceSemaphore ** zForceSemaphore, uint32_t initialValue);
159 
177  bool ( * WaitForSemaphore)(zForceSemaphore * zForceSemaphore,
178  uint32_t timeoutMs);
179 
194  bool ( * IncrementSemaphore)(zForceSemaphore * zForceSemaphore);
195 
210  bool ( * DestroySemaphore)(zForceSemaphore * zForceSemaphore);
211 
222  uint64_t ( * GetTimeMilliSeconds)(void);
223 
240  bool ( * CreateThread)(zForceThread ** zForceThread,
241  void ( * entryPoint)(void *),
242  void * arguments);
243 
258  bool ( * WaitForThreadExit)(zForceThread * zForceThread);
259 
270  void ( * Sleep)(uint32_t milliSeconds);
271 };
272 
273 DLLINTERNAL bool OsAbstractionLayer_Initialize (
274  OsAbstractionLayer * osAbstractionLayer,
275  OsAbstractionLayer * userSuppliedOsAbstractionLayer);
276 
277 DLLINTERNAL void OsAbstractionLayer_ThreadWrapper (
278  zForceThreadWrapper * wrapper);
279 
280 #endif // ZFORCE_OSABSTRACTIONLAYER_H
281 
void zForceMutex
Typecast to underlying (system) type.
Definition: OsAbstractionLayer.h:19
Overrides for OS Functions.
Definition: OsAbstractionLayer.h:38
void zForceSemaphore
Typecast to underlying (system) type.
Definition: OsAbstractionLayer.h:20
Definition: OsAbstractionLayer.h:24
void zForceThread
Typecast to underlying (system) type.
Definition: OsAbstractionLayer.h:21