proposed minor change to iBase

Tim Tautges tautges at mcs.anl.gov
Wed Nov 4 08:52:38 CST 2009



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".
> 
> 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
> 

I've always assumed that getDescription gave context-sensitive help after a non-success return code.  I think #1 above 
doesn't do us much good, and an implementation without the ability to do #2 is far less useful.

The fixed-size string is actually for fortran; from fortran, strings are always fixed-size (i.e. the length at the end 
of the arg list is always passed by value).

- tim
-- 
================================================================
"You will keep in perfect peace him whose mind is
   steadfast, because he trusts in you."               Isaiah 26:3

              Tim Tautges            Argonne National Laboratory
          (tautges at mcs.anl.gov)      (telecommuting from UW-Madison)
          phone: (608) 263-8485      1500 Engineering Dr.
            fax: (608) 263-4499      Madison, WI 53706



More information about the tstt-interface mailing list