rubydl

I am familiar with Ruby /DL but not sure how to use the C function calls that have pointers for return parameters

半腔热情 提交于 2019-12-10 07:53:05
问题 I have this function in this Module require 'dl' require 'dl/import' module LibCalendars extend DL::Importer dlload './cal2jd.o' extern 'int iauCal2jd(int, int, int, double *, double *)' end How do I set this up in a Module to get access to the pointers? Is what I need partly in there? I'm just not sure. How is this done correctly? The exact code is at http://www.iausofa.org/2013_1202_C/sofa/cal2jd.c I need to know how to access those address pointers. The validation tests are here http://www

How do you use Ruby/DL? Is this right?

非 Y 不嫁゛ 提交于 2019-12-07 15:03:51
问题 I am trying to write an interface between RSPEC (ruby flavoured BDD) and a Windows application. The application itself is written in an obscure language, but it has a C API to provide access. I've gone with Ruby/DL but am having difficulties getting even the most basic call to a DLL method to work. Here is what I have so far, in a file called gt4r.rb: require 'dl/import' module Gt4r extend DL::Importable dlload 'c:\\gtdev\\r321\\bin\\gtvapi' # GTD initialization/termination functions extern

How do you use Ruby/DL? Is this right?

狂风中的少年 提交于 2019-12-06 03:50:34
I am trying to write an interface between RSPEC (ruby flavoured BDD) and a Windows application. The application itself is written in an obscure language, but it has a C API to provide access. I've gone with Ruby/DL but am having difficulties getting even the most basic call to a DLL method to work. Here is what I have so far, in a file called gt4r.rb: require 'dl/import' module Gt4r extend DL::Importable dlload 'c:\\gtdev\\r321\\bin\\gtvapi' # GTD initialization/termination functions extern 'int GTD_init(char *[], char *, char *)' extern 'int GTD_initialize(char *, char *, char *)' extern 'int

How can I write a generic C function for calling a Win32 function?

旧时模样 提交于 2019-12-06 00:52:49
问题 To allow access to the Win32 API from a scripting language (written in C), I would like to write a function such as the following: void Call(LPCSTR DllName, LPCSTR FunctionName, LPSTR ReturnValue, USHORT ArgumentCount, LPSTR Arguments[]) which will call, generically, any Win32 API function. (the LPSTR parameters are essentially being used as byte arrays - assume that they have been correctly sized to take the correct data type external to the function. Also I believe that some additional

How can I write a generic C function for calling a Win32 function?

那年仲夏 提交于 2019-12-04 06:26:16
To allow access to the Win32 API from a scripting language (written in C), I would like to write a function such as the following: void Call(LPCSTR DllName, LPCSTR FunctionName, LPSTR ReturnValue, USHORT ArgumentCount, LPSTR Arguments[]) which will call, generically, any Win32 API function. (the LPSTR parameters are essentially being used as byte arrays - assume that they have been correctly sized to take the correct data type external to the function. Also I believe that some additional complexity is required to distinguish between pointer and non-pointer arguments but I'm ignoring that for