Use a (TYPE . DIMENSION)' pair for array types in glibtop-types-*'.

1999-01-22  Martin Baulig  <martin@home-of-linux.org>

	* names/guile-names.awk: Use a `(TYPE . DIMENSION)' pair for
	array types in `glibtop-types-*'.
This commit is contained in:
Martin Baulig
1999-01-22 13:50:20 +00:00
committed by Martin Baulig
parent 8262f295b7
commit 3f0e166e3f
2 changed files with 34 additions and 8 deletions

View File

@@ -1,3 +1,8 @@
1999-01-22 Martin Baulig <martin@home-of-linux.org>
* names/guile-names.awk: Use a `(TYPE . DIMENSION)' pair for
array types in `glibtop-types-*'.
1998-12-09 Martin Baulig <martin@home-of-linux.org> 1998-12-09 Martin Baulig <martin@home-of-linux.org>
* guile.awk: For arrays, make a gh_list out of it and add this list * guile.awk: For arrays, make a gh_list out of it and add this list

View File

@@ -32,20 +32,39 @@ function output(feature) {
print "}"; print "}";
print ""; print "";
print "static SCM"; print "static SCM";
print "glibtop_guile_types_"feature" (void)"; print "glibtop_guile_types_"feature" (void)";
print "{"; print "{";
print "\tint i;"; print "\tint i;";
print "\tSCM list;"; print "\tSCM list;";
print ""; print "";
print "\tlist = gh_list (SCM_UNDEFINED);";
print ""; out = "\tlist = gh_list (";
print "\tfor (i = 0; i < GLIBTOP_MAX_"toupper(feature)"; i++)";
print "\t\tlist = scm_append"; nr_elements = split (element_defs[feature], elements, /:/);
print "\t\t\t(gh_list (list,"; for (element = 1; element <= nr_elements; element++) {
print "\t\t\t\t gh_list (gh_ulong2scm (glibtop_types_"feature" [i])),"; list = elements[element];
print "\t\t\t\t SCM_UNDEFINED));"; type = elements[element];
sub(/\(.*/, "", type);
sub(/^.*\(/, "", list); sub(/\)$/, "", list);
count = split (list, fields, /,/);
for (field = 1; field <= count; field++) {
if (fields[field] ~ /^(\w+)\[([0-9]+)\]$/) {
split(fields[field], field_parts, /\[/);
fields[field] = field_parts[1];
sub(/\]/, "", field_parts[2]);
number = field_parts[2];
out=out"gh_cons\n\t\t\t";
out=out"(gh_ulong2scm (glibtop_types_"feature" ["field-1"]),\n\t\t\t";
out=out" gh_ulong2scm ("number")),\n\t\t\t";
} else {
out=out"gh_ulong2scm (glibtop_types_"feature" ["field-1"]),\n\t\t\t";
}
}
}
print out"SCM_UNDEFINED);";
print ""; print "";
print "\treturn list;"; print "\treturn list;";
print "}"; print "}";
@@ -97,9 +116,11 @@ function output(feature) {
line = $0; line = $0;
split (line, line_fields, /\|/); split (line, line_fields, /\|/);
feature = line_fields[2]; feature = line_fields[2];
element_def = line_fields[3];
sub(/^@/,"",feature); sub(/^@/,"",feature);
features[feature] = feature; features[feature] = feature;
element_defs[feature] = element_def;
} }
END { END {