proposed minor change to iBase

Mark Miller miller86 at llnl.gov
Wed Nov 4 08:56:45 CST 2009


On Tue, 2009-11-03 at 23:47, Carl Ollivier-Gooch wrote:

> 
> Also, it got me thinking about iMesh_getDescription, which I looked up.
> 
> There are two possible interpretations here:
> 
> 1.  An app hits an error code and asks for a description of it; the 
> implementation has a string for each error code.  This would presumably 
> take a "/*in*/ int err".

I believe this is what I have understood this function to do. Was I
interpreting it wrong?

Also, I thought I recall hitting a case where 'getDescription()' itself
encountered error and, returned a different error code than what was
passed in. Maybe it detected the 'string not long enough for return
value' case? I don't know. But, that is yet another behavior to clarify.

> 
> 2.  An app asks what just happened; the app has the error code and a 
> (possibly context-specific) error description stored somewhere, and 
> returns those.  This requires a "/*inout*/ int *err", which is what we have.
> 
> The former is what I'd assumed this function does, but the signature 
> suggests the latter.  So which do we mean?  And if the latter, why 
> bother returning the error code, which the app already has as a side 
> effect of the function call, and has to check to know whether to request 
> a description anyway?
> 
> And in any even, the function signature suggests that the app is going 
> to pass in a pre-allocated char array of size descr_len, or at least, 
> that's the obvious interpretation of the C.  But a Fortran 
> implementation presumablywon't like that much.
> 
> Carl
-- 
Mark C. Miller, Lawrence Livermore National Laboratory
email: mailto:miller86 at llnl.gov
(M/T/W) (925)-423-5901 (!!LLNL BUSINESS ONLY!!)
(Th/F)  (530)-753-8511 (!!LLNL BUSINESS ONLY!!)



More information about the tstt-interface mailing list