Ruby/DL struct! method prototypes
I am trying to use the Ruby/DL library to pass a C event buffer back
and forth. When using the struct! method not all of the method
prototypes are available from all I can tell.
Here's my code:
# some stuff here
@eventBuf.struct!('LHHLLSI', :hndlPtr, :evtClsPtr, :evtTypPtr, /
:invIdPtr, :callIdPtr, :devIdPtr, :devIdTypPtr)
# other stuff here too
This @eventBuf is an event buffer structure that should be comprised of
the following data types:
hndlPtr = long unsigned
evtClsPtr = short unsigned
evtTypPtr = short unsigned
invIdPtr = long unsigned
callIdPtr = long unsigned
devIdPtr = char
devIdType = int
When I try to access the contents of the structure I get results with
everything but the :devIdPtr item. This comes up blank. I see the data
type should be char and not const char, but I cannot use 's' (lower
case) prototype in the struct! method. I get an error and have to use
the 'S' (upper case) prototype instead.
Any ideas? Any lower case prototypes used in the struct! method cause
the method to fail...
Re: Ruby/DL struct! method prototypes
> Any ideas? Any lower case prototypes used in the struct! method cause
> the method to fail...
As a follow up I checked this thread
and tried replacing the files. Still no luck. I am using Ruby 1.8.2 for
|All times are GMT. The time now is 05:42 PM.|
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.