Now using correct number of parameters in `gh_new_procedure'.

This commit is contained in:
Martin Baulig
1998-08-10 16:55:19 +00:00
parent d44df22180
commit b6885555c1

View File

@@ -34,9 +34,12 @@ function make_output(line) {
sub(/^@/,"",feature); sub(/^@/,"",feature);
features[feature] = feature; features[feature] = feature;
total_nr_params = 0;
if (param_def == "string") { if (param_def == "string") {
call_param = ", gh_scm2newstr( "line_fields[5]", NULL)"; call_param = ", gh_scm2newstr( "line_fields[5]", NULL)";
param_decl = "SCM "line_fields[5]; param_decl = "SCM "line_fields[5];
total_nr_params = 1;
} else { } else {
call_param = ""; call_param = "";
param_decl = ""; param_decl = "";
@@ -47,6 +50,7 @@ function make_output(line) {
sub(/\(.*/, "", type); sub(/\(.*/, "", type);
sub(/^\w+\(/, "", list); sub(/\)$/, "", list); sub(/^\w+\(/, "", list); sub(/\)$/, "", list);
count = split (list, fields, /,/); count = split (list, fields, /,/);
total_nr_params = total_nr_params + count;
for (field = 1; field <= count; field++) { for (field = 1; field <= count; field++) {
if (param_decl != "") if (param_decl != "")
param_decl = param_decl", "; param_decl = param_decl", ";
@@ -57,6 +61,8 @@ function make_output(line) {
if (param_decl == "") if (param_decl == "")
param_decl = "void"; param_decl = "void";
} }
nr_params_field[feature] = total_nr_params;
output = "SCM\nglibtop_guile_get_"feature" ("param_decl")\n{\n"; output = "SCM\nglibtop_guile_get_"feature" ("param_decl")\n{\n";
@@ -117,13 +123,7 @@ END {
print "{"; print "{";
for (feature in features) { for (feature in features) {
if (feature ~ /^proc_/) { print "\tgh_new_procedure"nr_params_field[feature]"_0";
print "\tgh_new_procedure1_0";
} else if (feature ~ /^fsusage$/) {
print "\tgh_new_procedure1_0";
} else {
print "\tgh_new_procedure0_0";
}
print "\t\t(\"glibtop-get-"feature"\", glibtop_guile_get_"feature");"; print "\t\t(\"glibtop-get-"feature"\", glibtop_guile_get_"feature");";
} }
print "}"; print "}";