summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2019-10-10 19:58:25 +0200
committerSlávek Banko <slavek.banko@axis.cz>2019-10-10 19:58:25 +0200
commit76812f6b91c5b481e1d9b4eae0dbc503d85def39 (patch)
tree1f9457526b8296e7f3d54691eba1d63d2033f08e
parentf4d6e7129fec8081662f9708032e67ff245494d4 (diff)
downloadlibcaldav-76812f6b91c5b481e1d9b4eae0dbc503d85def39.zip
libcaldav-76812f6b91c5b481e1d9b4eae0dbc503d85def39.tar.gz
Add support for GCC hidden visibility.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r--src/caldav.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/caldav.h b/src/caldav.h
index 5734404..98f0acc 100644
--- a/src/caldav.h
+++ b/src/caldav.h
@@ -45,6 +45,18 @@
#include <time.h>
+
+#if defined(__KDE_HAVE_GCC_VISIBILITY) || defined(G_HAVE_GCC_VISIBILITY)
+#define CALDAV_NO_EXPORT __attribute__ ((visibility("hidden")))
+#define CALDAV_EXPORT __attribute__ ((visibility("default")))
+#elif defined(_WIN32)
+#define CALDAV_NO_EXPORT
+#define CALDAV_EXPORT __declspec(dllexport)
+#else
+#define CALDAV_NO_EXPORT
+#define CALDAV_EXPORT
+#endif
+
/* For debug purposes */
/**
* @typedef struct debug_curl
@@ -168,6 +180,7 @@ typedef enum {
* @param info Pointer to a runtime_info structure. @see runtime_info
* @return Ok, FORBIDDEN, or CONFLICT. @see CALDAV_RESPONSE
*/
+CALDAV_EXPORT
CALDAV_RESPONSE caldav_add_object(const char* object,
const char* URL,
runtime_info* info);
@@ -182,6 +195,7 @@ CALDAV_RESPONSE caldav_add_object(const char* object,
* @param info Pointer to a runtime_info structure. @see runtime_info
* @return Ok, FORBIDDEN, or CONFLICT. @see CALDAV_RESPONSE
*/
+CALDAV_EXPORT
CALDAV_RESPONSE caldav_delete_object(const char* object,
const char* URL,
runtime_info* info);
@@ -196,6 +210,7 @@ CALDAV_RESPONSE caldav_delete_object(const char* object,
* @param info Pointer to a runtime_info structure. @see runtime_info
* @return Ok, FORBIDDEN, or CONFLICT. @see CALDAV_RESPONSE
*/
+CALDAV_EXPORT
CALDAV_RESPONSE caldav_modify_object(const char* object,
const char* URL,
runtime_info* info);
@@ -212,6 +227,7 @@ CALDAV_RESPONSE caldav_modify_object(const char* object,
* @param info Pointer to a runtime_info structure. @see runtime_info
* @return Ok, FORBIDDEN, or CONFLICT. @see CALDAV_RESPONSE
*/
+CALDAV_EXPORT
CALDAV_RESPONSE caldav_get_object(response* result,
time_t start,
time_t end,
@@ -228,6 +244,7 @@ CALDAV_RESPONSE caldav_get_object(response* result,
* @param info Pointer to a runtime_info structure. @see runtime_info
* @return Ok, FORBIDDEN, or CONFLICT. @see CALDAV_RESPONSE
*/
+CALDAV_EXPORT
CALDAV_RESPONSE caldav_getall_object(response* result,
const char* URL,
runtime_info* info);
@@ -242,6 +259,7 @@ CALDAV_RESPONSE caldav_getall_object(response* result,
* @param info Pointer to a runtime_info structure. @see runtime_info
* @return Ok, FORBIDDEN, or CONFLICT. @see CALDAV_RESPONSE
*/
+CALDAV_EXPORT
CALDAV_RESPONSE caldav_tasks_delete_object(const char* object,
const char* URL,
runtime_info* info);
@@ -256,6 +274,7 @@ CALDAV_RESPONSE caldav_tasks_delete_object(const char* object,
* @param info Pointer to a runtime_info structure. @see runtime_info
* @return Ok, FORBIDDEN, or CONFLICT. @see CALDAV_RESPONSE
*/
+CALDAV_EXPORT
CALDAV_RESPONSE caldav_tasks_modify_object(const char* object,
const char* URL,
runtime_info* info);
@@ -272,6 +291,7 @@ CALDAV_RESPONSE caldav_tasks_modify_object(const char* object,
* @param info Pointer to a runtime_info structure. @see runtime_info
* @return Ok, FORBIDDEN, or CONFLICT. @see CALDAV_RESPONSE
*/
+CALDAV_EXPORT
CALDAV_RESPONSE caldav_tasks_get_object(response* result,
time_t start,
time_t end,
@@ -288,6 +308,7 @@ CALDAV_RESPONSE caldav_tasks_get_object(response* result,
* @param info Pointer to a runtime_info structure. @see runtime_info
* @return Ok, FORBIDDEN, or CONFLICT. @see CALDAV_RESPONSE
*/
+CALDAV_EXPORT
CALDAV_RESPONSE caldav_tasks_getall_object(response* result,
const char* URL,
runtime_info* info);
@@ -302,6 +323,7 @@ CALDAV_RESPONSE caldav_tasks_getall_object(response* result,
* @param info Pointer to a runtime_info structure. @see runtime_info
* @return Ok, FORBIDDEN, or CONFLICT. @see CALDAV_RESPONSE
*/
+CALDAV_EXPORT
CALDAV_RESPONSE caldav_get_displayname(response* result,
const char* URL,
runtime_info* info);
@@ -315,6 +337,7 @@ CALDAV_RESPONSE caldav_get_displayname(response* result,
* @result 0 (zero) means no CalDAV support, otherwise CalDAV support
* detechted.
*/
+CALDAV_EXPORT
int caldav_enabled_resource(const char* URL, runtime_info* info);
/**
@@ -330,6 +353,7 @@ int caldav_enabled_resource(const char* URL, runtime_info* info);
* See (RFC1738).
* @return Ok, FORBIDDEN, or CONFLICT. @see CALDAV_RESPONSE
*/
+CALDAV_EXPORT
CALDAV_RESPONSE caldav_get_freebusy(response *result,
time_t start,
time_t end,
@@ -347,6 +371,7 @@ CALDAV_RESPONSE caldav_get_freebusy(response *result,
* @return An initialized caldav_error pointer to memory where error
* messages can be found from the last call to the library.
*/
+CALDAV_EXPORT
caldav_error* caldav_get_error(caldav_error* lib_error);
/**
@@ -355,6 +380,7 @@ caldav_error* caldav_get_error(caldav_error* lib_error);
* Caller provides a pointer to a local caldav_error structure.
* @param lib_error A pointer to a struct _caldav_error. @see _caldav_error
*/
+CALDAV_EXPORT
void caldav_free_error(caldav_error* lib_error);
/* Setting various options in library */
@@ -364,6 +390,7 @@ void caldav_free_error(caldav_error* lib_error);
* Function which supports sending various options inside the library.
* @param curl_options A struct debug_curl. See debug_curl.
*/
+CALDAV_EXPORT
void caldav_set_options(debug_curl curl_options);
/**
@@ -374,12 +401,14 @@ void caldav_set_options(debug_curl curl_options);
* @param info Pointer to a runtime_info structure. @see runtime_info
* @result A list of available options or NULL in case of any error.
*/
+CALDAV_EXPORT
char** caldav_get_server_options(const char* URL, runtime_info* info);
/**
* Function for getting an initialized runtime_info structure
* @return runtime_info. @see runtime_info
*/
+CALDAV_EXPORT
runtime_info* caldav_get_runtime_info();
/**
@@ -388,12 +417,14 @@ runtime_info* caldav_get_runtime_info();
* @param info Address to a pointer to a runtime_info structure. @see
* runtime_info
*/
+CALDAV_EXPORT
void caldav_free_runtime_info(runtime_info** info);
/**
* Function for getting an initialized response structure
* @return response. @see _response
*/
+CALDAV_EXPORT
response* caldav_get_response();
/**
@@ -402,6 +433,7 @@ response* caldav_get_response();
* @param info Address to a pointer to a response structure. @see
* _response
*/
+CALDAV_EXPORT
void caldav_free_response(response** info);
#endif