--- a/src/ai/api/squirrel_export.awk Sun Mar 25 21:53:57 2007 +0000
+++ b/src/ai/api/squirrel_export.awk Sun Mar 25 22:21:12 2007 +0000
@@ -136,10 +136,10 @@
# Static methods
mlen = 0
for (i = 1; i <= static_method_size; i++) {
- if (mlen <= length(static_methods[i])) mlen = length(static_methods[i])
+ if (mlen <= length(static_methods[i, 0])) mlen = length(static_methods[i, 0])
}
for (i = 1; i <= static_method_size; i++) {
- print " SQ" cls ".DefSQStaticMethod(engine, &" cls "::" static_methods[i] ", " substr(spaces, 1, mlen - length(static_methods[i])) "\"" static_methods[i] "\");"
+ print " SQ" cls ".DefSQStaticMethod(engine, &" cls "::" static_methods[i, 0] ", " substr(spaces, 1, mlen - length(static_methods[i, 0])) "\"" static_methods[i, 0] "\", " substr(spaces, 1, mlen - length(static_methods[i, 0])) "" static_methods[i, 1] ", \"" static_methods[i, 2] "\");"
delete static_methods[i]
}
if (static_method_size != 0) print ""
@@ -147,10 +147,10 @@
# Non-static methods
mlen = 0
for (i = 1; i <= method_size; i++) {
- if (mlen <= length(methods[i])) mlen = length(methods[i])
+ if (mlen <= length(methods[i, 0])) mlen = length(methods[i, 0])
}
for (i = 1; i <= method_size; i++) {
- print " SQ" cls ".DefSQMethod(engine, &" cls "::" methods[i] ", " substr(spaces, 1, mlen - length(methods[i])) "\"" methods[i] "\");"
+ print " SQ" cls ".DefSQMethod(engine, &" cls "::" methods[i, 0] ", " substr(spaces, 1, mlen - length(methods[i, 0])) "\"" methods[i, 0] "\", " substr(spaces, 1, mlen - length(methods[i, 0])) "" methods[i, 1] ", \"" methods[i, 2] "\");"
delete methods[i]
}
if (method_size != 0) print ""
@@ -190,15 +190,43 @@
gsub("virtual", "", $0)
gsub("static", "", $0)
gsub("const", "", $0)
+ param_s = $0
gsub("\\*", "", $0)
gsub("\\(.*", "", $0)
- if ($2 == "") next
+ func = $2
+ if (func == "") next
+
+ sub(".*\\(", "", param_s)
+ sub("\\).*", "", param_s)
+
+ split(param_s, params, ",")
+ types = "x"
+ len = 1;
+ for (len = 1; params[len] != ""; len++) {
+ sub("^[ ]*", "", params[len])
+ if (match(params[len], "\*")) {
+ if (match(params[len], "^char")) {
+ types = types "s"
+ } else {
+ types = types "p"
+ }
+ } else if (match(params[len], "^bool")) {
+ types = types "b"
+ } else {
+ types = types "i"
+ }
+ }
+
if (is_static) {
static_method_size++
- static_methods[static_method_size] = $2
+ static_methods[static_method_size, 0] = func
+ static_methods[static_method_size, 1] = len
+ static_methods[static_method_size, 2] = types
} else {
method_size++
- methods[method_size] = $2
+ methods[method_size, 0] = func
+ methods[method_size, 1] = len
+ methods[method_size, 2] = types
}
next
}