Commit a8561d46 authored by Brian Havard's avatar Brian Havard
Browse files

Sander says:

  I missed the hook declarations in my previous
  script. This is added by the patch below.

  The patch also removes unneeded ; that slipped
  in because I use c a lot more than awk :)

  I moved a rule around so removal of leading
  whitespace could go into one rule
  (see AP[RU]?_DECLARE).

  Also removed the additional idx variable in
  favor of checking the return value of the
  index function.

Submitted by:	Sander Striker <striker@apache.org>
Reviewed by:	Brian Havard <brianh@kheldar.apana.org.au>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89650 13f79535-47bb-0310-9956-ffa450edef68
parent ad88eab6
Loading
Loading
Loading
Loading
+17 −8
Original line number Diff line number Diff line
@@ -70,24 +70,33 @@ function leave_scope() {
}

function add_symbol(symbol) {
    idx = index(symbol, "#")

    if (!idx) {
    if (!index(symbol, "#")) {
        push("const void *ap_hack_" symbol " = (const void *)" symbol ";")
        scope_used[scope] = 1
    }
}

/^[ \t]*AP[RU]?_DECLARE[^(]*[(][^)]*[)]([^ ]* )*[^(]+[(]/ {
    sub("[ \t]*AP[RU]?_DECLARE[^(]*[(][^)]*[)]", "");
    sub("[(].*", "");
    sub("^[ \t]+", "");
    sub("([^ ]* ^([ \t]*[(]))*", "");
    sub("[ \t]*AP[RU]?_DECLARE[^(]*[(][^)]*[)][ \t]*", "")
    sub("[(].*", "")
    sub("([^ ]* ^([ \t]*[(]))*", "")

    add_symbol($0)
    next
}

/^[ \t]*AP_DECLARE_HOOK[^(]*[(][^)]*[)]/ {
    split($0, args, ",")
    symbol = args[2]
    sub("^[ \t]+", "", symbol)
    sub("[ \t]+$", "", symbol)

    add_symbol("ap_hook_" symbol)
    add_symbol("ap_hook_get_" symbol)
    add_symbol("ap_run_" symbol)
    next
}

/^#[ \t]*if(ndef| !defined[(])([^_]*_)*H/ {
    enter_scope(TYPE_HEADER)
    next