tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: fun (not so much) with funopen



> [...], recently we changed the API/ABI of funopen(3) from:

>       FILE    *funopen(const void *cookie,
>           int (*readf)(void *cookie, char *buf, int len),   
>           int (*writef)(void *cookie, const char *buf, int len),
>           fpos_t (*seekf)(void *cookie, fpos_t offs, int whence),

> to:

>       FILE    *funopen(const void *cookie,
>           int (*readf)(void *cookie, char *buf, int len),   
>           int (*writef)(void *cookie, const char *buf, int len),
>           off_t (*seekf)(void *cookie, off_t offs, int whence),
>           int (*closef)(void *cookie));
>           int (*closef)(void *cookie));

Did you perhaps get the last line of the "from" signature moved to
after the "to" signature?  I'll assume so.

This has long annoyed me, even though I rarely use a non-nil seekf
pointer.  I'm glad someone's finally fixing it.

> Since this change is still fresh, I suggest that we go one step
> further and change the signature to be more in accordance with the
> standard read(2) and write(2) system calls:

>           ssize_t (*readf)(void *cookie, void *buf, size_t len),   
>           ssize_t (*writef)(void *cookie, const void *buf, size_t len),

Agreed.  To me this is a more minor annoyance, but still an annoyance.
I'll even put up with the annoyance of having to fix all my own funopen
code to adopt this change.  (A few more tweaks to my private source
trees is no big deal.)

> What do you think?

I think these are good changes that have needed making for a long time.

/~\ The ASCII                             Mouse
\ / Ribbon Campaign
 X  Against HTML                mouse%rodents-montreal.org@localhost
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index