make_nw_export.awk 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. # Based on apr's make_export.awk, which is
  2. # based on Ryan Bloom's make_export.pl
  3. BEGIN {
  4. printf(" (APRLIB)\n")
  5. }
  6. # List of functions that we don't support, yet??
  7. #/fspr_##name##_set_inherit/{next}
  8. #/fspr_##name##_unset_inherit/{next}
  9. function add_symbol (sym_name) {
  10. if (count) {
  11. found++
  12. }
  13. gsub (/ /, "", sym_name)
  14. line = line sym_name ",\n"
  15. if (count == 0) {
  16. printf(" %s", line)
  17. line = ""
  18. }
  19. }
  20. /^[ \t]*AP[RUI]?_DECLARE[^(]*[(][^)]*[)]([^ ]* )*[^(]+[(]/ {
  21. sub("[ \t]*AP[RUI]?_DECLARE[^(]*[(][^)]*[)][ \t]*", "")
  22. sub("[(].*", "")
  23. sub("([^ ]* (^([ \t]*[(])))+", "")
  24. add_symbol($0)
  25. next
  26. }
  27. /^[ \t]*AP_DECLARE_HOOK[^(]*[(][^)]*/ {
  28. split($0, args, ",")
  29. symbol = args[2]
  30. sub("^[ \t]+", "", symbol)
  31. sub("[ \t]+$", "", symbol)
  32. add_symbol("ap_hook_" symbol)
  33. add_symbol("ap_hook_get_" symbol)
  34. add_symbol("ap_run_" symbol)
  35. next
  36. }
  37. /^[ \t]*APR_POOL_DECLARE_ACCESSOR[^(]*[(][^)]*[)]/ {
  38. sub("[ \t]*APR_POOL_DECLARE_ACCESSOR[^(]*[(]", "", $0)
  39. sub("[)].*$", "", $0)
  40. add_symbol("fspr_" $0 "_pool_get")
  41. next
  42. }
  43. /^[ \t]*APR_DECLARE_INHERIT_SET[^(]*[(][^)]*[)]/ {
  44. sub("[ \t]*APR_DECLARE_INHERIT_SET[^(]*[(]", "", $0)
  45. sub("[)].*$", "", $0)
  46. add_symbol("fspr_" $0 "_inherit_set")
  47. next
  48. }
  49. /^[ \t]*APR_DECLARE_INHERIT_UNSET[^(]*[(][^)]*[)]/ {
  50. sub("[ \t]*APR_DECLARE_INHERIT_UNSET[^(]*[(]", "", $0)
  51. sub("[)].*$", "", $0)
  52. add_symbol("fspr_" $0 "_inherit_unset")
  53. next
  54. }
  55. /^[ \t]*AP[RUI]?_DECLARE_DATA .*;$/ {
  56. varname = $NF;
  57. gsub( /[*;]/, "", varname);
  58. gsub( /\[.*\]/, "", varname);
  59. add_symbol(varname);
  60. }
  61. #END {
  62. # printf(" %s", line)
  63. #}