diff options
Diffstat (limited to 'gnuradio-core')
-rw-r--r-- | gnuradio-core/src/guile/gnuradio/core.scm | 11 | ||||
-rw-r--r-- | gnuradio-core/src/guile/tests/io_ctors.test | 23 | ||||
-rw-r--r-- | gnuradio-core/src/lib/io/gr_message_source.i | 13 |
3 files changed, 32 insertions, 15 deletions
diff --git a/gnuradio-core/src/guile/gnuradio/core.scm b/gnuradio-core/src/guile/gnuradio/core.scm index b24d5afa9..9c69cea42 100644 --- a/gnuradio-core/src/guile/gnuradio/core.scm +++ b/gnuradio-core/src/guile/gnuradio/core.scm @@ -1,6 +1,7 @@ ;;; Glue the separate pieces of gnuradio-core into a single module (define-module (gnuradio core) + #:use-module (oop goops) #:use-module (gnuradio gnuradio_core_runtime) #:use-module (gnuradio runtime-shim) #:use-module (gnuradio gnuradio_core_filter) @@ -8,7 +9,7 @@ #:use-module (gnuradio gnuradio_core_general) #:use-module (gnuradio gnuradio_core_gengen) #:use-module (gnuradio gnuradio_core_hier) - #:duplicates (merge-generics check)) + #:duplicates (merge-generics replace check)) (re-export-all '(gnuradio gnuradio_core_runtime)) (re-export-all '(gnuradio runtime-shim)) @@ -18,6 +19,14 @@ (re-export-all '(gnuradio gnuradio_core_gengen)) (re-export-all '(gnuradio gnuradio_core_hier)) +;; Work around problem with gr:message-source +(define-generic gr:message-source) +(define-method (gr:message-source itemsize (msgq <gr-msg-queue-sptr>)) + (gr:message-source-msgq-ctor itemsize msgq)) +(define-method (gr:message-source itemsize (limit <integer>)) + (gr:message-source-limit-ctor itemsize limit)) +(export gr:message-source) + ;;; Return #t if x is not #f (define-public (true? x) (and x #t)) diff --git a/gnuradio-core/src/guile/tests/io_ctors.test b/gnuradio-core/src/guile/tests/io_ctors.test index b74d66cda..99c84ae37 100644 --- a/gnuradio-core/src/guile/tests/io_ctors.test +++ b/gnuradio-core/src/guile/tests/io_ctors.test @@ -29,6 +29,10 @@ (use-modules (gnuradio core)) (use-modules (oop goops)) + +(define (rm-foo) + (false-if-exception (delete-file "foo"))) + ;;; Add test code for all constructors in these files ;;; @@ -36,23 +40,24 @@ (pass-if (true? (gr:file-descriptor-sink 1 1))) ;;; ./io/gr_file_descriptor_source.h FIXME: not found -;; (pass-if (true? (gr:file-descriptor-source 1 1 false))) +;; (pass-if (true? (gr:file-descriptor-source 1 1 #f))) ;;; ./io/gr_file_sink.h (pass-if (true? (gr:file-sink 1 "foo"))) ;;; ./io/gr_file_source.h FIXME: not found -;; (pass-if (true? (gr:file-source 1 "foo" false))) +;; (pass-if (true? (gr:file-source 1 "foo" #f))) ;;; ./io/gr_histo_sink_f.h FIXME: not found ;; gr_make_histo_sink_f (gr_msg_queue_sptr msgq); ;; (pass-if (true? (gr:histo-sink-f 1))) -;;; ./io/gr_message_sink.h FIXME: not found -;; (pass-if (true? (gr:message-sink 1 1 false))) +;;; ./io/gr_message_sink.h +(pass-if (true? (gr:message-sink 1 (gr:msg-queue) #f))) -;;; ./io/gr_message_source.h FIXME: not found -;; (pass-if (true? (gr:message-source 1.0 0))) +;;; ./io/gr_message_source.h +(pass-if (true? (gr:message-source 1 1))) +(pass-if (true? (gr:message-source 1 (gr:msg-queue)))) ;;; ./io/gr_oscope_sink_f.h FIXME: not found ;; _oscope_sink_x (const std::string name, gr_io_signature_sptr input_sig, @@ -65,14 +70,14 @@ ;; (pass-if (true? (gr:oscope_sink_x "foo" 1 1))) ;;; ./io/gr_udp_sink.h FIXME: not found -;; (pass-if (true? (gr:udp-sink 1 "foo" 1472 true))) +;; (pass-if (true? (gr:udp-sink 1 "foo" 1472 #t))) ;;; ./io/gr_udp_source.h FIXME: not found -;; (pass-if (true? (gr:message-source 0 "foo" 0 1472 true true))) +;; (pass-if (true? (gr:message-source 0 "foo" 0 1472 #t #t))) ;;; ./io/gr_wavfile_sink.h FIXME: not found ;; (pass-if (true? (gr:message-source "foo" 1 1 1))) ;;; ./io/gr_wavfile_source.h FIXME: not found -;; (pass-if (true? (gr:message-source "foo" false))) +;; (pass-if (true? (gr:message-source "foo" #f))) diff --git a/gnuradio-core/src/lib/io/gr_message_source.i b/gnuradio-core/src/lib/io/gr_message_source.i index 3566ee5a7..e4e2016d0 100644 --- a/gnuradio-core/src/lib/io/gr_message_source.i +++ b/gnuradio-core/src/lib/io/gr_message_source.i @@ -20,12 +20,16 @@ * Boston, MA 02110-1301, USA. */ -#ifdef SWIGGUILE -#warning "gr_message_source.i: FIXME being ignored by swig/guile for now" -#else - GR_SWIG_BLOCK_MAGIC(gr,message_source); +#ifdef SWIGGUILE +// Rename these. Without this, the primitive bindings are OK, but the +// goops bindings try to create a bogus generic-function... +// See core.scm for the second part of the workaround. +%rename(message_source_limit_ctor) gr_make_message_source(size_t itemsize, int msgq_limit); +%rename(message_source_msgq_ctor) gr_make_message_source(size_t itemsize, gr_msg_queue_sptr msgq); +#endif + gr_message_source_sptr gr_make_message_source (size_t itemsize, int msgq_limit=0); gr_message_source_sptr gr_make_message_source (size_t itemsize, gr_msg_queue_sptr msgq); @@ -40,4 +44,3 @@ class gr_message_source : public gr_sync_block gr_msg_queue_sptr msgq() const; }; -#endif |