curl_share_setopt.html 4.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <html><head>
  2. <title>curl_share_setopt man page</title>
  3. <meta name="generator" content="roffit 0.5">
  4. <STYLE type="text/css">
  5. P.level0 {
  6. padding-left: 2em;
  7. }
  8. P.level1 {
  9. padding-left: 4em;
  10. }
  11. P.level2 {
  12. padding-left: 6em;
  13. }
  14. span.emphasis {
  15. font-style: italic;
  16. }
  17. span.bold {
  18. font-weight: bold;
  19. }
  20. span.manpage {
  21. font-weight: bold;
  22. }
  23. h2.nroffsh {
  24. background-color: #e0e0e0;
  25. }
  26. span.nroffip {
  27. font-weight: bold;
  28. font-size: 120%;
  29. font-family: monospace;
  30. }
  31. p.roffit {
  32. text-align: center;
  33. font-size: 80%;
  34. }
  35. </STYLE>
  36. </head><body>
  37. <p class="level0"><a name="NAME"></a><h2 class="nroffsh">NAME</h2>
  38. <p class="level0">curl_share_setopt - Set options for a shared object <a name="SYNOPSIS"></a><h2 class="nroffsh">SYNOPSIS</h2>
  39. <p class="level0"><span Class="bold">#include &lt;curl/curl.h&gt;</span>
  40. <p class="level0">CURLSHcode curl_share_setopt(CURLSH *share, CURLSHoption option, parameter);
  41. <p class="level0"><a name="DESCRIPTION"></a><h2 class="nroffsh">DESCRIPTION</h2>
  42. <p class="level0">Set the <span Class="emphasis">option</span> to <span Class="emphasis">parameter</span> for the given <span Class="emphasis">share</span>. <a name="OPTIONS"></a><h2 class="nroffsh">OPTIONS</h2>
  43. <p class="level0">
  44. <p class="level0"><a name="CURLSHOPTLOCKFUNC"></a><span class="nroffip">CURLSHOPT_LOCKFUNC</span>
  45. <p class="level1">The <span Class="emphasis">parameter</span> must be a pointer to a function matching the following prototype:
  46. <p class="level1">void lock_function(CURL *handle, curl_lock_data data, curl_lock_access access, void *userptr);
  47. <p class="level1"><span Class="emphasis">data</span> defines what data libcurl wants to lock, and you must make sure that only one lock is given at any time for each kind of data.
  48. <p class="level1"><span Class="emphasis">access</span> defines what access type libcurl wants, shared or single.
  49. <p class="level1"><span Class="emphasis">userptr</span> is the pointer you set with <a class="emphasis" href="#CURLSHOPTUSERDATA">CURLSHOPT_USERDATA</a>.
  50. <p class="level0"><a name="CURLSHOPTUNLOCKFUNC"></a><span class="nroffip">CURLSHOPT_UNLOCKFUNC</span>
  51. <p class="level1">The <span Class="emphasis">parameter</span> must be a pointer to a function matching the following prototype:
  52. <p class="level1">void unlock_function(CURL *handle, curl_lock_data data, void *userptr);
  53. <p class="level1"><span Class="emphasis">data</span> defines what data libcurl wants to unlock, and you must make sure that only one lick is given at any time for each kind of data.
  54. <p class="level1"><span Class="emphasis">userptr</span> is the pointer you set with <a class="emphasis" href="#CURLSHOPTUSERDATA">CURLSHOPT_USERDATA</a>.
  55. <p class="level0"><a name="CURLSHOPTSHARE"></a><span class="nroffip">CURLSHOPT_SHARE</span>
  56. <p class="level1">The <span Class="emphasis">parameter</span> specifies a type of data that should be shared. This may be set to one of the values described below.
  57. <p class="level2">
  58. <p class="level1"><a name="CURLLOCKDATACOOKIE"></a><span class="nroffip">CURL_LOCK_DATA_COOKIE</span>
  59. <p class="level2">Cookie data will be shared across the easy handles using this shared object.
  60. <p class="level1"><a name="CURLLOCKDATADNS"></a><span class="nroffip">CURL_LOCK_DATA_DNS</span>
  61. <p class="level2">Cached DNS hosts will be shared across the easy handles using this shared object.
  62. <p class="level1">
  63. <p class="level0"><a name="CURLSHOPTUNSHARE"></a><span class="nroffip">CURLSHOPT_UNSHARE</span>
  64. <p class="level1">This option does the opposite of <a class="emphasis" href="#CURLSHOPTSHARE">CURLSHOPT_SHARE</a>. It specifies that the specified <span Class="emphasis">parameter</span> will no longer be shared. Valid values are the same as those for <a class="emphasis" href="#CURLSHOPTSHARE">CURLSHOPT_SHARE</a>.
  65. <p class="level0"><a name="CURLSHOPTUSERDATA"></a><span class="nroffip">CURLSHOPT_USERDATA</span>
  66. <p class="level1">The <span Class="emphasis">parameter</span> allows you to specify a pointer to data that will passed to the lock_function and unlock_function each time it is called. <a name="RETURN"></a><h2 class="nroffsh">RETURN VALUE</h2>
  67. <p class="level0">CURLSHE_OK (zero) means that the option was set properly, non-zero means an error occurred as <span Class="emphasis">&lt;curl/curl.h&gt;</span> defines. See the <span Class="emphasis">libcurl-errors.3</span> man page for the full list with descriptions. <a name="SEE"></a><h2 class="nroffsh">SEE ALSO</h2>
  68. <p class="level0"><a class="manpage" href="./curl_share_cleanup.html">curl_share_cleanup (3)</a> <a class="manpage" href="./curl_share_init.html"> curl_share_init (3)</a> <p class="roffit">
  69. This HTML page was made with <a href="http://daniel.haxx.se/projects/roffit/">roffit</a>.
  70. </body></html>