Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CURLOPT_WRITEFUNCTION documentation inconsistency #13681

Closed
Mike4Online opened this issue May 17, 2024 · 1 comment
Closed

CURLOPT_WRITEFUNCTION documentation inconsistency #13681

Mike4Online opened this issue May 17, 2024 · 1 comment

Comments

@Mike4Online
Copy link

I did this

Reviewed the documentation for libCURL API function CURLOPT_WRITEFUNCTION - specifically the method signature in the Synopsis and in the example code.

I expected the following

I expected the documented method signature in the Synopsis to correspond with what is in the example code on the same page, but they do not match. Specifically, the documented method signature in the Synopsis specifies a char * for the first parameter, but the example code specifies a void * in its example callback method.

I want to use char * in my callback method to avoid having to cast the first parameter to char *. But I cannot be sure from the documentation whether this pointer is a char * to begin with or not.

Either the example should be changed to use char * for the first parameter in its callback function, or the specified method signature in the Synopsis should be changed to use void *, so there is consistency and clarity.

Thank you.

curl/libcurl version

curl 8.7.1

operating system

Windows 10 64-bit

@Mike4Online
Copy link
Author

@bagder ,

Thanks for clarifying the example code and making it consistent. My own WRITEFUNCTION will be cleaner taking a char * for the first parameter.

Michael

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants