CURLSHOPT_USERDATA.3 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) 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. .\" * SPDX-License-Identifier: curl
  22. .\" *
  23. .\" **************************************************************************
  24. .TH CURLSHOPT_USERDATA 3 "February 07, 2023" "libcurl 7.88.1" "libcurl Manual"
  25. .SH NAME
  26. CURLSHOPT_USERDATA - pointer passed to the lock and unlock mutex callbacks
  27. .SH SYNOPSIS
  28. .nf
  29. #include <curl/curl.h>
  30. CURLSHcode curl_share_setopt(CURLSH *share, CURLSHOPT_USERDATA, void *clientp);
  31. .fi
  32. .SH DESCRIPTION
  33. The \fIclientp\fP parameter is held verbatim by libcurl and is passed on as
  34. the \fIclientp\fP argument to the callbacks set with
  35. \fICURLSHOPT_LOCKFUNC(3)\fP and \fICURLSHOPT_UNLOCKFUNC(3)\fP.
  36. .SH PROTOCOLS
  37. All
  38. .SH EXAMPLE
  39. .nf
  40. CURLSHcode sh;
  41. struct secrets private_stuff;
  42. share = curl_share_init();
  43. sh = curl_share_setopt(share, CURLSHOPT_USERDATA, &private_stuff);
  44. if(sh)
  45. printf("Error: %s\\n", curl_share_strerror(sh));
  46. .fi
  47. .SH AVAILABILITY
  48. Added in 7.10
  49. .SH RETURN VALUE
  50. CURLSHE_OK (zero) means that the option was set properly, non-zero means an
  51. error occurred. See \fIlibcurl-errors(3)\fP for the full list with
  52. descriptions.
  53. .SH "SEE ALSO"
  54. .BR CURLSHOPT_LOCKFUNC "(3), "
  55. .BR curl_share_setopt "(3), " curl_share_cleanup "(3), " curl_share_init "(3)"