curl_share_setopt.3 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. .\" $Id$
  2. .\"
  3. .TH curl_share_setopt 3 "8 Aug 2003" "libcurl 7.10.7" "libcurl Manual"
  4. .SH NAME
  5. curl_share_setopt - Set options for a shared object
  6. .SH SYNOPSIS
  7. .B #include <curl/curl.h>
  8. .sp
  9. CURLSHcode curl_share_setopt(CURLSH *share, CURLSHoption option, parameter);
  10. .ad
  11. .SH DESCRIPTION
  12. Set the \fIoption\fP to \fIparameter\fP for the given \fIshare\fP.
  13. .SH OPTIONS
  14. .IP CURLSHOPT_LOCKFUNC
  15. The \fIparameter\fP must be a pointer to a function matching the following
  16. prototype:
  17. void lock_function(CURL *handle, curl_lock_data data, curl_lock_access access,
  18. void *userptr);
  19. \fIdata\fP defines what data libcurl wants to lock, and you must make sure that
  20. only one lock is given at any time for each kind of data.
  21. \fIaccess\fP defines what access type libcurl wants, shared or single.
  22. \fIuserptr\fP is the pointer you set with \fICURLSHOPT_USERDATA\fP.
  23. .IP CURLSHOPT_UNLOCKFUNC
  24. The \fIparameter\fP must be a pointer to a function matching the following
  25. prototype:
  26. void unlock_function(CURL *handle, curl_lock_data data, void *userptr);
  27. \fIdata\fP defines what data libcurl wants to unlock, and you must make sure
  28. that only one lock is given at any time for each kind of data.
  29. \fIuserptr\fP is the pointer you set with \fICURLSHOPT_USERDATA\fP.
  30. .IP CURLSHOPT_SHARE
  31. The \fIparameter\fP specifies a type of data that should be shared. This may
  32. be set to one of the values described below.
  33. .RS
  34. .IP CURL_LOCK_DATA_COOKIE
  35. Cookie data will be shared across the easy handles using this shared object.
  36. .IP CURL_LOCK_DATA_DNS
  37. Cached DNS hosts will be shared across the easy handles using this shared
  38. object. Note that when you use the multi interface, all easy handles added to
  39. the same multi handle will share DNS cache by default without this having to
  40. be used!
  41. .RE
  42. .IP CURLSHOPT_UNSHARE
  43. This option does the opposite of \fICURLSHOPT_SHARE\fP. It specifies that
  44. the specified \fIparameter\fP will no longer be shared. Valid values are
  45. the same as those for \fICURLSHOPT_SHARE\fP.
  46. .IP CURLSHOPT_USERDATA
  47. The \fIparameter\fP allows you to specify a pointer to data that will be passed
  48. to the lock_function and unlock_function each time it is called.
  49. .SH RETURN VALUE
  50. CURLSHE_OK (zero) means that the option was set properly, non-zero means an
  51. error occurred as \fI<curl/curl.h>\fP defines. See the \fIlibcurl-errors.3\fP
  52. man page for the full list with descriptions.
  53. .SH "SEE ALSO"
  54. .BR curl_share_cleanup "(3), " curl_share_init "(3)"