On Mar 9, 2016 12:38 PM, "Jeffrey Sarnoff" <[email protected]>
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