-
Notifications
You must be signed in to change notification settings - Fork 0
/
module.h
55 lines (44 loc) · 1.41 KB
/
module.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef __MYBMM_MODULE_H
#define __MYBMM_MODULE_H
#include "config.h"
#if 0
/* Forward dec */
struct mybmm_module;
#endif
typedef int (*mybmm_module_open_t)(void *);
typedef int (*mybmm_module_read_t)(void *,...);
typedef int (*mybmm_module_write_t)(void *,...);
typedef int (*mybmm_module_close_t)(void *);
typedef int (*mybmm_module_control_t)(void *,...);
struct mybmm_module {
int type;
char *name;
unsigned short capabilities;
int (*init)(mybmm_config_t *);
// void *(*new)(mybmm_config_t *,mybmm_pack_t *,mybmm_module_t *);
void *(*new)(mybmm_config_t *,...);
mybmm_module_open_t open;
mybmm_module_read_t read;
mybmm_module_write_t write;
mybmm_module_close_t close;
int (*free)(void *);
int (*shutdown)(void *);
mybmm_module_control_t control;
mybmm_module_control_t config;
};
typedef struct mybmm_module mybmm_module_t;
#define MYBMM_MODULE_CAPABILITY_CONTROL 0x01
#define MYBMM_MODULE_CAPABILITY_CONFIG 0x02
//mybmm_module_t *mybmm_get_module(mybmm_config_t *conf, char *name, int type);
//mybmm_module_t *mybmm_load_module(mybmm_config_t *conf, char *name, int type);
mybmm_module_t *mybmm_load_module(mybmm_config_t *conf, char *name, int type);
enum MYBMM_MODTYPE {
MYBMM_MODTYPE_INVERTER,
MYBMM_MODTYPE_CELLMON,
MYBMM_MODTYPE_TRANSPORT,
MYBMM_MODTYPE_DB,
};
#ifndef EXPORT_API
#define EXPORT_API __attribute__ ((visibility("default")))
#endif
#endif /* __MYBMM_MODULE_H */