}
$ifdefs = array(
- 'COOKIELIST' => '7,14,1'
+ 'COOKIELIST' => 'HTTP_CURL_VERSION(7,14,1)',
+ 'PRIMARY_IP' => 'HTTP_CURL_VERSION(7,19,0)',
+ 'APPCONNECT_TIME' => 'HTTP_CURL_VERSION(7,19,0)',
+ 'REDIRECT_URL' => 'HTTP_CURL_VERSION(7,18,2)',
+ 'CONDITION_UNMET' => 'HTTP_CURL_VERSION(7,19,4)',
+ 'PRIMARY_PORT' => 'HTTP_CURL_VERSION(7,21,0)',
+ 'LOCAL_PORT' => 'HTTP_CURL_VERSION(7,21,0)',
+ 'LOCAL_IP' => 'HTTP_CURL_VERSION(7,21,0)',
);
$exclude = array(
- 'PRIVATE', 'LASTSOCKET', 'FTP_ENTRY_PATH'
+ 'PRIVATE', 'LASTSOCKET', 'FTP_ENTRY_PATH', 'CERTINFO',
+ 'RTSP_SESSION_ID', 'RTSP_CLIENT_CSEQ', 'RTSP_SERVER_CSEQ', 'RTSP_CSEQ_RECV'
);
+
$translate = array(
'HTTP_CONNECTCODE' => "connect_code",
'COOKIELIST' => 'cookies',
add_assoc_long_ex(&array, "%s", sizeof("%2$s"), l);
}
',
-'SLIST' =>
+'SLIST' =>
' if (CURLE_OK == curl_easy_getinfo(request->ch, %s, &s)) {
MAKE_STD_ZVAL(subarray);
array_init(subarray);
for (p = s; p; p = p->next) {
- add_next_index_string(subarray, p->data, 1);
+ if (p->data) {
+ add_next_index_string(subarray, p->data, 1);
+ }
}
add_assoc_zval_ex(&array, "%s", sizeof("%2$s"), subarray);
curl_slist_free_all(s);
}
-'
+',
);
$infos = file_re('curl.h', '/^\s*(CURLINFO_(\w+))\s*=\s*CURLINFO_(STRING|LONG|DOUBLE|SLIST)\s*\+\s*\d+\s*,?\s*$/m');
foreach ($infos as $info) {
list(, $full, $short, $type) = $info;
if (in_array($short, $exclude)) continue;
- if (isset($ifdefs[$short])) printf("#if HTTP_CURL_VERSION(%s)\n", $ifdefs[$short]);
+ if (isset($ifdefs[$short])) printf("#if %s\n", $ifdefs[$short]);
printf($templates[$type], $full, strtolower((isset($translate[$short])) ? $translate[$short] : $short));
if (isset($ifdefs[$short])) printf("#endif\n");
}