CURLOPT_TELNETOPTIONS.3 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. .\" generated by cd2nroff 0.1 from CURLOPT_TELNETOPTIONS.md
  2. .TH CURLOPT_TELNETOPTIONS 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_TELNETOPTIONS \- set of telnet options
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TELNETOPTIONS,
  9. struct curl_slist *cmds);
  10. .fi
  11. .SH DESCRIPTION
  12. Provide a pointer to a curl_slist with variables to pass to the telnet
  13. negotiations. The variables should be in the format <option=value>. libcurl
  14. supports the options \fBTTYPE\fP, \fBXDISPLOC\fP and \fBNEW_ENV\fP. See the TELNET
  15. standard for details.
  16. .SH DEFAULT
  17. NULL
  18. .SH PROTOCOLS
  19. This functionality affects telnet only
  20. .SH EXAMPLE
  21. .nf
  22. int main(void)
  23. {
  24. CURL *curl = curl_easy_init();
  25. if(curl) {
  26. CURLcode res;
  27. struct curl_slist *options;
  28. options = curl_slist_append(NULL, "TTTYPE=vt100");
  29. options = curl_slist_append(options, "USER=foobar");
  30. curl_easy_setopt(curl, CURLOPT_URL, "telnet://example.com/");
  31. curl_easy_setopt(curl, CURLOPT_TELNETOPTIONS, options);
  32. res = curl_easy_perform(curl);
  33. curl_easy_cleanup(curl);
  34. curl_slist_free_all(options);
  35. }
  36. }
  37. .fi
  38. .SH AVAILABILITY
  39. Added in curl 7.7
  40. .SH RETURN VALUE
  41. Returns CURLE_OK if TELNET is supported, and CURLE_UNKNOWN_OPTION if not.
  42. .SH SEE ALSO
  43. .BR CURLOPT_HTTPHEADER (3),
  44. .BR CURLOPT_QUOTE (3)