Add support for GCC hidden visibility.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 19b0ebb416)
r14.0.x
Slávek Banko 5 years ago
parent e3d7138ea4
commit fdfff9c0f1
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -46,6 +46,18 @@
#include <time.h> #include <time.h>
#if defined(__KDE_HAVE_GCC_VISIBILITY) || defined(G_HAVE_GCC_VISIBILITY)
#define CARDDAV_NO_EXPORT __attribute__ ((visibility("hidden")))
#define CARDDAV_EXPORT __attribute__ ((visibility("default")))
#elif defined(_WIN32)
#define CARDDAV_NO_EXPORT
#define CARDDAV_EXPORT __declspec(dllexport)
#else
#define CARDDAV_NO_EXPORT
#define CARDDAV_EXPORT
#endif
/* For debug purposes */ /* For debug purposes */
/** /**
* @typedef struct debug_curl * @typedef struct debug_curl
@ -165,6 +177,7 @@ typedef enum {
* @param info Pointer to a runtime_info structure. @see runtime_info * @param info Pointer to a runtime_info structure. @see runtime_info
* @return Ok, FORBIDDEN, or CONFLICT. @see CARDDAV_RESPONSE * @return Ok, FORBIDDEN, or CONFLICT. @see CARDDAV_RESPONSE
*/ */
CARDDAV_EXPORT
CARDDAV_RESPONSE carddav_add_object(const char* object, CARDDAV_RESPONSE carddav_add_object(const char* object,
const char* URL, const char* URL,
runtime_info* info); runtime_info* info);
@ -179,6 +192,7 @@ CARDDAV_RESPONSE carddav_add_object(const char* object,
* @param info Pointer to a runtime_info structure. @see runtime_info * @param info Pointer to a runtime_info structure. @see runtime_info
* @return Ok, FORBIDDEN, or CONFLICT. @see CARDDAV_RESPONSE * @return Ok, FORBIDDEN, or CONFLICT. @see CARDDAV_RESPONSE
*/ */
CARDDAV_EXPORT
CARDDAV_RESPONSE carddav_delete_object(const char* object, CARDDAV_RESPONSE carddav_delete_object(const char* object,
const char* URL, const char* URL,
runtime_info* info); runtime_info* info);
@ -193,6 +207,7 @@ CARDDAV_RESPONSE carddav_delete_object(const char* object,
* @param info Pointer to a runtime_info structure. @see runtime_info * @param info Pointer to a runtime_info structure. @see runtime_info
* @return Ok, FORBIDDEN, or CONFLICT. @see CARDDAV_RESPONSE * @return Ok, FORBIDDEN, or CONFLICT. @see CARDDAV_RESPONSE
*/ */
CARDDAV_EXPORT
CARDDAV_RESPONSE carddav_delete_object_by_uri(const char* object, CARDDAV_RESPONSE carddav_delete_object_by_uri(const char* object,
const char* URL, const char* URL,
runtime_info* info); runtime_info* info);
@ -207,6 +222,7 @@ CARDDAV_RESPONSE carddav_delete_object_by_uri(const char* object,
* @param info Pointer to a runtime_info structure. @see runtime_info * @param info Pointer to a runtime_info structure. @see runtime_info
* @return Ok, FORBIDDEN, or CONFLICT. @see CARDDAV_RESPONSE * @return Ok, FORBIDDEN, or CONFLICT. @see CARDDAV_RESPONSE
*/ */
CARDDAV_EXPORT
CARDDAV_RESPONSE carddav_modify_object(const char* object, CARDDAV_RESPONSE carddav_modify_object(const char* object,
const char* URL, const char* URL,
runtime_info* info); runtime_info* info);
@ -221,6 +237,7 @@ CARDDAV_RESPONSE carddav_modify_object(const char* object,
* @param info Pointer to a runtime_info structure. @see runtime_info * @param info Pointer to a runtime_info structure. @see runtime_info
* @return Ok, FORBIDDEN, or CONFLICT. @see CARDDAV_RESPONSE * @return Ok, FORBIDDEN, or CONFLICT. @see CARDDAV_RESPONSE
*/ */
CARDDAV_EXPORT
CARDDAV_RESPONSE carddav_modify_object_by_uri(const char* object, CARDDAV_RESPONSE carddav_modify_object_by_uri(const char* object,
const char* URL, const char* URL,
runtime_info* info); runtime_info* info);
@ -237,6 +254,7 @@ CARDDAV_RESPONSE carddav_modify_object_by_uri(const char* object,
* @param info Pointer to a runtime_info structure. @see runtime_info * @param info Pointer to a runtime_info structure. @see runtime_info
* @return Ok, FORBIDDEN, or CONFLICT. @see CARDDAV_RESPONSE * @return Ok, FORBIDDEN, or CONFLICT. @see CARDDAV_RESPONSE
*/ */
CARDDAV_EXPORT
CARDDAV_RESPONSE carddav_get_object(response* result, CARDDAV_RESPONSE carddav_get_object(response* result,
time_t start, time_t start,
time_t end, time_t end,
@ -253,6 +271,7 @@ CARDDAV_RESPONSE carddav_get_object(response* result,
* @param info Pointer to a runtime_info structure. @see runtime_info * @param info Pointer to a runtime_info structure. @see runtime_info
* @return Ok, FORBIDDEN, or CONFLICT. @see CARDDAV_RESPONSE * @return Ok, FORBIDDEN, or CONFLICT. @see CARDDAV_RESPONSE
*/ */
CARDDAV_EXPORT
CARDDAV_RESPONSE carddav_getall_object(response* result, CARDDAV_RESPONSE carddav_getall_object(response* result,
const char* URL, const char* URL,
runtime_info* info); runtime_info* info);
@ -268,6 +287,7 @@ CARDDAV_RESPONSE carddav_getall_object(response* result,
* @param info Pointer to a runtime_info structure. @see runtime_info * @param info Pointer to a runtime_info structure. @see runtime_info
* @return Ok, FORBIDDEN, or CONFLICT. @see CARDDAV_RESPONSE * @return Ok, FORBIDDEN, or CONFLICT. @see CARDDAV_RESPONSE
*/ */
CARDDAV_EXPORT
CARDDAV_RESPONSE carddav_getall_object_by_uri(response* result, CARDDAV_RESPONSE carddav_getall_object_by_uri(response* result,
const char* URL, const char* URL,
runtime_info* info); runtime_info* info);
@ -282,6 +302,7 @@ CARDDAV_RESPONSE carddav_getall_object_by_uri(response* result,
* @param info Pointer to a runtime_info structure. @see runtime_info * @param info Pointer to a runtime_info structure. @see runtime_info
* @return Ok, FORBIDDEN, or CONFLICT. @see CARDDAV_RESPONSE * @return Ok, FORBIDDEN, or CONFLICT. @see CARDDAV_RESPONSE
*/ */
CARDDAV_EXPORT
CARDDAV_RESPONSE carddav_get_displayname(response* result, CARDDAV_RESPONSE carddav_get_displayname(response* result,
const char* URL, const char* URL,
runtime_info* info); runtime_info* info);
@ -295,6 +316,7 @@ CARDDAV_RESPONSE carddav_get_displayname(response* result,
* @result 0 (zero) means no CardDAV support, otherwise CardDAV support * @result 0 (zero) means no CardDAV support, otherwise CardDAV support
* detechted. * detechted.
*/ */
CARDDAV_EXPORT
int carddav_enabled_resource(const char* URL, runtime_info* info); int carddav_enabled_resource(const char* URL, runtime_info* info);
/** /**
@ -310,6 +332,7 @@ int carddav_enabled_resource(const char* URL, runtime_info* info);
* See (RFC1738). * See (RFC1738).
* @return Ok, FORBIDDEN, or CONFLICT. @see CARDDAV_RESPONSE * @return Ok, FORBIDDEN, or CONFLICT. @see CARDDAV_RESPONSE
*/ */
CARDDAV_EXPORT
CARDDAV_RESPONSE carddav_get_freebusy(response *result, CARDDAV_RESPONSE carddav_get_freebusy(response *result,
time_t start, time_t start,
time_t end, time_t end,
@ -327,6 +350,7 @@ CARDDAV_RESPONSE carddav_get_freebusy(response *result,
* @return An initialized carddav_error pointer to memory where error * @return An initialized carddav_error pointer to memory where error
* messages can be found from the last call to the library. * messages can be found from the last call to the library.
*/ */
CARDDAV_EXPORT
carddav_error* carddav_get_error(carddav_error* lib_error); carddav_error* carddav_get_error(carddav_error* lib_error);
/** /**
@ -335,6 +359,7 @@ carddav_error* carddav_get_error(carddav_error* lib_error);
* Caller provides a pointer to a local carddav_error structure. * Caller provides a pointer to a local carddav_error structure.
* @param lib_error A pointer to a struct _carddav_error. @see _carddav_error * @param lib_error A pointer to a struct _carddav_error. @see _carddav_error
*/ */
CARDDAV_EXPORT
void carddav_free_error(carddav_error* lib_error); void carddav_free_error(carddav_error* lib_error);
/* Setting various options in library */ /* Setting various options in library */
@ -344,6 +369,7 @@ void carddav_free_error(carddav_error* lib_error);
* Function which supports sending various options inside the library. * Function which supports sending various options inside the library.
* @param curl_options A struct debug_curl. See debug_curl. * @param curl_options A struct debug_curl. See debug_curl.
*/ */
CARDDAV_EXPORT
void carddav_set_options(debug_curl curl_options); void carddav_set_options(debug_curl curl_options);
/** /**
@ -354,12 +380,14 @@ void carddav_set_options(debug_curl curl_options);
* @param info Pointer to a runtime_info structure. @see runtime_info * @param info Pointer to a runtime_info structure. @see runtime_info
* @result A list of available options or NULL in case of any error. * @result A list of available options or NULL in case of any error.
*/ */
CARDDAV_EXPORT
char** carddav_get_server_options(const char* URL, runtime_info* info); char** carddav_get_server_options(const char* URL, runtime_info* info);
/** /**
* Function for getting an initialized runtime_info structure * Function for getting an initialized runtime_info structure
* @return runtime_info. @see runtime_info * @return runtime_info. @see runtime_info
*/ */
CARDDAV_EXPORT
runtime_info* carddav_get_runtime_info(); runtime_info* carddav_get_runtime_info();
/** /**
@ -368,12 +396,14 @@ runtime_info* carddav_get_runtime_info();
* @param info Address to a pointer to a runtime_info structure. @see * @param info Address to a pointer to a runtime_info structure. @see
* runtime_info * runtime_info
*/ */
CARDDAV_EXPORT
void carddav_free_runtime_info(runtime_info** info); void carddav_free_runtime_info(runtime_info** info);
/** /**
* Function for getting an initialized response structure * Function for getting an initialized response structure
* @return response. @see _response * @return response. @see _response
*/ */
CARDDAV_EXPORT
response* carddav_get_response(); response* carddav_get_response();
/** /**
@ -382,6 +412,7 @@ response* carddav_get_response();
* @param info Address to a pointer to a response structure. @see * @param info Address to a pointer to a response structure. @see
* _response * _response
*/ */
CARDDAV_EXPORT
void carddav_free_response(response** info); void carddav_free_response(response** info);
#endif #endif

Loading…
Cancel
Save