2
0

CURLSHOPT_USERDATA.3 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
  9. .\" *
  10. .\" * This software is licensed as described in the file COPYING, which
  11. .\" * you should have received as part of this distribution. The terms
  12. .\" * are also available at https://curl.se/docs/copyright.html.
  13. .\" *
  14. .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. .\" * copies of the Software, and permit persons to whom the Software is
  16. .\" * furnished to do so, under the terms of the COPYING file.
  17. .\" *
  18. .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. .\" * KIND, either express or implied.
  20. .\" *
  21. .\" **************************************************************************
  22. .TH CURLSHOPT_USERDATA 3 "8 Aug 2003" "libcurl 7.10.7" "libcurl Manual"
  23. .SH NAME
  24. CURLSHOPT_USERDATA - pointer passed to the (un)lock mutex callbacks
  25. .SH SYNOPSIS
  26. .nf
  27. #include <curl/curl.h>
  28. CURLSHcode curl_share_setopt(CURLSH *share, CURLSHOPT_USERDATA, void *ptr);
  29. .fi
  30. .SH DESCRIPTION
  31. The \fIptr\fP parameter is held verbatim by libcurl and is passed on as the
  32. \fIuserptr\fP argument to the callbacks set with \fICURLSHOPT_LOCKFUNC(3)\fP
  33. and \fICURLSHOPT_UNLOCKFUNC(3)\fP.
  34. .SH PROTOCOLS
  35. All
  36. .SH EXAMPLE
  37. .nf
  38. CURLSHcode sh;
  39. struct secrets private_stuff;
  40. share = curl_share_init();
  41. sh = curl_share_setopt(share, CURLSHOPT_USERDATA, &private_stuff);
  42. if(sh)
  43. printf("Error: %s\\n", curl_share_strerror(sh));
  44. .fi
  45. .SH AVAILABILITY
  46. Added in 7.10
  47. .SH RETURN VALUE
  48. CURLSHE_OK (zero) means that the option was set properly, non-zero means an
  49. error occurred. See \fIlibcurl-errors(3)\fP for the full list with
  50. descriptions.
  51. .SH "SEE ALSO"
  52. .BR CURLSHOPT_LOCKFUNC "(3), "
  53. .BR curl_share_setopt "(3), " curl_share_cleanup "(3), " curl_share_init "(3)"