Mark public functions with "CURL_EXTERN".
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
/* 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
* 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()
*
* 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()
* 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()
*
* Returns a static ascii string of the libcurl version.
*/
-char *curl_version(void);
+CURL_EXTERN char *curl_version(void);
/*
* NAME curl_escape()
* %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()
* 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()
* 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()
* 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()
* 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()
* 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 {
* 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()
*
* 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()
* 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
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.
* 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()
* 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()
* 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
}
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()
* 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, ...);
/*
* 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()
* 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
}
/***************************************************************************
- * _ _ ____ _
- * Project ___| | | | _ \| |
- * / __| | | | |_) | |
- * | (__| |_| | _ <| |___
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
* 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.
#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
* 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()
* 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()
* 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()
* 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()
* 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()
* 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()
* 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()
* 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" */