moab
|
Many of the functions in iMesh involve passing a string and also the length of that string. How is the null character is handled? For users of the iMesh interface calling iMesh functions, it is optional as to whether or not to include the null character in computing the length of the string. So, for example, calling iMesh from a C program, users could pass strlen(my_string) or strlen(my_string)+1 as the length of the string.
Note to implementors: However, it should be noted that the situation is different for implementers of the iMesh interface. In implementing an iMesh interface function, there can be no assumption that the string is indeed null terminated. The length argument the caller passes in may or may NOT include the null character and implementations must be coded to accommodate this. This requirement is primarily due to differences in how Fortran and C/C++ handle passing of strings as function arguments. Furthermore, because of the way Fortran clients pass strings (Fortran always passes the length of the string as declared in the source code), there may be trailing spaces in the string that need to be truncated.