summaryrefslogtreecommitdiff
path: root/libguile/guile-snarf.awk.in
diff options
context:
space:
mode:
authorGreg J. Badros <gjb@cs.washington.edu>1999-12-14 17:41:59 +0000
committerGreg J. Badros <gjb@cs.washington.edu>1999-12-14 17:41:59 +0000
commite8e9b690b4f0394f958e0613bc2a4d5e8c524518 (patch)
tree9368d40ade081bf917992e8f6092cc6d95104963 /libguile/guile-snarf.awk.in
parent5623a9b4590618773e7969b512850cd92bfd79ed (diff)
downloadguile-e8e9b690b4f0394f958e0613bc2a4d5e8c524518.tar.gz
* backtrace.c (scm_set_print_params_x): Renamed from
set_print_params_x. * guile-doc-snarf.in: Use guile-snarf.awk, not guile-doc-snarf.awk. Pass the basename of $filename * load.h: Added prototypes for scm_sys_library_dir, scm_sys_site_dir. * load.c (scm_sys_library_dir, scm_sys_site_dir): Added these functions, and took out the old scm_library_dir, scm_site_dir, scm_pkgdata_dir. Now the primitives are %package-data-dir (already existed), %library-dir, and %site-dir. * debug.c: Use SCM_MISC_ERROR when possible instead of using s_scm_* in a scm_misc_error() call. * Makefile.am: Use guile-snarf.awk, not guile-doc-snarf.awk. Make using guile-doc-snarf send stdout to $@ to create the .x file like guile-snarf does. * guile-snarf.awk.in: Added.
Diffstat (limited to 'libguile/guile-snarf.awk.in')
-rw-r--r--libguile/guile-snarf.awk.in52
1 files changed, 52 insertions, 0 deletions
diff --git a/libguile/guile-snarf.awk.in b/libguile/guile-snarf.awk.in
new file mode 100644
index 000000000..cb3ed40b2
--- /dev/null
+++ b/libguile/guile-snarf.awk.in
@@ -0,0 +1,52 @@
+#!/usr/bin/awk -f
+# Written by Greg J. Badros, <gjb@cs.washington.edu>
+# 12-Dec-1999
+
+BEGIN { FS="|";
+ filename = ARGV[1]; ARGV[1] = "";
+ dot_x_file = filename; dot_doc_file = filename;
+ sub(/\..*$/,".x",dot_x_file);
+ sub(/\..*$/,".doc",dot_doc_file);
+ # be sure to put something in the files to help make out
+ print "";
+ printf "" > dot_doc_file;
+}
+
+/^[ \t]*%%%/ { copy = $0;
+ gsub(/[ \t]*%%%/, "", copy);
+ gsub(/\$\$\$.*$/, "", copy);
+ print copy; }
+
+/\$\$\$/,/@@@/ { copy = $0;
+ if (match(copy,/\$\$\$R/)) { registering = 1; }
+ else {registering = 0; }
+ gsub(/.*\$\$\$./,"", copy);
+ gsub(/@@@.*/,"",copy);
+ gsub(/[ \t]+/," ", copy);
+ sub(/^[ \t]*/,"(", copy);
+ gsub(/\"/,"",copy);
+ numargs = gsub(/\([ \t]*void[ \t]*\)/,"()", copy);
+ sub(/ \(/," ",copy);
+ numargs = gsub(/SCM /,"", copy);
+ numcommas = gsub(/,/,"", copy);
+ numactuals = $2 + $3 + $4;
+ location = $5;
+ gsub(/\"/,"",location);
+ sub(/^[ \t]*/,"",location);
+ sub(/[ \t]*$/,"",location);
+ sub(/: /,":",location);
+ gsub(/[ \t]*\|.*$/,"",copy);
+ sub(/ \)/,")",copy);
+ if (numargs != numactuals && !registering)
+ { print location ":*** `" copy "' is improperly registered as having " numactuals " arguments" > /dev/stderr; }
+ print " \n" copy (registering?")":"") > dot_doc_file ; }
+
+/@@@/,/@!!!.*$/ { copy = $0;
+ gsub(/.*@@@/,"",copy);
+ sub(/^[ \t]*"?/,"", copy);
+ sub(/\"?[ \t]*@!!!.*$/,"", copy);
+ gsub(/\\\"/,"\"",copy);
+ gsub(/[ \t]*$/,"", copy);
+ if (copy != "") { print copy > dot_doc_file } }
+/@!!![ \t]/ { print "[" location "]" >> dot_doc_file; }
+