Hi guys,
Well, I decided to do another patch. I've inlined it and
attached it.
It adds multiline support to #if, #ifdef, etc.
And it detects declared functions not declared using
the AP[RU]_DECLARE scheme. I hope this is what you
guys meant.
Furthermore I had to do some cleanup in the substitutions
because when I read them over they didn't seem ok.
Sander
--- build/make_exports.awk Wed Jul 25 16:20:24 2001
+++ build/make_exports.awk.new Wed Jul 25 16:18:52 2001
@@ -26,6 +26,7 @@
TYPE_HEADER = 1
stackptr = 0
+ multiline = 0
}
function push(line) {
@@ -76,10 +77,19 @@
}
}
+/^.*/ {
+ if (multiline) {
+ multiline = $0 ~ /[\\]$/
+ push($0)
+ next
+ }
+}
+
/^[ \t]*AP[RU]?_DECLARE[^(]*[(][^)]*[)]([^ ]* )*[^(]+[(]/ {
sub("[ \t]*AP[RU]?_DECLARE[^(]*[(][^)]*[)][ \t]*", "")
- sub("[(].*", "")
- sub("([^ ]* (^([ \t]*[(])))+", "")
+ sub("[ \t]*[(].*", "")
+ sub("([^ ]* )+", "")
+ sub("[\*]+", "")
add_symbol($0)
next
@@ -97,6 +107,19 @@
next
}
+/^[ \t]*([a-zA-Z_][a-zA-Z0-9_]*[ \t]+)+[ \t\*]*[a-zA-Z_][a-zA-Z0-9_]*[
\t]*[(][^)]*[)][ \t]*;[ \t]*$/ {
+ if (!index($0, "typedef")) {
+ sub("^[ \t]+", "")
+ sub("[ \t]*[(].*", "")
+ sub("([^ ]* )+", "")
+ sub("[\*]+", "")
+
+ add_symbol($0)
+ }
+
+ next
+}
+
/^#[ \t]*if(ndef| !defined[(])([^_]*_)*H/ {
enter_scope(TYPE_HEADER)
next
@@ -104,6 +127,7 @@
/^#[ \t]*if([n]?def)? / {
enter_scope(TYPE_NORMAL)
+ multiline = $0 ~ /[\\]$/
push($0)
next
}
@@ -122,6 +146,7 @@
}
/^#[ \t]*elif/ {
+ multiline = $0 ~ /[\\]$/
push($0)
next
}
make_exports.patch