hunting/hal/include/i_hal.h
2023-08-13 01:38:14 -07:00

34 lines
851 B
C

#ifndef I_HAL_H
#define I_HAL_H
#include "ReturnCode.h"
/*
** Make sure we can call this stuff from C++.
*/
#ifdef __cplusplus
extern "C"
{
#endif
typedef struct i_hal IHal;
typedef struct i_hal
{
RETURN_CODE_C (*init)(IHal *);
void (*free)(IHal *);
RETURN_CODE_C (*un_init)(IHal *);
} IHal;
IHal *get_hal_instance(void);
RETURN_CODE_C new_i_hal(IHal **object);
void reset_hal_impl(IHal *impl);
static inline RETURN_CODE_C i_hal_init(void)
{
return get_hal_instance()->init(get_hal_instance());
}
static inline RETURN_CODE_C i_hal_un_init(void)
{
return get_hal_instance()->un_init(get_hal_instance());
}
RETURN_CODE_C create_hal_module(void);
RETURN_CODE_C destroy_hal_module(void);
#ifdef __cplusplus
}
#endif
#endif