From 609771861a214f9564401dd71476a42dd789cc8c Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Mon, 18 Dec 2000 00:17:18 +0000 Subject: Drop the Perl dependency and use an awk script for creating apr.exports. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60963 13f79535-47bb-0310-9956-ffa450edef68 --- helpers/make_export.awk | 50 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 helpers/make_export.awk (limited to 'helpers') 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) +} -- cgit v1.2.1