make_nw_export.awk revision db479b48bd4d75423ed4a45e15b75089d1a8ad72
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding# Licensed to the Apache Software Foundation (ASF) under one or more
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding# contributor license agreements. See the NOTICE file distributed with
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding# this work for additional information regarding copyright ownership.
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding# The ASF licenses this file to You under the Apache License, Version 2.0
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding# (the "License"); you may not use this file except in compliance with
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding# the License. You may obtain a copy of the License at
240b85022b73af58a6d971cd3d05d54037d8f682nd#
240b85022b73af58a6d971cd3d05d54037d8f682nd# http://www.apache.org/licenses/LICENSE-2.0
240b85022b73af58a6d971cd3d05d54037d8f682nd#
240b85022b73af58a6d971cd3d05d54037d8f682nd# Unless required by applicable law or agreed to in writing, software
240b85022b73af58a6d971cd3d05d54037d8f682nd# distributed under the License is distributed on an "AS IS" BASIS,
240b85022b73af58a6d971cd3d05d54037d8f682nd# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
240b85022b73af58a6d971cd3d05d54037d8f682nd# See the License for the specific language governing permissions and
240b85022b73af58a6d971cd3d05d54037d8f682nd# limitations under the License.
240b85022b73af58a6d971cd3d05d54037d8f682nd#
240b85022b73af58a6d971cd3d05d54037d8f682nd#
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes# Based on apr's make_export.awk, which is
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes# based on Ryan Bloom's make_export.pl
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes
eb3171a063fe502d50dd335c2d99c84eb7053935bnicholesBEGIN {
eb3171a063fe502d50dd335c2d99c84eb7053935bnicholes printf(" (APACHE2)\n")
eb3171a063fe502d50dd335c2d99c84eb7053935bnicholes}
eb3171a063fe502d50dd335c2d99c84eb7053935bnicholes
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes# List of functions that we don't support, yet??
ccc708e8694746878551e07afab3b9a4f14cee84bnicholes#/ap_some_name/{next}
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholesfunction add_symbol (sym_name) {
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes if (count) {
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes found++
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes }
ccc708e8694746878551e07afab3b9a4f14cee84bnicholes gsub (/ /, "", sym_name)
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes line = line sym_name ",\n"
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes if (count == 0) {
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes printf(" %s", line)
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes line = ""
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes }
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes}
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes
c5add43aef9b32d94361f3e45749811f2a1d7148bnicholes/^[ \t]*AP([RU]|_CORE)?_DECLARE[^(]*[(][^)]*[)]([^ ]* )*[^(]+[(]/ {
c5add43aef9b32d94361f3e45749811f2a1d7148bnicholes sub("[ \t]*AP([RU]|_CORE)?_DECLARE[^(]*[(][^)]*[)][ \t]*", "")
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes sub("[(].*", "")
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes sub("([^ ]* (^([ \t]*[(])))+", "")
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes add_symbol($0)
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes next
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes}
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes
aa158cddda558cd394ca22c3838bd4927bbe8971bnicholes/^[ \t]*AP_DECLARE_HOOK[^(]*[(][^)]*/ {
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes split($0, args, ",")
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes symbol = args[2]
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes sub("^[ \t]+", "", symbol)
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes sub("[ \t]+$", "", symbol)
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes add_symbol("ap_hook_" symbol)
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes add_symbol("ap_hook_get_" symbol)
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes add_symbol("ap_run_" symbol)
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes next
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes}
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes
7640ae77eade5ef41bb3bf964a9d437e64c55da3bnicholes/^[ \t]*APR_POOL_DECLARE_ACCESSOR[^(]*[(][^)]*[)]/ {
7640ae77eade5ef41bb3bf964a9d437e64c55da3bnicholes sub("[ \t]*APR_POOL_DECLARE_ACCESSOR[^(]*[(]", "", $0)
7640ae77eade5ef41bb3bf964a9d437e64c55da3bnicholes sub("[)].*$", "", $0)
7640ae77eade5ef41bb3bf964a9d437e64c55da3bnicholes add_symbol("apr_" $0 "_pool_get")
7640ae77eade5ef41bb3bf964a9d437e64c55da3bnicholes next
7640ae77eade5ef41bb3bf964a9d437e64c55da3bnicholes}
7640ae77eade5ef41bb3bf964a9d437e64c55da3bnicholes
7640ae77eade5ef41bb3bf964a9d437e64c55da3bnicholes/^[ \t]*APR_DECLARE_INHERIT_SET[^(]*[(][^)]*[)]/ {
7640ae77eade5ef41bb3bf964a9d437e64c55da3bnicholes sub("[ \t]*APR_DECLARE_INHERIT_SET[^(]*[(]", "", $0)
7640ae77eade5ef41bb3bf964a9d437e64c55da3bnicholes sub("[)].*$", "", $0)
7640ae77eade5ef41bb3bf964a9d437e64c55da3bnicholes add_symbol("apr_" $0 "_inherit_set")
7640ae77eade5ef41bb3bf964a9d437e64c55da3bnicholes next
7640ae77eade5ef41bb3bf964a9d437e64c55da3bnicholes}
7640ae77eade5ef41bb3bf964a9d437e64c55da3bnicholes
7640ae77eade5ef41bb3bf964a9d437e64c55da3bnicholes/^[ \t]*APR_DECLARE_INHERIT_UNSET[^(]*[(][^)]*[)]/ {
7640ae77eade5ef41bb3bf964a9d437e64c55da3bnicholes sub("[ \t]*APR_DECLARE_INHERIT_UNSET[^(]*[(]", "", $0)
7640ae77eade5ef41bb3bf964a9d437e64c55da3bnicholes sub("[)].*$", "", $0)
7640ae77eade5ef41bb3bf964a9d437e64c55da3bnicholes add_symbol("apr_" $0 "_inherit_unset")
7640ae77eade5ef41bb3bf964a9d437e64c55da3bnicholes next
7640ae77eade5ef41bb3bf964a9d437e64c55da3bnicholes}
7640ae77eade5ef41bb3bf964a9d437e64c55da3bnicholes
f45af25ac6e8877711b4779ce94e6cd5422492d5bnicholes/^[ \t]*(extern[ \t]+)?AP[RU]?_DECLARE_DATA .*;$/ {
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes varname = $NF;
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes gsub( /[*;]/, "", varname);
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes gsub( /\[.*\]/, "", varname);
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes add_symbol(varname);
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes}
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes#END {
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes# printf(" %s", line)
43aea3e7c517d422b84242bd4474d94802d3b4e3bnicholes#}