aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/curl/curl.h72
-rw-r--r--include/curl/easy.h14
-rw-r--r--include/curl/mprintf.h31
-rw-r--r--include/curl/multi.h32
4 files changed, 83 insertions, 66 deletions
diff --git a/include/curl/curl.h b/include/curl/curl.h
index ca2c78eb3..3015ad795 100644
--- a/include/curl/curl.h
+++ b/include/curl/curl.h
@@ -48,6 +48,21 @@ extern "C" {
#endif
/*
+ * Decorate exportable functions for Win32 and Netware DLL linking.
+ * This avoids using a .def file for building libcurl.dll.
+ */
+#if (defined(WIN32) || defined(_WIN32) || defined(NETWARE)) && \
+ !defined(CURL_STATICLIB)
+#if defined(BUILDING_LIBCURL)
+#define CURL_EXTERN __declspec(dllexport)
+#else
+#define CURL_EXTERN __declspec(dllimport)
+#endif
+#else
+#define CURL_EXTERN
+#endif
+
+/*
* We want the typedef curl_off_t setup for large file support on all
* platforms. We also provide a CURL_FORMAT_OFF_T define to use in *printf
* format strings when outputting a variable of type curl_off_t.
@@ -921,8 +936,8 @@ typedef enum {
/* curl_strequal() and curl_strnequal() are subject for removal in a future
libcurl, see lib/README.curlx for details */
-extern int (curl_strequal)(const char *s1, const char *s2);
-extern int (curl_strnequal)(const char *s1, const char *s2, size_t n);
+CURL_EXTERN int (curl_strequal)(const char *s1, const char *s2);
+CURL_EXTERN int (curl_strnequal)(const char *s1, const char *s2, size_t n);
/* name is uppercase CURLFORM_<name> */
#ifdef CFINIT
@@ -1011,9 +1026,9 @@ typedef enum {
* adds one part that together construct a full post. Then use
* CURLOPT_HTTPPOST to send it off to libcurl.
*/
-CURLFORMcode curl_formadd(struct curl_httppost **httppost,
- struct curl_httppost **last_post,
- ...);
+CURL_EXTERN CURLFORMcode curl_formadd(struct curl_httppost **httppost,
+ struct curl_httppost **last_post,
+ ...);
/*
* NAME curl_formfree()
@@ -1022,7 +1037,7 @@ CURLFORMcode curl_formadd(struct curl_httppost **httppost,
*
* Free a multipart formpost previously built with curl_formadd().
*/
-void curl_formfree(struct curl_httppost *form);
+CURL_EXTERN void curl_formfree(struct curl_httppost *form);
/*
* NAME curl_getenv()
@@ -1032,7 +1047,7 @@ void curl_formfree(struct curl_httppost *form);
* Returns a malloc()'ed string that MUST be curl_free()ed after usage is
* complete. DEPRECATED - see lib/README.curlx
*/
-char *curl_getenv(const char *variable);
+CURL_EXTERN char *curl_getenv(const char *variable);
/*
* NAME curl_version()
@@ -1041,7 +1056,7 @@ char *curl_getenv(const char *variable);
*
* Returns a static ascii string of the libcurl version.
*/
-char *curl_version(void);
+CURL_EXTERN char *curl_version(void);
/*
* NAME curl_escape()
@@ -1052,7 +1067,7 @@ char *curl_version(void);
* %XX versions). This function returns a new allocated string or NULL if an
* error occurred.
*/
-char *curl_escape(const char *string, int length);
+CURL_EXTERN char *curl_escape(const char *string, int length);
/*
* NAME curl_unescape()
@@ -1063,7 +1078,7 @@ char *curl_escape(const char *string, int length);
* versions). This function returns a new allocated string or NULL if an error
* occurred.
*/
-char *curl_unescape(const char *string, int length);
+CURL_EXTERN char *curl_unescape(const char *string, int length);
/*
* NAME curl_free()
@@ -1073,7 +1088,7 @@ char *curl_unescape(const char *string, int length);
* Provided for de-allocation in the same translation unit that did the
* allocation. Added in libcurl 7.10
*/
-void curl_free(void *p);
+CURL_EXTERN void curl_free(void *p);
/*
* NAME curl_global_init()
@@ -1083,7 +1098,7 @@ void curl_free(void *p);
* curl_global_init() should be invoked exactly once for each application that
* uses libcurl
*/
-CURLcode curl_global_init(long flags);
+CURL_EXTERN CURLcode curl_global_init(long flags);
/*
* NAME curl_global_init_mem()
@@ -1098,12 +1113,12 @@ CURLcode curl_global_init(long flags);
* callback routines with be invoked by this library instead of the system
* memory management routines like malloc, free etc.
*/
-CURLcode curl_global_init_mem(long flags,
- curl_malloc_callback m,
- curl_free_callback f,
- curl_realloc_callback r,
- curl_strdup_callback s,
- curl_calloc_callback c);
+CURL_EXTERN CURLcode curl_global_init_mem(long flags,
+ curl_malloc_callback m,
+ curl_free_callback f,
+ curl_realloc_callback r,
+ curl_strdup_callback s,
+ curl_calloc_callback c);
/*
* NAME curl_global_cleanup()
@@ -1113,7 +1128,7 @@ CURLcode curl_global_init_mem(long flags,
* curl_global_cleanup() should be invoked exactly once for each application
* that uses libcurl
*/
-void curl_global_cleanup(void);
+CURL_EXTERN void curl_global_cleanup(void);
/* linked-list structure for the CURLOPT_QUOTE option (and other) */
struct curl_slist {
@@ -1129,7 +1144,8 @@ struct curl_slist {
* Appends a string to a linked list. If no list exists, it will be created
* first. Returns the new list, after appending.
*/
-struct curl_slist *curl_slist_append(struct curl_slist *, const char *);
+CURL_EXTERN struct curl_slist *curl_slist_append(struct curl_slist *,
+ const char *);
/*
* NAME curl_slist_free_all()
@@ -1138,7 +1154,7 @@ struct curl_slist *curl_slist_append(struct curl_slist *, const char *);
*
* free a previously built curl_slist.
*/
-void curl_slist_free_all(struct curl_slist *);
+CURL_EXTERN void curl_slist_free_all(struct curl_slist *);
/*
* NAME curl_getdate()
@@ -1150,7 +1166,7 @@ void curl_slist_free_all(struct curl_slist *);
* where the specified time is relative now, like 'two weeks' or 'tomorrow'
* etc.
*/
-time_t curl_getdate(const char *p, const time_t *now);
+CURL_EXTERN time_t curl_getdate(const char *p, const time_t *now);
#define CURLINFO_STRING 0x100000
#define CURLINFO_LONG 0x200000
@@ -1271,9 +1287,9 @@ typedef enum {
CURLSHOPT_LAST /* never use */
} CURLSHoption;
-CURLSH *curl_share_init(void);
-CURLSHcode curl_share_setopt(CURLSH *, CURLSHoption option, ...);
-CURLSHcode curl_share_cleanup(CURLSH *);
+CURL_EXTERN CURLSH *curl_share_init(void);
+CURL_EXTERN CURLSHcode curl_share_setopt(CURLSH *, CURLSHoption option, ...);
+CURL_EXTERN CURLSHcode curl_share_cleanup(CURLSH *);
/****************************************************************************
* Structures for querying information about the curl library at runtime.
@@ -1333,7 +1349,7 @@ typedef struct {
* This function returns a pointer to a static copy of the version info
* struct. See above.
*/
-curl_version_info_data *curl_version_info(CURLversion);
+CURL_EXTERN curl_version_info_data *curl_version_info(CURLversion);
/*
* NAME curl_easy_strerror()
@@ -1344,7 +1360,7 @@ curl_version_info_data *curl_version_info(CURLversion);
* into the equivalent human readable error string. This is useful
* for printing meaningful error messages.
*/
-const char *curl_easy_strerror(CURLcode);
+CURL_EXTERN const char *curl_easy_strerror(CURLcode);
/*
* NAME curl_share_strerror()
@@ -1355,7 +1371,7 @@ const char *curl_easy_strerror(CURLcode);
* into the equivalent human readable error string. This is useful
* for printing meaningful error messages.
*/
-const char *curl_share_strerror(CURLSHcode);
+CURL_EXTERN const char *curl_share_strerror(CURLSHcode);
#ifdef __cplusplus
}
diff --git a/include/curl/easy.h b/include/curl/easy.h
index 336e542f8..17de21070 100644
--- a/include/curl/easy.h
+++ b/include/curl/easy.h
@@ -26,10 +26,10 @@
extern "C" {
#endif
-CURL *curl_easy_init(void);
-CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...);
-CURLcode curl_easy_perform(CURL *curl);
-void curl_easy_cleanup(CURL *curl);
+CURL_EXTERN CURL *curl_easy_init(void);
+CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...);
+CURL_EXTERN CURLcode curl_easy_perform(CURL *curl);
+CURL_EXTERN void curl_easy_cleanup(CURL *curl);
/*
* NAME curl_easy_getinfo()
@@ -44,7 +44,7 @@ void curl_easy_cleanup(CURL *curl);
* performed transfer, all results from this function are undefined until the
* transfer is completed.
*/
-CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);
+CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);
/*
@@ -59,7 +59,7 @@ CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);
* curl_easy_duphandle() for each new thread to avoid a series of identical
* curl_easy_setopt() invokes in every thread.
*/
-CURL* curl_easy_duphandle(CURL *curl);
+CURL_EXTERN CURL* curl_easy_duphandle(CURL *curl);
/*
* NAME curl_easy_reset()
@@ -72,7 +72,7 @@ CURL* curl_easy_duphandle(CURL *curl);
* It does keep: live connections, the Session ID cache, the DNS cache and the
* cookies.
*/
-void curl_easy_reset(CURL *curl);
+CURL_EXTERN void curl_easy_reset(CURL *curl);
#ifdef __cplusplus
}
diff --git a/include/curl/mprintf.h b/include/curl/mprintf.h
index 65dc11442..b85a4789c 100644
--- a/include/curl/mprintf.h
+++ b/include/curl/mprintf.h
@@ -1,8 +1,8 @@
/***************************************************************************
- * _ _ ____ _
- * Project ___| | | | _ \| |
- * / __| | | | |_) | |
- * | (__| |_| | _ <| |___
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
@@ -10,7 +10,7 @@
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at http://curl.haxx.se/docs/copyright.html.
- *
+ *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file.
@@ -26,17 +26,18 @@
#include <stdarg.h>
#include <stdio.h> /* needed for FILE */
+#include <curl/curl.h>
-int curl_mprintf(const char *format, ...);
-int curl_mfprintf(FILE *fd, const char *format, ...);
-int curl_msprintf(char *buffer, const char *format, ...);
-int curl_msnprintf(char *buffer, size_t maxlength, const char *format, ...);
-int curl_mvprintf(const char *format, va_list args);
-int curl_mvfprintf(FILE *fd, const char *format, va_list args);
-int curl_mvsprintf(char *buffer, const char *format, va_list args);
-int curl_mvsnprintf(char *buffer, size_t maxlength, const char *format, va_list args);
-char *curl_maprintf(const char *format, ...);
-char *curl_mvaprintf(const char *format, va_list args);
+CURL_EXTERN int curl_mprintf(const char *format, ...);
+CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...);
+CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...);
+CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength, const char *format, ...);
+CURL_EXTERN int curl_mvprintf(const char *format, va_list args);
+CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args);
+CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args);
+CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength, const char *format, va_list args);
+CURL_EXTERN char *curl_maprintf(const char *format, ...);
+CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args);
#ifdef _MPRINTF_REPLACE
# define printf curl_mprintf
diff --git a/include/curl/multi.h b/include/curl/multi.h
index 65b672d2c..1e6fc3cc5 100644
--- a/include/curl/multi.h
+++ b/include/curl/multi.h
@@ -113,7 +113,7 @@ typedef struct CURLMsg CURLMsg;
* Desc: inititalize multi-style curl usage
* Returns: a new CURLM handle to use in all 'curl_multi' functions.
*/
-CURLM *curl_multi_init(void);
+CURL_EXTERN CURLM *curl_multi_init(void);
/*
* Name: curl_multi_add_handle()
@@ -121,8 +121,8 @@ CURLM *curl_multi_init(void);
* Desc: add a standard curl handle to the multi stack
* Returns: CURLMcode type, general multi error code.
*/
-CURLMcode curl_multi_add_handle(CURLM *multi_handle,
- CURL *curl_handle);
+CURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle,
+ CURL *curl_handle);
/*
* Name: curl_multi_remove_handle()
@@ -130,8 +130,8 @@ CURLMcode curl_multi_add_handle(CURLM *multi_handle,
* Desc: removes a curl handle from the multi stack again
* Returns: CURLMcode type, general multi error code.
*/
-CURLMcode curl_multi_remove_handle(CURLM *multi_handle,
- CURL *curl_handle);
+CURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle,
+ CURL *curl_handle);
/*
* Name: curl_multi_fdset()
@@ -141,11 +141,11 @@ CURLMcode curl_multi_remove_handle(CURLM *multi_handle,
* them are ready.
* Returns: CURLMcode type, general multi error code.
*/
-CURLMcode curl_multi_fdset(CURLM *multi_handle,
- fd_set *read_fd_set,
- fd_set *write_fd_set,
- fd_set *exc_fd_set,
- int *max_fd);
+CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle,
+ fd_set *read_fd_set,
+ fd_set *write_fd_set,
+ fd_set *exc_fd_set,
+ int *max_fd);
/*
* Name: curl_multi_perform()
@@ -163,8 +163,8 @@ CURLMcode curl_multi_fdset(CURLM *multi_handle,
* still have occurred problems on invidual transfers even when this
* returns OK.
*/
-CURLMcode curl_multi_perform(CURLM *multi_handle,
- int *running_handles);
+CURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle,
+ int *running_handles);
/*
* Name: curl_multi_cleanup()
@@ -175,7 +175,7 @@ CURLMcode curl_multi_perform(CURLM *multi_handle,
* in the middle of a transfer.
* Returns: CURLMcode type, general multi error code.
*/
-CURLMcode curl_multi_cleanup(CURLM *multi_handle);
+CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle);
/*
* Name: curl_multi_info_read()
@@ -205,8 +205,8 @@ CURLMcode curl_multi_cleanup(CURLM *multi_handle);
* queue (after this read) in the integer the second argument points
* to.
*/
-CURLMsg *curl_multi_info_read(CURLM *multi_handle,
- int *msgs_in_queue);
+CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle,
+ int *msgs_in_queue);
/*
* NAME curl_multi_strerror()
@@ -217,7 +217,7 @@ CURLMsg *curl_multi_info_read(CURLM *multi_handle,
* into the equivalent human readable error string. This is useful
* for printing meaningful error messages.
*/
-const char *curl_multi_strerror(CURLMcode);
+CURL_EXTERN const char *curl_multi_strerror(CURLMcode);
#ifdef __cplusplus
} /* end of extern "C" */