Files
libgtop/sysdeps/guile/names/guile-names.awk
Martin Baulig f07551a43d New file.
1998-07-29  Martin Baulig  <martin@home-of-linux.org>

	* guile/ChangeLog: New file.

	* features.def: New format - now includes type of return value
	and parameters.

	* lib/lib.awk: Changed to use new `features.def'.
	* sysdeps/guile/guile.awk: Dito;
	* sysdeps/guile/names/guile-names.awk: Dito.

	* libgtopConf.sh.in: Added
	`LIBGTOP_NAMES_LIBS', `LIBGTOP_NAMES_INCS',
	`LIBGTOP_GUILE_NAMES_LIBS', `LIBGTOP_GUILE_NAMES_INCS',
	`LIBGTOP_MAJOR_VERSION', `LIBGTOP_MINOR_VERSION'
	`LIBGTOP_VERSION', `libgtop_sysdeps_dir'.

	* acinclude.m4 (AC_LC_SYSDEPS): Removed since this has been
	replaced with `GNOME_LIBGTOP_SYSDEPS' long ago.

	* LIBGTOP-VERSION: New file.

	* */Makefile.am (INCLUDES): Removed; now defined in `configure.in'.

	* sysdeps/names/mountlist.c: New file.

	* lib/{init, open}.c (GTOP_SERVER): Renamed to `LIBGTOP_SERVER'.

	* configure.in (INCLUDES): Added definition.
	(libgtop_want_names): Always true; `libgtop_names.la' is now
	always created since some other programs rely upon it - but
	have to use `LIBGTOP_NAMES_LIBS' and `LIBGTOP_NAMES_INCS' to
	use it in your application.
	(libgtop_want_guile_names): Always true; but you have to use
	`LIBGTOP_GUILE_NAMES_LIBS' and `LIBGTOP_GUILE_NAMES_INCS' to
	use it in your application.
	(LIBGTOP_LIBS): Removed `-lgtop_names' and `-lgtop_guile_names'.
	(LIBGTOP_NAMES_LIBS): New variable. Use it to link your
	application with the names interface.
	(LIBGTOP_NAMES_INCS): New variable. Also #defines `GLIBTOP_NAMES'
	which is now required if your application wants to use the names
	interface.
	(LIBGTOP_GUILE_NAMES_LIBS): New variable. Use it to link your
	application with the guile names interface.
	(LIBGTOP_GUILE_NAMES_INCS): New variable. Also #defines
	`GLIBTOP_NAMES' and `GLIBTOP_GUILE_NAMES' which are now required
	if your application wants to use the guile names interface.
1998-07-29 22:01:31 +00:00

129 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 "";
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 "}";
}