summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/lib
diff options
context:
space:
mode:
authorEric Blossom2010-11-05 19:43:33 -0700
committerEric Blossom2010-11-10 12:17:57 -0800
commit81867e5dfd939d8afdacbe22c6e2d41d4bc4b37e (patch)
tree2f97663190ca0c577171801babad45c498e58a88 /gnuradio-core/src/lib
parent4216a7b3faae37e304fff380ff66226dabd2f59b (diff)
downloadgnuradio-81867e5dfd939d8afdacbe22c6e2d41d4bc4b37e.tar.gz
gnuradio-81867e5dfd939d8afdacbe22c6e2d41d4bc4b37e.tar.bz2
gnuradio-81867e5dfd939d8afdacbe22c6e2d41d4bc4b37e.zip
Create guile QA framework.
Also moves hand coded files out of gnuradio-core/src/lib/swig/gnuradio that were getting nuked by make clean.
Diffstat (limited to 'gnuradio-core/src/lib')
-rw-r--r--gnuradio-core/src/lib/swig/Makefile.am12
-rw-r--r--gnuradio-core/src/lib/swig/Swig/common.scm76
-rw-r--r--gnuradio-core/src/lib/swig/gnuradio/core.scm19
-rw-r--r--gnuradio-core/src/lib/swig/gnuradio/export-safely.scm90
-rw-r--r--gnuradio-core/src/lib/swig/gnuradio/runtime-shim.scm89
5 files changed, 0 insertions, 286 deletions
diff --git a/gnuradio-core/src/lib/swig/Makefile.am b/gnuradio-core/src/lib/swig/Makefile.am
index 54cbebeb1..5e003bdf2 100644
--- a/gnuradio-core/src/lib/swig/Makefile.am
+++ b/gnuradio-core/src/lib/swig/Makefile.am
@@ -56,18 +56,6 @@ nobase_swiginclude_HEADERS = \
guile/std_complex.i
-if GUILE
-# This is the top level guile file, which loads all the other scm files
-# for gnuradio. This has to be installed top level to be found in the
-# default search path.
-nobase_guile_DATA = \
- gnuradio/core.scm \
- gnuradio/export-safely.scm \
- gnuradio/runtime-shim.scm \
- Swig/common.scm
-endif
-
-
if PYTHON
AM_CPPFLAGS = -I$(srcdir) $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) \
$(WITH_INCLUDES)
diff --git a/gnuradio-core/src/lib/swig/Swig/common.scm b/gnuradio-core/src/lib/swig/Swig/common.scm
deleted file mode 100644
index a51d3a71d..000000000
--- a/gnuradio-core/src/lib/swig/Swig/common.scm
+++ /dev/null
@@ -1,76 +0,0 @@
-;;;************************************************************************
-;;;*common.scm
-;;;*
-;;;* This file contains generic SWIG GOOPS classes for generated
-;;;* GOOPS file support
-;;;*
-;;;* Copyright (C) 2003 John Lenz (jelenz@wisc.edu)
-;;;* Copyright (C) 2004 Matthias Koeppe (mkoeppe@mail.math.uni-magdeburg.de)
-;;;*
-;;;* This file may be freely redistributed without license or fee provided
-;;;* this copyright message remains intact.
-;;;************************************************************************
-
-(define-module (Swig swigrun))
-
-(define-module (Swig common)
- #:use-module (oop goops)
- #:use-module (Swig swigrun))
-
-(define-class <swig-metaclass> (<class>)
- (new-function #:init-value #f))
-
-(define-method (initialize (class <swig-metaclass>) initargs)
- (slot-set! class 'new-function (get-keyword #:new-function initargs #f))
- (next-method))
-
-(define-class <swig> ()
- (swig-smob #:init-value #f)
- #:metaclass <swig-metaclass>
-)
-
-(define-method (initialize (obj <swig>) initargs)
- (next-method)
- (slot-set! obj 'swig-smob
- (let ((arg (get-keyword #:init-smob initargs #f)))
- (if arg
- arg
- (let ((ret (apply (slot-ref (class-of obj) 'new-function) (get-keyword #:args initargs '()))))
- ;; if the class is registered with runtime environment,
- ;; new-Function will return a <swig> goops class. In that case, extract the smob
- ;; from that goops class and set it as the current smob.
- (if (slot-exists? ret 'swig-smob)
- (slot-ref ret 'swig-smob)
- ret))))))
-
-(define (display-address o file)
- (display (number->string (object-address o) 16) file))
-
-(define (display-pointer-address o file)
- ;; Don't fail if the function SWIG-PointerAddress is not present.
- (let ((address (false-if-exception (SWIG-PointerAddress o))))
- (if address
- (begin
- (display " @ " file)
- (display (number->string address 16) file)))))
-
-(define-method (write (o <swig>) file)
- ;; We display _two_ addresses to show the object's identity:
- ;; * first the address of the GOOPS proxy object,
- ;; * second the pointer address.
- ;; The reason is that proxy objects are created and discarded on the
- ;; fly, so different proxy objects for the same C object will appear.
- (let ((class (class-of o)))
- (if (slot-bound? class 'name)
- (begin
- (display "#<" file)
- (display (class-name class) file)
- (display #\space file)
- (display-address o file)
- (display-pointer-address o file)
- (display ">" file))
- (next-method))))
-
-(export <swig-metaclass> <swig>)
-
-;;; common.scm ends here
diff --git a/gnuradio-core/src/lib/swig/gnuradio/core.scm b/gnuradio-core/src/lib/swig/gnuradio/core.scm
deleted file mode 100644
index f13a8fb60..000000000
--- a/gnuradio-core/src/lib/swig/gnuradio/core.scm
+++ /dev/null
@@ -1,19 +0,0 @@
-;;; Glue the separate pieces of gnuradio-core into a single module
-
-(define-module (gnuradio core)
- #:use-module (gnuradio gnuradio_core_runtime)
- #:use-module (gnuradio runtime-shim)
- #:use-module (gnuradio gnuradio_core_filter)
- #:use-module (gnuradio gnuradio_core_io)
- #:use-module (gnuradio gnuradio_core_general)
- #:use-module (gnuradio gnuradio_core_gengen)
- #:use-module (gnuradio gnuradio_core_hier)
- #:duplicates (merge-generics check))
-
-(re-export-all '(gnuradio gnuradio_core_runtime))
-(re-export-all '(gnuradio runtime-shim))
-(re-export-all '(gnuradio gnuradio_core_filter))
-(re-export-all '(gnuradio gnuradio_core_io))
-(re-export-all '(gnuradio gnuradio_core_general))
-(re-export-all '(gnuradio gnuradio_core_gengen))
-(re-export-all '(gnuradio gnuradio_core_hier))
diff --git a/gnuradio-core/src/lib/swig/gnuradio/export-safely.scm b/gnuradio-core/src/lib/swig/gnuradio/export-safely.scm
deleted file mode 100644
index 664292d2b..000000000
--- a/gnuradio-core/src/lib/swig/gnuradio/export-safely.scm
+++ /dev/null
@@ -1,90 +0,0 @@
-;;;
-;;; Copyright 2010 Free Software Foundation, Inc.
-;;;
-;;; This file is part of GNU Radio
-;;;
-;;; GNU Radio is free software; you can redistribute it and/or modify
-;;; it under the terms of the GNU General Public License as published by
-;;; the Free Software Foundation; either version 3, or (at your option)
-;;; any later version.
-;;;
-;;; GNU Radio is distributed in the hope that it will be useful,
-;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;;; GNU General Public License for more details.
-;;;
-;;; You should have received a copy of the GNU General Public License
-;;; along with this program. If not, see <http://www.gnu.org/licenses/>.
-;;;
-
-;;; This module implements a macro, export-safely, that avoids
-;;; exporting symbols that are actually generic-functions imported
-;;; (explicity or implicitly) from elsewhere.
-;;;
-;;; This hackery is required so that the swig generated goops wrappers
-;;; don't stomp on each other. For background on what this is about
-;;; see this thread:
-;;;
-;;; http://lists.gnu.org/archive/html/guile-user/2006-05/msg00007.html
-;;;
-;;; Don't expect to understand what's going on here without looking at
-;;; the guts of the module system (implemented in ice-9/boot-9.scm) and
-;;; having a pretty good understanding of goops and generic-functions.
-
-
-(define-module (gnuradio export-safely)
- #:use-module (oop goops)
- #:use-module (srfi srfi-1)
- #:export-syntax (export-safely))
-
-(define-public (generics-in-module module)
- (let ((lst '()))
- (module-for-each (lambda (sym var)
- (if (variable-bound? var)
- (let ((v (variable-ref var)))
- (cond ((is-a? v <generic>)
- (set! lst (cons v lst)))))))
- module)
- lst))
-
-(define-public (generic-function-names-in-module module)
- (map generic-function-name (generics-in-module module)))
-
-(define-public (generic-function-names-in-imported-modules module)
- (concatenate (map generic-function-names-in-module (module-uses module))))
-
-(define-public (export-syms-if-not-imported-gf list-of-syms)
- (let ((gf-names (generic-function-names-in-imported-modules (current-module))))
- (let ((to-export (filter (lambda (sym)
- (not (memq sym gf-names)))
- (delete-duplicates list-of-syms))))
- (module-export! (current-module) to-export))))
-
-(defmacro export-safely names
- `(export-syms-if-not-imported-gf ',names))
-
-
-(define-public (names-in-module module)
- (let ((lst '()))
- (module-for-each (lambda (sym var)
- (if (variable-bound? var)
- (set! lst (cons sym lst))))
- module)
- lst))
-
-(define-public (names-in-imported-modules module)
- (delete-duplicates (concatenate (map names-in-module (module-uses module)))))
-
-(define-public (re-export-all src-module-name)
- (let ((current (current-module))
- (src-module (resolve-interface src-module-name)))
-
- (define (ok-to-re-export? name)
- (let ((var (module-variable current name)))
- (cond ((not var) #f) ; Undefined var
- ((eq? var (module-local-variable current name)) #f) ; local var
- (else #t)))) ; OK
-
- (module-re-export! current
- (filter ok-to-re-export?
- (names-in-module src-module)))))
diff --git a/gnuradio-core/src/lib/swig/gnuradio/runtime-shim.scm b/gnuradio-core/src/lib/swig/gnuradio/runtime-shim.scm
deleted file mode 100644
index c08d3947c..000000000
--- a/gnuradio-core/src/lib/swig/gnuradio/runtime-shim.scm
+++ /dev/null
@@ -1,89 +0,0 @@
-;;;
-;;; Copyright 2010 Free Software Foundation, Inc.
-;;;
-;;; This file is part of GNU Radio
-;;;
-;;; GNU Radio is free software; you can redistribute it and/or modify
-;;; it under the terms of the GNU General Public License as published by
-;;; the Free Software Foundation; either version 3, or (at your option)
-;;; any later version.
-;;;
-;;; GNU Radio is distributed in the hope that it will be useful,
-;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;;; GNU General Public License for more details.
-;;;
-;;; You should have received a copy of the GNU General Public License
-;;; along with this program. If not, see <http://www.gnu.org/licenses/>.
-;;;
-
-(define-module (gnuradio runtime-shim)
- #:use-module (oop goops)
- #:use-module (gnuradio gnuradio_core_runtime)
- #:duplicates (merge-generics replace check))
-
-(define-class <gr-endpoint> (<object>)
- (block #:accessor block #:init-keyword #:block)
- (port #:init-value 0 #:accessor port #:init-keyword #:port))
-
-(define (gr:ep block port)
- (make <gr-endpoint>
- #:block (coerce-to-basic-block block) #:port port))
-
-(define (coerce-to-endpoint ep)
- (cond ((is-a? ep <gr-endpoint>) ep)
- ((false-if-exception (gr:to-basic-block ep))
- => (lambda (x) (gr:ep x 0)))
- ((and (pair? ep) (= 2 (length ep))
- (false-if-exception (gr:to-basic-block (car ep))))
- => (lambda (x) (gr:ep x (cadr ep))))
- (else (error "Cannot coerce to an endpoint: " ep))))
-
-(define (coerce-to-basic-block block)
- (cond ((is-a? block <gr-basic-block-sptr>) block)
- ((false-if-exception (gr:to-basic-block block)) => (lambda (x) x))
- (else (error "Cannot coerce to a gr_basic_block: " block))))
-
-(define (coerce-to-top-block block)
- (cond ((is-a? block <gr-top-block-sptr>) block)
- ((false-if-exception (gr:to-top-block block)) => (lambda (x) x))
- (else (error "Cannot coerce to a gr_top_block: " block))))
-
-(define (coerce-to-hier-block2 block)
- (cond ((is-a? block <gr-hier-block2-sptr>) block)
- ((false-if-exception (gr:to-hier-block2 block)) => (lambda (x) x))
- (else (error "Cannot coerce to a gr_hier_block2: " block))))
-
-
-;;; Connect one or more block endpoints. An endpoint is either a <gr-endpoint>,
-;;; a 2-list (block port), or a block instance. In the latter case, the port number
-;;; is assumed to be zero.
-;;;
-;;; If multiple arguments are provided, connect will attempt to wire them in series,
-;;; interpreting the endpoints as inputs or outputs as appropriate.
-(define-method (gr:connect hb . points)
- (dis/connect "connect" gr:primitive-connect hb points))
-
-;;; Disconnect one or more block endpoints...
-(define-method (gr:disconnect hb . points)
- (dis/connect "disconnect" gr:primitive-disconnect hb points))
-
-(define (dis/connect name gf hb points)
- (let ((hb (coerce-to-hier-block2 hb))
- (points (list->vector (map coerce-to-endpoint points))))
-
- (define (op2 p0 p1)
- (gf hb (block p0) (port p0) (block p1) (port p1)))
-
- (let ((len (vector-length points)))
- (case len
- ((0) (error (string-append name " requires at least 1 endpoint; None provided.")))
- ((1) (gf hb (vector-ref points 0)))
- (else
- (let loop ((n 1))
- (cond ((< n len)
- (op2 (vector-ref points (1- n)) (vector-ref points n))
- (loop (1+ n))))))))))
-
-
-(export-safely <gr-endpoint> gr:ep gr:connect gr:disconnect)