From abf854c16aaf5e8d089bce5becb3eac2d7a8be3c Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Sun, 11 Oct 1998 18:18:14 +0000 Subject: [PATCH] Added `guile-names.x' here and a rule to make it from `guile-names.c' 1998-10-11 Martin Baulig * names/Makefile.am (BUILT_SOURCES, CLEANFILES): Added `guile-names.x' here and a rule to make it from `guile-names.c' using guile-snarf. * names/guile-names.awk: Use the SCM_GLOBAL_VCELL macros and guile-snarf here; declared all `glibtop_guile_*' functions static. --- sysdeps/guile/ChangeLog | 7 ++++++ sysdeps/guile/names/Makefile.am | 7 ++++-- sysdeps/guile/names/guile-names.awk | 34 +++++++++++++++-------------- 3 files changed, 30 insertions(+), 18 deletions(-) diff --git a/sysdeps/guile/ChangeLog b/sysdeps/guile/ChangeLog index c353a4eb..08dd883e 100644 --- a/sysdeps/guile/ChangeLog +++ b/sysdeps/guile/ChangeLog @@ -1,5 +1,12 @@ 1998-10-11 Martin Baulig + * names/Makefile.am (BUILT_SOURCES, CLEANFILES): Added + `guile-names.x' here and a rule to make it from `guile-names.c' + using guile-snarf. + + * names/guile-names.awk: Use the SCM_GLOBAL_VCELL macros and + guile-snarf here; declared all `glibtop_guile_*' functions static. + * guile.awk: Declared all `glibtop_guile_get_*' functions static. * Makefile.am (BUILT_SOURCES, CLEANFILES): Added `guile.x'. diff --git a/sysdeps/guile/names/Makefile.am b/sysdeps/guile/names/Makefile.am index 725ddb7a..13321c9e 100644 --- a/sysdeps/guile/names/Makefile.am +++ b/sysdeps/guile/names/Makefile.am @@ -8,13 +8,16 @@ libgtop_guile_names_la_SOURCES = guile-names.c libgtop_guile_names_la_LDFLAGS = $(LT_VERSION_INFO) -BUILT_SOURCES = guile-names.c +BUILT_SOURCES = guile-names.c guile-names.x guile-names.c: guile-names.awk $(top_builddir)/config.h $(top_srcdir)/features.def $(AWK) -f $(srcdir)/guile-names.awk < $(top_srcdir)/features.def > gnc-t mv gnc-t guile-names.c +guile-names.x: guile-names.c + guile-snarf $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $< > $@ + EXTRA_DIST = guile-names.awk -CLEANFILES = guile-names.c +CLEANFILES = guile-names.c guile-names.x diff --git a/sysdeps/guile/names/guile-names.awk b/sysdeps/guile/names/guile-names.awk index 4790cae9..e8e24cea 100644 --- a/sysdeps/guile/names/guile-names.awk +++ b/sysdeps/guile/names/guile-names.awk @@ -14,7 +14,7 @@ BEGIN { } function output(feature) { - print "SCM"; + print "static SCM"; print "glibtop_guile_names_"feature" (void)"; print "{"; print "\tint i;"; @@ -33,7 +33,7 @@ function output(feature) { print ""; - print "SCM"; + print "static SCM"; print "glibtop_guile_types_"feature" (void)"; print "{"; print "\tint i;"; @@ -52,7 +52,7 @@ function output(feature) { print ""; - print "SCM"; + print "static SCM"; print "glibtop_guile_labels_"feature" (void)"; print "{"; print "\tint i;"; @@ -72,7 +72,7 @@ function output(feature) { print ""; - print "SCM"; + print "static SCM"; print "glibtop_guile_descriptions_"feature" (void)"; print "{"; print "\tint i;"; @@ -109,22 +109,24 @@ END { output(feature); } + for (feature in features) { + feature_name = feature; sub(/_/, "-", feature_name); + print "SCM_GLOBAL_VCELL (s_names_"feature", \"glibtop-names-"feature_name"\");"; + print "SCM_GLOBAL_VCELL (s_labels_"feature", \"glibtop-labels-"feature_name"\");"; + print "SCM_GLOBAL_VCELL (s_types_"feature", \"glibtop-types-"feature_name"\");"; + print "SCM_GLOBAL_VCELL (s_descriptions_"feature", \"glibtop-descriptions-"feature_name"\");"; + } + print ""; + print "void"; print "glibtop_boot_guile_names (void)"; print "{"; - + print "#include \"guile-names.x\""; 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 "SCM_SETCDR (s_names_"feature", glibtop_guile_names_"feature" ());"; + print "SCM_SETCDR (s_labels_"feature", glibtop_guile_labels_"feature" ());"; + print "SCM_SETCDR (s_types_"feature", glibtop_guile_types_"feature" ());"; + print "SCM_SETCDR (s_descriptions_"feature", glibtop_guile_descriptions_"feature" ());"; } print "}"; }