diff --git a/java/define2java.pl b/java/define2java.pl new file mode 100755 index 000000000..a9d470a6f --- /dev/null +++ b/java/define2java.pl @@ -0,0 +1,22 @@ +#!/usr/bin/perl + +open(GCC, "gcc -E ../include/curl/curl.h|"); + +while() { + if($_ =~ /(CURLOPT_(.*)) += (.*)/) { + $var= $1; + $expr = $3; + $f=$3; + if($expr =~ / *(\d+) *\+ *(\d+)/) { + $expr = $1+$2; + } + + # nah, keep the CURL prefix to make them look like other + # languages' defines + # $var =~ s/^CURL//g; + + print " public static final int $var = $expr;\n"; + } +} + +close(GCC);