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

How should I be getting symbols? #2

Open
kxygk opened this issue Oct 1, 2021 · 0 comments
Open

How should I be getting symbols? #2

kxygk opened this issue Oct 1, 2021 · 0 comments

Comments

@kxygk
Copy link

kxygk commented Oct 1, 2021

This is maybe a naiive question, but how is the library expecting me to call symbols?

For instance I want to turn on SSL

As per the libcurl docs: https://curl.se/libcurl/c/CURLOPT_USE_SSL.html

          (curl-easy/setopt curl
                            curl-opts/use-ssl 
                            /*CURLUSESSL_TRY*/)

But I'm not quite sure how I'm expected to fill in that last value :)

What I ended up doing is going into curl.h find the enum it's listed under
https://github.com/curl/curl/blob/master/include/curl/curl.h#L875
So looks like it should be a 1 ..

The first time I ran it I got a CURLE_BAD_FUNCTION_ARGUMENT - but seems like it's working now

I see in opts you are also using the numerical values directly. Here it reads
https://github.com/lsevero/clj-curl/blob/master/src/clj_curl/opts.clj#L580

(def ^:const use-ssl 119)

But I'm not sure where the 119 comes from though

I guess my big picture question is.. am I doing this right? Should users be looking up enum values in the curl header?

My expectation was that these symbols were mapped somewhere to Clojure static vars. I can see there are a ton of them so maybe it was too annoying to copy them all

https://curl.se/libcurl/c/symbols-in-versions.html

In any case, thank you for the easy to use library :) I really appreciate it

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

No branches or pull requests

1 participant