Concept Framework 1.0 documentation Contents | Index

standard.net.curl.curl_strnequal

Name Version Deprecated
curl_strnequal version 1.0 no

Prototype:
number curl_strnequal(string str1, string str2, number len)

Parameters:
str1      the first string
str2      the second string
len      the number of characters to compare

Description:
Case insensitive string comparisons of N characters.


Similar to curl_strequal, except it only compares the first len characters of str1.

Example:
import standard.net.curl

import standard.C.io


class Main {
var data="";
var header="";

function write_data(ptr, size, nmemb, stream) {
//echo "Stream: $stream\n";
if (stream==1001)
header+=ptr;
else
data+=ptr;
return size*nmemb;
}

function read_data(var ptr, size, nmemb, stream) {
echo typeof ptr;

for (var i=0;i<100;i++)
ptr+="x";

return size*nmemb;
}

function progress(clientp, dltotal, dlnow, ultotal, ulnow) {
echo "$dlnow/$dltotal bytes received \r";
}

function Main() {
curl_global_init(CURL_GLOBAL_ALL);

var curl_handle=curl_easy_init();

curl_easy_setopt(curl_handle, CURLOPT_PROGRESSFUNCTION, progress);
curl_easy_setopt(curl_handle, CURLOPT_NOPROGRESS, 0);


curl_easy_setopt(curl_handle, CURLOPT_URL, "http://curl.haxx.se");

curl_easy_setopt(curl_handle, CURLOPT_READFUNCTION, read_data);

curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, write_data);
curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, 1002);
curl_easy_setopt(curl_handle, CURLOPT_WRITEHEADER , 1001);


curl_easy_perform(curl_handle);
echo "\n\n";
curl_easy_getinfo(curl_handle, CURLINFO_SSL_ENGINES, var arr);
echo arr;

curl_easy_cleanup(curl_handle);

WriteFile(data,"data.html");
WriteFile(header,"data_header.txt");

}
}

Returns:
Non-zero if the strings are identical. Zero if they're not.

Documented by Eduard Suica, generation time: Thu Oct 15 20:02:09 2009 GMT(c)2009 RadGs Software