Added comedi_get_buffer_read_offset(), comedi_get_buffer_write_offset(),
comedi_get_buffer_read_count(), and comedi_get_buffer_write_count().
comedi_get_buffer_read_offset() is the same as
comedi_get_buffer_offset(), which has now been documented as deprecated,
but is currently still declared in "comedilib.h" by default. It gets
the read position within the buffer as an offset from the start of the
buffer (modulo the buffer size).
comedi_get_buffer_write_offset() gets the write position within the
buffer as an offset from the start of the buffer (modulo the buffer
size).
comedi_get_buffer_read_count() gets the number of bytes read from the
buffer, modulo UINT_MAX+1.
comedi_get_buffer_write_count() gets the number of bytes written to the
buffer, modulo UINT_MAX+1.
Add methods for several Comedilib functions that are currently absent
from the Ruby bindings.
Rename the comedi_to_physical, comedi_from_physical, and
cleanup_calibration_file methods to to_physical, from_physical, and
cleanup_calibration, either for consistency (comedi_to_physical and
comedi_from_physical) or because they are wrong
(cleanup_cleanup_calibration_file).
TODO: Add a binding for comedi_get_clock_source() as well, but I'm not
sure how to handle multiple output parameters.
The SWIG interface file (swig/comedi.i) is out of date with respect to comedi.h
and comedilib.h. I've attempted to make it current by applying most of the
changes since 1.22 (both headers).
My ability to test is limited. The swig/ruby/demo/cmd application runs
successfully using the comedi_test device. The python extension library
compiles, but that's as far as I've taken it.
'setup.rb config' calls 'extconf.rb' in the ext directory to build the extension
Makefile. 'extconf.rb' looks for C source files in the directory when it runs,
so SWIG needs to run before 'setup.rb config'. The attached patch makes the
output of SWIG a prerequisite for ext/Makefile.
If configure attempts to build the Ruby extension on a system without a previous
installation of comedilib, compilation fails because gcc can't find comedilib.h.
The attached patch adds the distribution include directory to the gcc search
path when compiling the extension.
The attached patch updates files in comedilib/swig/ruby. lib/comedi.rb is
updated to raise Ruby exceptions as indicated by the comedilib API
documentation. README and demo/cmd are updated accordingly.