diff options
-rw-r--r-- | docs/Makefile.am | 2 | ||||
-rw-r--r-- | docs/curl_global_cleanup.3 | 25 | ||||
-rw-r--r-- | docs/curl_global_init.3 | 29 | ||||
-rw-r--r-- | docs/libcurl.5 | 28 |
4 files changed, 70 insertions, 14 deletions
diff --git a/docs/Makefile.am b/docs/Makefile.am index 722a96d22..6598502fd 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -24,6 +24,8 @@ man_MANS = \ curl_strequal.3 \ curl_strnequal.3 \ curl_mprintf.3 \ + curl_global_init.3 \ + curl_global_cleanup.3 \ libcurl.5 EXTRA_DIST = $(man_MANS) \ diff --git a/docs/curl_global_cleanup.3 b/docs/curl_global_cleanup.3 new file mode 100644 index 000000000..680991856 --- /dev/null +++ b/docs/curl_global_cleanup.3 @@ -0,0 +1,25 @@ +.\" You can view this file with: +.\" nroff -man [file] +.\" Written by daniel@haxx.se +.\" +.TH curl_global_cleanup 3 "28 May 2001" "libcurl 7.8" "libcurl Manual" +.SH NAME +curl_global_cleanup - Global libcurl cleanup +.SH SYNOPSIS +.B #include <curl/curl.h> +.sp +.BI "void curl_global_cleanup(void);" +.ad +.SH DESCRIPTION +curl_global_cleanup must be called once (no matter how many threads or libcurl +sessions that'll be used) by every application that uses libcurl, after all +uses of libcurl is complete. + +This is the opposite of \fIcurl_global_init\fP. + +Not calling this function may result in memory leaks. +.SH "SEE ALSO" +.BR curl_global_init "(3), " +.SH BUGS +None? + diff --git a/docs/curl_global_init.3 b/docs/curl_global_init.3 new file mode 100644 index 000000000..228cd4c5e --- /dev/null +++ b/docs/curl_global_init.3 @@ -0,0 +1,29 @@ +.\" You can view this file with: +.\" nroff -man [file] +.\" Written by daniel@haxx.se +.\" +.TH curl_global_init 3 "28 May 2001" "libcurl 7.8" "libcurl Manual" +.SH NAME +curl_global_init - Global libcurl initialisation +.SH SYNOPSIS +.B #include <curl/curl.h> +.sp +.BI "CURLcode curl_global_init(void);" +.ad +.SH DESCRIPTION +This function should be called once (no matter how many threads or libcurl +sessions that'll be used) by every application that uses libcurl. + +If this function hasn't been invoked when \fIcurl_easy_init\fP is called, it +will be done automatically by libcurl. + +You must however \fBalways\fP use the \fIcurl_global_cleanup\fP function, as +that cannot be called automatically for you by libcurl. +.SH RETURN VALUE +If this function returns non-zero, something went wrong and you cannot use the +other curl functions. +.SH "SEE ALSO" +.BR curl_global_cleanup "(3), " +.SH BUGS +None. + diff --git a/docs/libcurl.5 b/docs/libcurl.5 index 1fe0b1114..c90d78121 100644 --- a/docs/libcurl.5 +++ b/docs/libcurl.5 @@ -2,7 +2,7 @@ .\" nroff -man [file] .\" Written by Daniel Stenberg .\" -.TH libcurl 5 "15 May 2001" "libcurl 7.7.3" "libcurl overview" +.TH libcurl 5 "28 May 2001" "libcurl 7.8" "libcurl overview" .SH NAME libcurl \- client-side URL transfers .SH DESCRIPTION @@ -12,30 +12,30 @@ specific man pages for each function mentioned in here. libcurl can also be used directly from within your Java, PHP, Perl, Ruby or Tcl programs as well, look elsewhere for documentation on this! -When using libcurl's easy interface, you init your session and get a handle, -which you use as input to the following interface functions you use. Use -.B curl_easy_init() +All applications that use libcurl should call \fIcurl_global_init()\fP exactly +once before any libcurl function can be used. After all usage of libcurl is +complete, it \fBmust\fP call \fIcurl_global_cleanup()\fP. In between those two +calls, you can use libcurl as described below. + +When using libcurl you init your session and get a handle, which you use as +input to the following interface functions you use. Use \fIcurl_easy_init()\fP to get the handle. You continue by setting all the options you want in the upcoming transfer, most important among them is the URL itself (you can't transfer anything without a specified URL as you may have figured out yourself). You might want to set some callbacks as well that will be called from the library when data -is available etc. -.B curl_easy_setopt() -is there for this. +is available etc. \fIcurl_easy_setopt()\fP is there for this. When all is setup, you tell libcurl to perform the transfer using -.B curl_easy_perform(). -It will then do the entire operation and won't return until it is done -(successfully or not). +\fIcurl_easy_perform()\fP. It will then do the entire operation and won't +return until it is done (successfully or not). After the transfer has been made, you can set new options and make another transfer, or if you're done, cleanup the session by calling -.B curl_easy_cleanup(). -If you want persistant connections, you don't cleanup immediately, but instead -run ahead and perform other transfers using the same handle. See the chapter -below for Persistant Connections. +\fIcurl_easy_cleanup()\fP. If you want persistant connections, you don't +cleanup immediately, but instead run ahead and perform other transfers using +the same handle. See the chapter below for Persistant Connections. There is also a series of other helpful functions to use. They are: |