Re: A GnomeVFS API for accessing standard streams



On 27 Nov 2002, Giovanni Corriga wrote:

> Hi.
> 
> As you may recall, a couple of weeks ago I proposed to the GnomeVFS
> hackers a console: method for accessing standard streams. There has been
> some discussion, from which it has emerged that a specialized API would
> be better than a method, given the fact that the console: method would
> be used just by the developers, and not by the users. I tend to agree
> with this. I originally went for the method route because I felt a new
> module would have been less invasive than an API change. But now I think
> that an API, and not a method, is the best way for handling the standard
> streams.
> 
> What I am now proposing is to drop the console: method, and add these
> three new functions to libgnomevfs:
> 
> GnomeVFSHandle* gnome_vfs_console_get_input();
> GnomeVFSHandle* gnome_vfs_console_get_output();
> GnomeVFSHandle* gnome_vfs_console_get_error();
> 
> These functions would return a GnomeVFSHandle to be used with the
> standard API (gnome_vfs_read() etc). Implementing them would mean adding
> just a new .c file to libgnomevfs.
> 
> If you feel it is OK, I can implement these functions in a day or two.
> 
> Regarding the API freeze issue, I didn't find any explicit notice on
> desktop-devel-list, so I don't now if it has been announced or not. I
> think that, if these API can't be added because the freeze, we should
> drop the console: method and add the API in the next (Gnome 2.4)
> release.
> 
> What do you think?


I'm not the maintainer, but that API is not very good. It exports three 
functions that all do the same thing, in differently limited ways.

What you really want is:
GnomeVFSHandle* gnome_vfs_fdopen (int fd);

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a sword-wielding soccer-playing vagrant searching for his wife's true 
killer. She's a provocative green-skinned soap star fleeing from a Satanic 
cult. They fight crime! 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]