curl_global_init.3 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. .\" You can view this file with:
  2. .\" nroff -man [file]
  3. .\" $Id$
  4. .\"
  5. .TH curl_global_init 3 "11 May 2004" "libcurl 7.12" "libcurl Manual"
  6. .SH NAME
  7. curl_global_init - Global libcurl initialisation
  8. .SH SYNOPSIS
  9. .B #include <curl/curl.h>
  10. .sp
  11. .BI "CURLcode curl_global_init(long " flags ");"
  12. .ad
  13. .SH DESCRIPTION
  14. This function sets up the program environment that libcurl needs. Think of it
  15. as an extension of the library loader.
  16. This function must be called at least once within a program (a program is all
  17. the code that shares a memory space) before the program calls any other
  18. function in libcurl. The environment it sets up is constant for the life of
  19. the program and is the same for every program, so multiple calls have the same
  20. effect as one call.
  21. The flags option is a bit pattern that tells libcurl exactly what features to
  22. init, as described below. Set the desired bits by ORing the values together.
  23. In normal operation, you must specify CURL_GLOBAL_ALL. Don't use any other
  24. value unless you are familiar with it and mean to control internal operations of
  25. libcurl.
  26. \fBThis function is not thread safe.\fP You must not call it when any other
  27. thread in the program (i.e. a thread sharing the same memory) is running.
  28. This doesn't just mean no other thread that is using libcurl. Because
  29. \fIcurl_global_init()\fP calls functions of other libraries that are similarly
  30. thread unsafe, it could conflict with any other thread that uses these other
  31. libraries.
  32. See the description in \fBlibcurl\fP(3) of global environment requirements for
  33. details of how to use this function.
  34. .SH FLAGS
  35. .TP 5
  36. .B CURL_GLOBAL_ALL
  37. Initialize everything possible. This sets all known bits.
  38. .TP
  39. .B CURL_GLOBAL_SSL
  40. Initialize SSL
  41. .TP
  42. .B CURL_GLOBAL_WIN32
  43. Initialize the Win32 socket libraries.
  44. .TP
  45. .B CURL_GLOBAL_NOTHING
  46. Initialise nothing extra. This sets no bit.
  47. .SH RETURN VALUE
  48. If this function returns non-zero, something went wrong and you cannot use the
  49. other curl functions.
  50. .SH "SEE ALSO"
  51. .BR curl_global_init_mem "(3), "
  52. .BR curl_global_cleanup "(3), "
  53. .BR curl_easy_init "(3) "
  54. .BR libcurl "(3) "