-
Notifications
You must be signed in to change notification settings - Fork 0
/
magic_interface.h
27 lines (23 loc) · 835 Bytes
/
magic_interface.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
#ifndef MAGIC_INTERFACE
#define MAGIC_INTERFACE
#ifdef __cplusplus
extern "C" {
#endif
/* The purpose of declaring a struct in a header file without
* defining it is to allow other source files that include the header
* to use pointers to the struct without needing to know the full
* definition of the struct. This technique is commonly used in C and
* C++ to create a "opaque" type, where the details of the struct are
* hidden from external code. This can be useful for encapsulating
* data and behavior within a library or module, and only exposing a
* limited interface to the outside world.
*/
struct MHandler;
typedef struct MHandler MHandler_t;
MHandler_t *create_magic(int);
int getValue_magic(MHandler_t *);
void destroy_magic(MHandler_t *);
#ifdef __cplusplus
}
#endif
#endif /* MAGIC_INTERFACE */