iRel.h interface update [was iRel proposal: removing non-one-to-one relation functions]

Jason Kraftcheck kraftche at cae.wisc.edu
Thu Oct 28 15:09:34 CDT 2010


On 10/28/2010 02:59 PM, James Porter wrote:
> On Thu, 2010-10-28 at 03:12 -0400, seol at scorec.rpi.edu wrote:

> 
>> I checked iMesh and iRel. Most of iMesh/iRel functions do have "int *err" at the end of arg list, but some (not
>> many) don't. Do we have any conventions for the order of args?
> 
> If you're talking about what I think you're talking about, this is due
> to the calling conventions of Fortran functions, where string length for
> an arg is appended to the end of the function parameter list. (I think.)
> If you want this to change, you'll have to convince everyone that
> wrappers are the way to go for Fortran support (you won't find any
> arguments from me).
> 
>> 3. We defined the enumeration type "RelationType". To represent "relation type", we use "integer" type instead of
>> "RelationType". Here I see two options:
>>
>>    #1. change "int ent_or_set" to "RelationType type"
>>    #2. remove the enumeration type "RelationType" since it's no use
> 
> The ITAPS interfaces use ints instead of enums to maintain ABI
> compatibility since the size of an enum is not defined by the standard*.
> Whether this is important or not is a different question, though. (I for
> one doubt the necessity of this.)
> 
> * Ok, technically the size of an int isn't defined either beyond minimum
> ranges, but at least ints are generally guaranteed to be the same size
> on a given platform.
> 

Both of these are for Fortran compatibility.  The size of an enum (and an
int) is typically well defined for a given architecture so there's no issue
there.  The problem is that Fortran doesn't have enums, and even if it did
there'd be no guarantee that the size of the underlying type would be the
same as the C ABI for the platform.

Anyway both of these issues (and the decision to do things this way rather
than use a Fortran wrapper) are prevalent in all the ITAPS APIs.  If either
of you is advocating changing this (which is probably unlikely to happen),
the discussion needs to happen at a higher level than a thread about the
iRel interface.

- jason



More information about the tstt-interface mailing list