* Added request options:
[m6w6/ext-http] / scripts / gen_curlinfo.php
index a07af2281c2f5485497814a9754e4ff3a9459d06..54137ba2c9e3b528aa1f1a5b09d8fe0b59a22cb1 100644 (file)
@@ -1,3 +1,4 @@
+#!/usr/bin/env php
 <?php
 // $Id$
 
@@ -31,7 +32,11 @@ function file_re($file, $pattern, $all = true) {
 }
 
 $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)',
+       'CERTINFO' => 'HTTP_CURL_VERSION(7,19,1) && defined(HTTP_HAVE_OPENSSL)'
 );
 $exclude = array(
        'PRIVATE', 'LASTSOCKET', 'FTP_ENTRY_PATH'
@@ -76,7 +81,7 @@ ob_start();
 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");
 }