1998-08-07 Martin Baulig <martin@home-of-linux.org> * glibtop.h (_glibtop): New fields `error_method', `sysdeps' and `required'. I added an improved error handling: the client can tell the libraries which fields are absolutely required for each features and if it fails to set one of them, this will create an error which is handled depending upon the `error_method'. * include/glibtop/open.h: Define some constants for `error_method'. * lib/sysdeps.c (glibtop_get_sysdeps_r): No longer actually call any sysdeps function, it now simply copies `server->sysdeps'. (_glibtop_init_hook_s): Added. List of functions to be called during `glibtop_init_s' set to `glibtop_init_<no-suid-feature>_s'. * include/glibtop/sysdeps.h (<glibtop/union.h>): Removed. (glibtop_init_func_t): New typedef. (_glibtop_init_hook_s): Added. * sysdeps/linux/*.c (glibtop_init_<feature>_s): New functions. (glibtop_get_proc_*): Zero is now a valid pid. * sysdeps/kernel/*.c (glibtop_init_<feature>_s): New functions. (glibtop_get_proc_*): Zero is now a valid pid. 1998-08-06 Martin Baulig <martin@home-of-linux.org>
130 lines
3.2 KiB
Awk
130 lines
3.2 KiB
Awk
BEGIN {
|
|
print "/* guile_names.c */";
|
|
print "/* This is a generated file. Please modify `guile-names.awk' */";
|
|
print "";
|
|
|
|
print "#include <glibtop.h>";
|
|
print "#include <glibtop/sysdeps.h>";
|
|
print "#include <glibtop/union.h>";
|
|
print "";
|
|
print "#include <guile/gh.h>";
|
|
|
|
print "";
|
|
|
|
}
|
|
|
|
function output(feature) {
|
|
print "SCM";
|
|
print "glibtop_guile_names_"feature" (void)";
|
|
print "{";
|
|
print "\tint i;";
|
|
print "\tSCM list;";
|
|
print "";
|
|
print "\tlist = gh_list (SCM_UNDEFINED);";
|
|
print "";
|
|
print "\tfor (i = 0; i < GLIBTOP_MAX_"toupper(feature)"; i++)";
|
|
print "\t\tlist = scm_append";
|
|
print "\t\t\t(gh_list (list,";
|
|
print "\t\t\t\t gh_list (gh_str02scm ((char *) glibtop_names_"feature" [i])),";
|
|
print "\t\t\t\t SCM_UNDEFINED));";
|
|
print "";
|
|
print "\treturn list;";
|
|
print "}";
|
|
|
|
print "";
|
|
|
|
print "SCM";
|
|
print "glibtop_guile_types_"feature" (void)";
|
|
print "{";
|
|
print "\tint i;";
|
|
print "\tSCM list;";
|
|
print "";
|
|
print "\tlist = gh_list (SCM_UNDEFINED);";
|
|
print "";
|
|
print "\tfor (i = 0; i < GLIBTOP_MAX_"toupper(feature)"; i++)";
|
|
print "\t\tlist = scm_append";
|
|
print "\t\t\t(gh_list (list,";
|
|
print "\t\t\t\t gh_list (gh_ulong2scm (glibtop_types_"feature" [i])),";
|
|
print "\t\t\t\t SCM_UNDEFINED));";
|
|
print "";
|
|
print "\treturn list;";
|
|
print "}";
|
|
|
|
print "";
|
|
|
|
print "SCM";
|
|
print "glibtop_guile_labels_"feature" (void)";
|
|
print "{";
|
|
print "\tint i;";
|
|
print "\tSCM list;";
|
|
print "";
|
|
print "\tlist = gh_list (SCM_UNDEFINED);";
|
|
print "";
|
|
print "\tfor (i = 0; i < GLIBTOP_MAX_"toupper(feature)"; i++)";
|
|
print "\t\tlist = scm_append";
|
|
print "\t\t\t(gh_list (list,";
|
|
print "\t\t\t\t gh_list (gh_str02scm (gettext";
|
|
print "\t\t\t\t\t\t\t(glibtop_labels_"feature" [i]))),";
|
|
print "\t\t\t\t SCM_UNDEFINED));";
|
|
print "";
|
|
print "\treturn list;";
|
|
print "}";
|
|
|
|
print "";
|
|
|
|
print "SCM";
|
|
print "glibtop_guile_descriptions_"feature" (void)";
|
|
print "{";
|
|
print "\tint i;";
|
|
print "\tSCM list;";
|
|
print "";
|
|
print "\tlist = gh_list (SCM_UNDEFINED);";
|
|
print "";
|
|
print "\tfor (i = 0; i < GLIBTOP_MAX_"toupper(feature)"; i++)";
|
|
print "\t\tlist = scm_append";
|
|
print "\t\t\t(gh_list (list,";
|
|
print "\t\t\t\t gh_list (gh_str02scm (gettext";
|
|
print "\t\t\t\t\t\t\t(glibtop_descriptions_"feature" [i]))),";
|
|
print "\t\t\t\t SCM_UNDEFINED));";
|
|
print "";
|
|
print "\treturn list;";
|
|
print "}";
|
|
|
|
print "";
|
|
}
|
|
|
|
/^[^#]/ {
|
|
line = $0;
|
|
split (line, line_fields, /\|/);
|
|
feature = line_fields[2];
|
|
sub(/^@/,"",feature);
|
|
|
|
features[feature] = feature;
|
|
}
|
|
|
|
END {
|
|
for (feature in features) {
|
|
output(feature);
|
|
}
|
|
|
|
print "void";
|
|
print "glibtop_boot_guile_names (void)";
|
|
print "{";
|
|
|
|
for (feature in features) {
|
|
print "\tgh_new_procedure0_0";
|
|
print "\t\t(\"glibtop-names-"feature"\", glibtop_guile_names_"feature");";
|
|
print "";
|
|
print "\tgh_new_procedure0_0";
|
|
print "\t\t(\"glibtop-types-"feature"\", glibtop_guile_types_"feature");";
|
|
print "";
|
|
print "\tgh_new_procedure0_0";
|
|
print "\t\t(\"glibtop-labels-"feature"\", glibtop_guile_labels_"feature");";
|
|
print "";
|
|
print "\tgh_new_procedure0_0";
|
|
print "\t\t(\"glibtop-descriptions-"feature"\", glibtop_guile_descriptions_"feature");";
|
|
}
|
|
print "}";
|
|
}
|
|
|