X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=scripts%2Fgen_curlinfo.php;h=f7c6cdb53d55ad0dfc5f3b124256495c1cb57fbc;hb=e29a410679b63b8f96b6890d1418f39d9ed489cc;hp=129833a2a9fe87c435eabfff2ebe482a19032520;hpb=aebfa7783e7b280bff4975649b20494e5eb932bc;p=m6w6%2Fext-http diff --git a/scripts/gen_curlinfo.php b/scripts/gen_curlinfo.php index 129833a..f7c6cdb 100644 --- a/scripts/gen_curlinfo.php +++ b/scripts/gen_curlinfo.php @@ -1,10 +1,13 @@ +#!/usr/bin/env php '7,14,1' ); @@ -43,7 +38,8 @@ $exclude = array( 'PRIVATE', 'LASTSOCKET', 'FTP_ENTRY_PATH' ); $translate = array( - 'HTTP_CONNECTCODE' => "connect_code" + 'HTTP_CONNECTCODE' => "connect_code", + 'COOKIELIST' => 'cookies', ); $templates = array( @@ -75,7 +71,6 @@ $templates = array( ' ); -$types = file_re('curl.h', '/^#\s*define\s+CURLINFO_(STRING|LONG|DOUBLE|SLIST|MASK|TYPEMASK)\s+(0x[0-9a-fA-F]+)\s*$/m'); $infos = file_re('curl.h', '/^\s*(CURLINFO_(\w+))\s*=\s*CURLINFO_(STRING|LONG|DOUBLE|SLIST)\s*\+\s*\d+\s*,?\s*$/m'); ob_start(); @@ -83,8 +78,7 @@ 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($translate[$short])) $short = $translate[$short]; - printf($templates[$type], $full, strtolower($short)); + printf($templates[$type], $full, strtolower((isset($translate[$short])) ? $translate[$short] : $short)); if (isset($ifdefs[$short])) printf("#endif\n"); }