diff options
Diffstat (limited to 'client/libacron/include')
-rw-r--r-- | client/libacron/include/ids.h | 4 | ||||
-rw-r--r-- | client/libacron/include/incl.h | 14 | ||||
-rw-r--r-- | client/libacron/include/libac.h | 7 | ||||
-rw-r--r-- | client/libacron/include/net.h | 7 | ||||
-rw-r--r-- | client/libacron/include/requests.h | 3 |
5 files changed, 27 insertions, 8 deletions
diff --git a/client/libacron/include/ids.h b/client/libacron/include/ids.h index 80e7448..34d312e 100644 --- a/client/libacron/include/ids.h +++ b/client/libacron/include/ids.h @@ -5,6 +5,8 @@ #ifndef LIBAC_IDS_H #define LIBAC_IDS_H +#include "incl.h" + #define AC_TYPE_EVENT 0 /* 0b00000000 */ #define AC_TYPE_REQUEST 64 /* 0b01000000 */ #define AC_TYPE_RESPONSE 128 /* 0b10000000 */ @@ -26,6 +28,6 @@ typedef struct ac_obj { * @param obj Object to free. Must be a valid object. * @return AC_E_OK or an error code. When succeeds, obj is freed and no longer valid. */ -int ac_object_free(ac_obj_t *obj); +LIBAC_EXPORT int ac_object_free(ac_obj_t *obj); #endif /* LIBAC_IDS_H */ diff --git a/client/libacron/include/incl.h b/client/libacron/include/incl.h new file mode 100644 index 0000000..4ac00ab --- /dev/null +++ b/client/libacron/include/incl.h @@ -0,0 +1,14 @@ +/* + * Created by yuuta on 7/21/22. + */ + +#ifndef LIBAC_INCL_H +#define LIBAC_INCL_H + +#ifdef _MSC_VER +#define LIBAC_EXPORT __declspec(dllexport) +#else +#define LIBAC_EXPORT __attribute__ ((visibility ("default"))) extern +#endif + +#endif /* LIBAC_INCL_H */ diff --git a/client/libacron/include/libac.h b/client/libacron/include/libac.h index 542adcb..adf0310 100644 --- a/client/libacron/include/libac.h +++ b/client/libacron/include/libac.h @@ -5,13 +5,14 @@ #ifndef LIBAC_LIBAC_H #define LIBAC_LIBAC_H +#include "incl.h" #include "common.h" #include "events.h" #include "net.h" #include "requests.h" #include "ids.h" -#include <json-c/json_tokener.h> +#include <json_tokener.h> #include <stdio.h> typedef struct libac_config { @@ -23,12 +24,12 @@ typedef struct libac_config { * Initialize libac for the calling thread. * @return AC_E_OK on success. */ -int ac_init(const libac_config_t *config); +LIBAC_EXPORT int ac_init(const libac_config_t *config); /** * Destroy libac configuration for the calling thread. * @return AC_E_OK on success. */ -int ac_free(void); +LIBAC_EXPORT int ac_free(void); #endif /* LIBAC_LIBAC_H */ diff --git a/client/libacron/include/net.h b/client/libacron/include/net.h index 8fb33f8..6d8d9e7 100644 --- a/client/libacron/include/net.h +++ b/client/libacron/include/net.h @@ -5,6 +5,7 @@ #ifndef LIBAC_NET_H #define LIBAC_NET_H +#include "incl.h" #include "common.h" #include "events.h" #include "requests.h" @@ -27,7 +28,7 @@ typedef struct ac_connection_parameters { * @return AC_E_OK or an error code. When failed, *out will be untouched. * MT-Safe */ -int ac_connect(ac_connection_parameters_t parameters, void **out); +LIBAC_EXPORT int ac_connect(ac_connection_parameters_t parameters, void **out); /** * Disconnect the connection. @@ -35,7 +36,7 @@ int ac_connect(ac_connection_parameters_t parameters, void **out); * @return AC_E_OK or an error code. When failed, connection is undefined. When succeeds, connection is freed and invalid. * MT-Unsafe */ -int ac_disconnect(void *connection); +LIBAC_EXPORT int ac_disconnect(void *connection); /** * Blocks the current thread until a new response or event arrives. @@ -43,6 +44,6 @@ int ac_disconnect(void *connection); * @param response Output response of either an event or a response. May be NULL even if it succeeds. * @return AC_E_OK or an error code. When failed, *response is NULL. */ -int ac_receive(void *connection, ac_obj_t **response); +LIBAC_EXPORT int ac_receive(void *connection, ac_obj_t **response); #endif /* LIBAC_NET_H */ diff --git a/client/libacron/include/requests.h b/client/libacron/include/requests.h index 590bb2e..54c414b 100644 --- a/client/libacron/include/requests.h +++ b/client/libacron/include/requests.h @@ -5,6 +5,7 @@ #ifndef LIBAC_REQUESTS_H #define LIBAC_REQUESTS_H +#include "incl.h" #include "common.h" #include "ids.h" #include <stdbool.h> @@ -74,6 +75,6 @@ typedef struct ac_request_set_config { * @return AC_E_OK or an error code. * MT-Unsafe: Must be called on the same thread calling ac_receive(). */ -int ac_request(void *connection, const ac_request_t *request); +LIBAC_EXPORT int ac_request(void *connection, const ac_request_t *request); #endif /* LIBAC_REQUESTS_H */ |