From: Takaaki Tateishi Date: 2005-08-02T02:52:19+09:00 Subject: Re: libcurl and ruby-dl Brian Takita wrote: > Right now, I am having trouble setting the url parameter by calling > curl_easy_setopt. Please see the following program, in which I use 10002 for CURLOPT_URL. If you'd like to know why I use 10002, please understand definitions of CINIT and CURLOPT_URL in curl.h on your own. Regards, require 'dl/import' require 'dl/struct' module Curl extend DL::Importable dlload "libcurl.dll" typealias('CURL', 'void') typealias('CURLOPT', 'long') typealias('CURLcode', 'int') extern "CURL *curl_easy_init()" extern "char *curl_version()" extern "void *curl_version_info(int)" extern "CURLcode curl_easy_setopt(CURL *, CURLOPT, char *)" extern "void curl_easy_cleanup(CURL *)" extern "CURLcode curl_easy_perform(CURL *)" VersionInfoData = struct [ "int age", "char *version", "uint version_num", "char *host", "int features", "char *ssl_version", "long ssl_version_num", "char *libz_version", "char **protocols" ] end handle = Curl.curl_easy_init CURLOPT_URL = 10002 # I don't know the value URL = "http://www.google.com/" p Curl.curl_easy_setopt(handle, CURLOPT_URL, URL) p Curl.curl_easy_perform(handle) # This also fails # Documentation is at http://curl.mirror.internet.tp/libcurl/c/curl_easy_cleanup.html Curl.curl_easy_cleanup(handle) -- Takaaki Tateishi