String lengths

12 views
Skip to first unread message

Vladimír Šeděnka

unread,
Apr 6, 2011, 2:45:02 PM4/6/11
to Amelet-HDF
Hello,
I would like to open a discussion about constants
ABSOLUTE_PATH_NAME_LENGTH and ELEMENT_NAME_LENGTH in the Amelet-HDF
library (they set maximal allowed lengths of strings). In r271, Didier
changed ELEMENT_NAME_LENGTH to 51, but ABSOLUTE_PATH_NAME_LENGTH
remained at 101. That means max. 50 characters per item and max. 100
characters per each path in Amelet. In this case you have to check
both the limits.

As I told Cyril before, in order to make input checks easier, it would
be better to set ELEMENT_NAME_LENGTH and derive
ABSOLUTE_PATH_NAME_LENGTH from it as the worst case scenario. Then you
should care only about the first one. Here is the worst scenario I
found:
/mesh/<mesh_group_name>/<mesh_name>/selectorOnMesh/<SOM_name>

where the names enclosed in brackets are user-defined ...so the C
constants would be in this case (number 1 means space for the null
terminator):
ELEMENT_NAME_LENGTH = max_item_length + 1
ABSOLUTE_PATH_NAME_LENGTH = 3*max_item_length + 23 + 1

I think that the maximum length of a string attribute should be also
specified.

Any suggestions?

Regards,
Vladimir
Reply all
Reply to author
Forward
0 new messages