curl_share_setopt.3 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. .\" generated by cd2nroff 0.1 from curl_share_setopt.md
  2. .TH curl_share_setopt 3 "2025-01-17" libcurl
  3. .SH NAME
  4. curl_share_setopt \- set options for a shared object
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLSHcode curl_share_setopt(CURLSH *share, CURLSHoption option, parameter);
  9. .fi
  10. .SH DESCRIPTION
  11. Set the \fIoption\fP to \fIparameter\fP for the given \fIshare\fP.
  12. .SH OPTIONS
  13. .IP CURLSHOPT_LOCKFUNC
  14. See \fICURLSHOPT_LOCKFUNC(3)\fP.
  15. .IP CURLSHOPT_UNLOCKFUNC
  16. See \fICURLSHOPT_UNLOCKFUNC(3)\fP.
  17. .IP CURLSHOPT_SHARE
  18. See \fICURLSHOPT_SHARE(3)\fP.
  19. .IP CURLSHOPT_UNSHARE
  20. See \fICURLSHOPT_UNSHARE(3)\fP.
  21. .IP CURLSHOPT_USERDATA
  22. See \fICURLSHOPT_USERDATA(3)\fP.
  23. .SH PROTOCOLS
  24. This functionality affects all supported protocols
  25. .SH EXAMPLE
  26. .nf
  27. int main(void)
  28. {
  29. CURLSHcode sh;
  30. CURLSH *share = curl_share_init();
  31. sh = curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_CONNECT);
  32. if(sh)
  33. printf("Error: %s\\n", curl_share_strerror(sh));
  34. }
  35. .fi
  36. .SH AVAILABILITY
  37. Added in curl 7.10
  38. .SH RETURN VALUE
  39. CURLSHE_OK (zero) means that the option was set properly, non\-zero means an
  40. error occurred as \fI<curl/curl.h>\fP defines. See the \fIlibcurl\-errors(3)\fP man
  41. page for the full list with descriptions.
  42. .SH SEE ALSO
  43. .BR curl_share_cleanup (3),
  44. .BR curl_share_init (3)