summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Savoye <rob@welcomehome.org>2010-11-29 10:02:58 -0700
committerRob Savoye <rob@welcomehome.org>2010-11-29 10:02:58 -0700
commit75c52385ecc1ca66caa2986cffe9105f9532895f (patch)
tree7179053a633bfeb7586edccda4e7d565be311521
parent8b8159e2160751ca0458ae3fc21143d54da0acf4 (diff)
drop the rest of the crufty old ports code, string ports are great!
-rw-r--r--gr-run-waveform/xyzzy-load.c2
-rw-r--r--gr-run-waveform/xyzzy.cc21
-rw-r--r--gr-run-waveform/xyzzy.h12
3 files changed, 1 insertions, 34 deletions
diff --git a/gr-run-waveform/xyzzy-load.c b/gr-run-waveform/xyzzy-load.c
index cf3a240a59..a8ce2812c1 100644
--- a/gr-run-waveform/xyzzy-load.c
+++ b/gr-run-waveform/xyzzy-load.c
@@ -297,6 +297,4 @@ scm_xyzzy_init (void)
{
scm_c_define_gsubr ("xyzzy-search-path", 2, 1, 0, (SCM (*)()) scm_xyzzy_search_path);
scm_c_define_gsubr ("make-gnuradio-port", 1, 0, 0, (SCM (*)()) scm_make_gnuradio);
-
- xyzzy_make_read_only_port("ice-9/boot-9.scm");
}
diff --git a/gr-run-waveform/xyzzy.cc b/gr-run-waveform/xyzzy.cc
index 890696ed70..903f7563c7 100644
--- a/gr-run-waveform/xyzzy.cc
+++ b/gr-run-waveform/xyzzy.cc
@@ -40,7 +40,6 @@ using namespace std;
typedef void* handle_t;
XYZZY::XYZZY()
- : _portbits(0)
{
// nothing to initialize
}
@@ -127,17 +126,6 @@ XYZZY::file_exists(const std::string &filespec)
return false;
}
-// Return a C port that will read the file contents
-SCM
-XYZZY::make_read_only_port(const std::string &filespec)
-{
- fprintf(stderr, "TRACE %s: %d\n", __FUNCTION__, __LINE__);
- // _portbits = scm_make_port_type(const_cast<char *>(filespec.c_str()),
- // xyzzy_fill_input, xyzzy_write);
- // scm_set_port_flush (_portbits, xyzzy_flush);
- // scm_set_port_close (_portbits, xyzzy_close);
-}
-
string
XYZZY::read_string(boost::uint8_t *entry, size_t length)
{
@@ -211,7 +199,7 @@ static XYZZY datafile;
SCM
make_xyzzy (SCM binary_port)
{
- fprintf(stderr, "TRACE %s: %d, %s\n", __FUNCTION__, __LINE__, scm_to_locale_string(binary_port));
+ // fprintf(stderr, "TRACE %s: %d, %s\n", __FUNCTION__, __LINE__, scm_to_locale_string(binary_port));
std::string &contents = datafile.get_contents(scm_to_locale_string(binary_port));
SCM port = scm_open_input_string (scm_from_locale_string (contents.c_str()));
@@ -232,12 +220,5 @@ xyzzy_file_exists(char *filespec)
{
return datafile.file_exists(filespec);
}
-
-// Return a C port that will read the file contents
-SCM
-xyzzy_make_read_only_port(char *filespec)
-{
- return datafile.make_read_only_port(filespec);
-}
} // end of extern C
diff --git a/gr-run-waveform/xyzzy.h b/gr-run-waveform/xyzzy.h
index 5d9b861b7d..e01a9f513d 100644
--- a/gr-run-waveform/xyzzy.h
+++ b/gr-run-waveform/xyzzy.h
@@ -89,9 +89,6 @@ public:
// Does a file with name 'filename' exist in magic filesystem?
bool file_exists(const std::string &filespec);
- // Return a C port that will read the file contents
- SCM make_read_only_port(const std::string &filespec);
-
/// Parse a string data structure
static std::string read_string(boost::uint8_t *entry, size_t length);
static std::string read_string(struct string_entry &entry);
@@ -103,25 +100,16 @@ public:
boost::shared_ptr<struct directory_entry> read_dir_entry(boost::uint8_t *header);
std::string &get_contents(const std::string &filespec) { return _contents[filespec]; };
-
- scm_t_bits getPortBits() { return _portbits; };
private:
std::string _filespec;
std::map<std::string, std::string> _contents;
- scm_t_bits _portbits;
};
// C linkage bindings for Guile
extern "C" {
#endif
-// These are the callbacks for thw guile ports
-int xyzzy_fill_input (SCM port);
-void xyzzy_write (SCM port, const void *data, size_t size);
-void xyzzy_flush (SCM port);
-int xyzzy_close (SCM port);
-
void scm_xyzzy_init (void);
// Initialize with the data file produced by gen-xyzzy.