Skip to content
Mercury13 edited this page Oct 31, 2017 · 12 revisions

Units to use

uses Curl.Lib;

From C to Pascal: types

For handles (pointers to unknown structs): CURL*HCurl and so on. H = handle.

For callbacks: curl_lock_functionEvCurlLock and so on. Ev = event.

For other types: CURLcodeTCurlCode, curl_httppost *PCurlHttpPost and so on.

From C to Pascal: functions

Straightforward, with two exceptions.

  1. curl_easy_setopt is type-safe. For raw unsafe function see curl_easy_setopt_initial.

  2. curl_formadd has 10 versions with different number of parameters. All parameters are PAnsiChar, to simplify passing strings. If you want integer or pointer, just cast PAnsiChar(x). For raw unsafe function see curl_formadd_initial, but it is EXTREMELY mistake-prone, I warned you!

  3. curl_easy_getinfo is type-safe. For raw unsafe function see curl_easy_getinfo_initial.

Clone this wiki locally