src/ai/api/squirrel_export.awk
branchnoai
changeset 9542 fccf685f68ea
parent 9541 4bb34cea7fad
child 9547 baf86d35646a
equal deleted inserted replaced
9541:4bb34cea7fad 9542:fccf685f68ea
   191 	gsub("static", "", $0)
   191 	gsub("static", "", $0)
   192 	gsub("const", "", $0)
   192 	gsub("const", "", $0)
   193 	param_s = $0
   193 	param_s = $0
   194 	gsub("\\*", "", $0)
   194 	gsub("\\*", "", $0)
   195 	gsub("\\(.*", "", $0)
   195 	gsub("\\(.*", "", $0)
   196 	func = $2
   196 	funcname = $2
   197 	if (func == "") next
   197 	if (funcname == "") next
   198 
   198 
   199 	sub(".*\\(", "", param_s)
   199 	sub(".*\\(", "", param_s)
   200 	sub("\\).*", "", param_s)
   200 	sub("\\).*", "", param_s)
   201 
   201 
   202 	split(param_s, params, ",")
   202 	split(param_s, params, ",")
   203 	types = "x"
   203 	types = "x"
   204 	len = 1;
   204 	len = 1;
   205 	for (len = 1; params[len] != ""; len++) {
   205 	for (len = 1; params[len] != ""; len++) {
   206 		sub("^[ 	]*", "", params[len])
   206 		sub("^[ 	]*", "", params[len])
   207 		if (match(params[len], "\*")) {
   207 		if (match(params[len], "\\*")) {
   208 			if (match(params[len], "^char")) {
   208 			if (match(params[len], "^char")) {
   209 				types = types "s"
   209 				types = types "s"
   210 			} else {
   210 			} else {
   211 				types = types "p"
   211 				types = types "p"
   212 			}
   212 			}
   217 		}
   217 		}
   218 	}
   218 	}
   219 
   219 
   220 	if (is_static) {
   220 	if (is_static) {
   221 		static_method_size++
   221 		static_method_size++
   222 		static_methods[static_method_size, 0] = func
   222 		static_methods[static_method_size, 0] = funcname
   223 		static_methods[static_method_size, 1] = len
   223 		static_methods[static_method_size, 1] = len
   224 		static_methods[static_method_size, 2] = types
   224 		static_methods[static_method_size, 2] = types
   225 	} else {
   225 	} else {
   226 		method_size++
   226 		method_size++
   227 		methods[method_size, 0] = func
   227 		methods[method_size, 0] = funcname
   228 		methods[method_size, 1] = len
   228 		methods[method_size, 1] = len
   229 		methods[method_size, 2] = types
   229 		methods[method_size, 2] = types
   230 	}
   230 	}
   231 	next
   231 	next
   232 }
   232 }