Re: What to return in async transfer callbacks?



On Mon, 2005-09-26 at 21:01 +0200, Matthias Kaeppler wrote:
> Christian Neumair wrote:
> > You can't simply return one "by default". You'll have to handle all
> > members of GnomeVFSXferProgressStatus. For
> > GNOME_VFS_XFER_PROGRESS_STATUS_OK, you can return TRUE. It's just
> > important to not return FALSE (which is 0, i.e. the value of
> > GNOME_VFS_OK, and the reason why that failed), because FALSE always
> > means "abort now!".
> Oha, that explains a lot indeed! I didn't expect GNOME_VFS_OK to equal 
> 0, maybe because I was too much into the C/C++ thinking of 0==false and 
> !0==true. But on a second thought, since a return value of 0 usually 
> indicates success for programs on posix systems (if I remember correctly 
> here), it actually does make sense.
> Anyway, thanks!

Its not so much about posix. GNOME_VFS_OK is the "no error" value of a
type that specified what error happened. Having 0 mean "no error" isn't
so strange. Its also similar to e.g. NSResult in XPCom or whatever MS
uses in COM.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's an oversexed vegetarian cowboy on a mission from God. She's a brilliant 
wisecracking detective from a different time and place. They fight crime! 




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