I went a little further with my almost blind attempts...

On 25 Oct 2006, at 14:43, Franco Vaccari wrote:

In the end I've got the plugin working. But a couple of improvements are needed, and I'm here for some help...

a) the text file is created in / while typically it has to appear in a user-specified path. In a previously tried strategy I simply compiled the fortran code with g77/g95, put the executable in the app/Contents/MacOS folder and call it from RB using the shell class. In such a way the output file was created in the folder currently used by the user, but if I moved my app to another machine I had to recompile the fortran code there (probably because of different configuration), while I'd like to have my app running on whatever Mac, possibly without the developer tools installed there, and I thought that maybe a plugin would be the best way to go...

I can easily change to the fortran part from

        subroutine hello()

to

        subroutine hello(path,lenPath)
        character*512 path
        integer lenPath

and use the path wherever needed for I/O operations in other program units by passing path and lenPath in a common. The f2c translated method definition changes from

        static int hello()

to

        static int hello(char *path, integer *lenpath, ftnlen path_len)

where ftnlen is either a short or a long integer defined in the f2c.h header. How to modify the original

        { (REALproc) hello, REALnoImplementation, "hello() as Integer" },

to handle the new definition and how to call from RB? I tried

{ (REALproc) hello, REALnoImplementation, "hello(path as string, lenpath as integer, path_len as integer) as Integer" },

and in RB

        result=hello("~/",512,2")

The plugin compiled, but upon run the app went mad upon the method call... If I could pass this step I could probably stop disturbing for a while (hope so at least...:-)


b) I have f2c installed by fink, and it is not UB. Can I create the PPC plugin on a PPC Mac, the Intel plugin on an Intel Mac, and somehow put the two outcomes together before running RB Plugin Converter on any of the two platforms) to obtain a UB plugin?

It looks like the RB Plugin Converter can do this easily, will try later at home, point b) probably solved

c) how to add win32 compatibility to the plugin?

Again, putting the pieces together with RB Plugin Converter will do it. So the true question is: how to prepare the dylib under Windows?

Thanks again

Franco

--------------------
Franco Vaccari
Trieste - Italy
--------------------

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to