I think you should be using specialized arrays for your float array:
http://docs.factorcode.org/content/article-specialized-arrays.html

Passing a byte-array for err-msg is, as far as i know, ok.
Jon

On Tue, Aug 16, 2011 at 3:39 PM, Larry Coleman
<all.are.wond...@gmail.com> wrote:
> Sorry for the possible duplicate, but the first time I sent this I
> wasn't a member of the list, so the post was flagged for moderation.
>
> On Fri, Aug 12, 2011 at 3:03 PM, Larry Coleman
> <all.are.wond...@gmail.com> wrote:
>> I have a C function that I'm trying to call from Factor, which expects
>> 2 pre-allocated arrays as parameters.
>>
>> FUNCTION: int swe_calc_ut ( double tjd_ut, int ipl, int iflag,
>>                            double* xx, char* serr ) ;
>>
>> xx is supposed to be an array of 6 elements, and serr is supposed to
>> be a 256-character string. Both will be filled in by the C function.
>>
>> This is my latest attempt at using the function:
>>
>> :: calc-item ( julday itm -- errcode stats err-msg )
>>    julday itm seflg_speed
>>    6 0.0 <array> :> stats
>>    256 <byte-array> :> err-msg
>>    stats >c-ptr err-msg
>>    swe_calc_ut stats err-msg ;
>>
>> It gives me this error message:
>>
>> Generic word underlying>> does not define a method for the array class.
>> Dispatching on object: { 0.0 0.0 0.0 0.0 0.0 0.0 }
>>
>> Any ideas as to how I can properly write the FFI definition and call?
>>
>> Thanks,
>>
>> Larry Coleman
>>
>
> ------------------------------------------------------------------------------
> uberSVN's rich system and user administration capabilities and model
> configuration take the hassle out of deploying and managing Subversion and
> the tools developers use with it. Learn more about uberSVN and get a free
> download at:  http://p.sf.net/sfu/wandisco-dev2dev
> _______________________________________________
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to