mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
C header to java converter
This commit is contained in:
parent
d712a4e800
commit
04c10e021c
22
java/define2java.pl
Executable file
22
java/define2java.pl
Executable file
@ -0,0 +1,22 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
open(GCC, "gcc -E ../include/curl/curl.h|");
|
||||
|
||||
while(<GCC>) {
|
||||
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);
|
Loading…
Reference in New Issue
Block a user