[Pyrex] Best/easiest way to access C's stderr?

Norman Shelley Norman.Shelley at motorola.com
Wed Jun 25 18:00:24 CEST 2003


Greg Ewing wrote:

> Norman Shelley <Norman.Shelley at motorola.com>:
>
> > I want to be able to do an fprintf to stderr say like this example.
> > But how does one define stderr?
>
>   cdef extern from "stdio.h":
>     ctypedef struct FILE
>     int fprintf(FILE *, char *, ...)
>
> That should be close enough, even if FILE isn't really
> defined as a struct in stdio.h.

That is what I use.  But I am  wondering how to best (easiest method to)
declare/define the symbol "stderr" in the pyx  file so that I can have a cdef
that has an fprintf that uses the symbol "symbol", e.g.,

cdef test():
    ...
    fprintf(stderr, "some message\n")
    ....



>
>
> Greg Ewing, Computer Science Dept, +--------------------------------------+
> University of Canterbury,          | A citizen of NewZealandCorp, a       |
> Christchurch, New Zealand          | wholly-owned subsidiary of USA Inc.  |
> greg at cosc.canterbury.ac.nz         +--------------------------------------+
>
> _______________________________________________
> Pyrex mailing list
> Pyrex at lists.copyleft.no
> http://lists.copyleft.no/mailman/listinfo/pyrex





More information about the Pyrex mailing list