From 04c10e021c426beedf9f7b6f82d6d90ecbdb1cae Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 10 Apr 2001 15:30:01 +0000 Subject: [PATCH] C header to java converter --- java/define2java.pl | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 java/define2java.pl 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);