Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!spool.mu.edu!sdd.hp.com!wuarchive!mit-eddie!bloom-beacon!dont-send-mail-to-path-lines From: pete@iris49.UUCP (Pete Ware) Newsgroups: comp.windows.x Subject: Re: XtAddInput returns; error checking in general Message-ID: <9102181822.AA09294@iris49.biosym.com> Date: 18 Feb 91 18:22:15 GMT References: <65118@brunix.UUCP> Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 27 Reading the documentation, it looks like there is no way to check for an error return value from XtAddInput(). Seeing that XtInputId is: typedef unsigned long XtInputId; means zero is the most likely thing that could be an error return value but no indication that it is an error. As far as general principles, if a function does not have an error return value, it _probably_ means the author didn't think there were any significant errors to return. It could also mean the documentation isn't upto date w.r.t. to the source. A large percentage of the intrinsics are void functions so most do not need any checking. The remaining ones usually return useful information such as Boolean values, the previous error handler, etc, that you are probably going to use right away and may not have an error condition (i.e functions returning a Boolean value or function pointers). The only exception to this are ones that return Widgets. I think the toolkit was defined to make it easy to program and not have to be constantly checking for errors. Most errors are treated either as fatal (out of memory) or reported and recovered from internally. --pete Pete Ware / Biosym / San Diego CA / (619) 546-5532 uucp: scripps.edu!bioc1!pete Internet: bioc1!pete@scripps.edu