I am bound to the api, at least for calling into the application.  I don't 
know how to do either of the things you recommend.  Could you point me to 
an example?

On Wednesday, March 9, 2016 at 12:58:20 PM UTC-5, Yichao Yu wrote:
>
>
> On Mar 9, 2016 12:38 PM, "Jeffrey Sarnoff" <[email protected] 
> <javascript:>> wrote:
> >
> > I am trying to wrap this so it will (a) print to STDOUT (b) (if 
> possible) print to a string:
> > void arf_fprint(FILE * file, const arf_t x)ΒΆ
> >
> > Prints x as an integer mantissa and exponent to the stream file.
> >
> >
> > arf_t is made with  arf(x), that works.
> >
> >
> > this:
> >
> > function arf_fprint(x::arb)
> >
> >            a = arf(x); s=STDOUT
> >
> >            ccall((:arf_fprint, :libarb), Void, (Ptr{s}, 
> Ptr{arf_struct},), &s, &a)
>
> Julia does not use c FILE*, if you are bound to this api, you should 
> probably fetch the c stream with cglobal or construct a string stream with 
> platform dependent api.
>
> >
> >        end
> >
> > does this:
> > ERROR: TypeError: Ptr: in parameter, expected Type{T}, got Base.TTY
> >  in arf_fprint at none:3
> >
>

Reply via email to