summaryrefslogtreecommitdiff
path: root/helpers
diff options
context:
space:
mode:
authorsascha <sascha@13f79535-47bb-0310-9956-ffa450edef68>2000-12-18 00:17:18 +0000
committersascha <sascha@13f79535-47bb-0310-9956-ffa450edef68>2000-12-18 00:17:18 +0000
commitf759a22454c9f0dddef19e74ddab527285a974a4 (patch)
tree674c78977b6e7c4f78d57e5a764a177971e809c6 /helpers
parentd9013594bcfcc30ed10b1fd2bbaca08e5a04df3c (diff)
downloadlibapr-f759a22454c9f0dddef19e74ddab527285a974a4.tar.gz
Drop the Perl dependency and use an awk script for creating apr.exports.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@60963 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'helpers')
-rw-r--r--helpers/make_export.awk50
1 files changed, 50 insertions, 0 deletions
diff --git a/helpers/make_export.awk b/helpers/make_export.awk
new file mode 100644
index 000000000..b58b657b3
--- /dev/null
+++ b/helpers/make_export.awk
@@ -0,0 +1,50 @@
+# Based on Ryan Bloom's make_export.pl
+
+/^#[ \t]*if(def)? APR_.*/ {
+ if (old_filename != FILENAME) {
+ if (old_filename != "") printf("%s", line)
+ macro_no = 0
+ found = 0
+ count = 0
+ old_filename = FILENAME
+ line = ""
+ }
+ macro_stack[macro_no++] = macro
+ macro = $2
+ found++
+ count++
+ line = line macro "\n"
+ next
+}
+
+/^#[ \t]*endif/ {
+ if (count > 0) {
+ count--
+ line = line "/" macro "\n"
+ macro = macro_stack[--macro_no]
+ }
+ if (found == count + 1) {
+ found--
+ line = ""
+ } else if (found > count + 1) {
+ found = 0
+ }
+ next
+}
+
+/^[ \t]*(APR_DECLARE[^(]*[(])?(const[ \t])?[a-z_]+[)]?[ \t]+[*]?([A-Za-z0-9_]+)\(/ {
+ if (found) {
+ found++
+ }
+ for (i = 0; i < count; i++) {
+ line = line "\t"
+ }
+ sub("^[ \t]*(APR_DECLARE[^(]*[(])?(const[ \t])?[a-z_]+[)]?[ \t]+[*]?", "");
+ sub("[(].*", "");
+ line = line $0 "\n"
+ next
+}
+
+END {
+ printf("%s", line)
+}