summaryrefslogtreecommitdiff
path: root/gr-run-waveform/gr-run-waveform.cc
diff options
context:
space:
mode:
authorEric Blossom2010-12-03 21:36:03 -0800
committerEric Blossom2010-12-03 21:36:03 -0800
commitb00008cb27c9170883c9ecd56c857a9937ec6558 (patch)
treefb60f6cf57c7c980fef9cdd793be50bcc34ab855 /gr-run-waveform/gr-run-waveform.cc
parent378bace460ed556d4e1783c9585f9417e84385eb (diff)
downloadgnuradio-b00008cb27c9170883c9ecd56c857a9937ec6558.tar.gz
gnuradio-b00008cb27c9170883c9ecd56c857a9937ec6558.tar.bz2
gnuradio-b00008cb27c9170883c9ecd56c857a9937ec6558.zip
Override primitive-load et al. before loading code.
Diffstat (limited to 'gr-run-waveform/gr-run-waveform.cc')
-rw-r--r--gr-run-waveform/gr-run-waveform.cc45
1 files changed, 25 insertions, 20 deletions
diff --git a/gr-run-waveform/gr-run-waveform.cc b/gr-run-waveform/gr-run-waveform.cc
index 450a3a96e..f9acfb461 100644
--- a/gr-run-waveform/gr-run-waveform.cc
+++ b/gr-run-waveform/gr-run-waveform.cc
@@ -30,26 +30,31 @@
* Load and run a waveform defined with define-waveform
* usage: gr-run-waveform filename.wfd [args...]
*/
-static const char *code =
-"(set! %load-verbosely #t) \n"
-"(define primitive-load xyzzy-primitive-load) \n"
-"(define primitive-load-path xyzzy-primitive-load-path) \n"
-"(define search-path xyzzy-search-path) \n"
-"(define search-load-path xyzzy-search-load-path) \n"
-"\n"
-"(primitive-load-path \"gnuradio/run-waveform\") \n"
-"\n"
-"(define (main args) \n"
-" (if (not (>= (length args) 2)) \n"
-" (let ((port (current-error-port))) \n"
-" (display \"usage: \" port) \n"
-" (display (car args) port) \n"
-" (display \" filename.wfd [args...]\n\" port) \n"
-" (exit 1))) \n"
-" (apply run-waveform (cdr args))) \n"
-"\n"
-"(main (command-line)) \n"
-;
+static const char *code = "\
+(set! %load-verbosely #t) \n\
+ \n\
+(save-module-excursion \n\
+ (lambda () \n\
+ (set-current-module (resolve-module '(guile))) \n\
+ (set! primitive-load xyzzy-primitive-load) \n\
+ (set! primitive-load-path xyzzy-primitive-load-path) \n\
+ (set! search-path xyzzy-search-path) \n\
+ (set! %search-load-path %xyzzy-search-load-path))) \n\
+ \n\
+(primitive-load-path \"gnuradio/run-waveform\") \n\
+ \n\
+(define (main args) \n\
+ (if (not (>= (length args) 2)) \n\
+ (let ((port (current-error-port))) \n\
+ (display \"usage: \" port) \n\
+ (display (car args) port) \n\
+ (display \" filename.wfd [args...]\n\" port) \n\
+ (exit 1))) \n\
+ (apply run-waveform (cdr args))) \n\
+ \n\
+(main (command-line)) \n\
+";
+
static void