support ignoring certain symbols
This commit is contained in:
parent
9003a9124a
commit
acab4e3b26
|
@ -1,5 +1,13 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
##### CONFIG
|
||||||
|
|
||||||
|
# symbols to ignore
|
||||||
|
IGNORE_SYM='luaL_pushmodule\|luaL_openlib'
|
||||||
|
|
||||||
|
##### CONFIG
|
||||||
|
|
||||||
|
|
||||||
# https://stackoverflow.com/a/13062682
|
# https://stackoverflow.com/a/13062682
|
||||||
uncomment() {
|
uncomment() {
|
||||||
[ $# -eq 2 ] && arg="$1" || arg=""
|
[ $# -eq 2 ] && arg="$1" || arg=""
|
||||||
|
@ -27,15 +35,15 @@ sym_regex='^LUA\(LIB\)\?_API\s\+\([^(]\+\)\s*(\([^)]\+\))\s\+(\([^)]\+\));'
|
||||||
|
|
||||||
# get funcptr declarations
|
# get funcptr declarations
|
||||||
ptrize() {
|
ptrize() {
|
||||||
grep '^LUA' | sed -e "s/$sym_regex/static \2(*\3) (\4);/"
|
grep '^LUA' | grep -v "$IGNORE_SYM" | sed -e "s/$sym_regex/static \2(*\3) (\4);/"
|
||||||
}
|
}
|
||||||
|
|
||||||
import_sym() {
|
import_sym() {
|
||||||
grep '^LUA' | sed -e "s/$sym_regex/\tIMPORT_SYMBOL(\3, \2, \4);/"
|
grep '^LUA' | grep -v "$IGNORE_SYM" | sed -e "s/$sym_regex/\tIMPORT_SYMBOL(\3, \2, \4);/"
|
||||||
}
|
}
|
||||||
|
|
||||||
export_sym() {
|
export_sym() {
|
||||||
grep '^LUA' | sed -e "s/$sym_regex/\t\tEXPORT_SYMBOL(\3),/"
|
grep '^LUA' | grep -v "$IGNORE_SYM" | sed -e "s/$sym_regex/\t\tEXPORT_SYMBOL(\3),/"
|
||||||
}
|
}
|
||||||
|
|
||||||
decl() {
|
decl() {
|
||||||
|
@ -47,7 +55,7 @@ decl() {
|
||||||
# funcptrs
|
# funcptrs
|
||||||
ptrize <<< "$header1"
|
ptrize <<< "$header1"
|
||||||
# defines
|
# defines
|
||||||
grep '^#' <<< "$header"
|
(grep '^#' | grep -v "$IGNORE_SYM") <<< "$header"
|
||||||
}
|
}
|
||||||
|
|
||||||
decl_import() {
|
decl_import() {
|
||||||
|
|
Loading…
Reference in New Issue