
On Fri, Aug 24, 2007 at 10:42:34AM +0200, Torsten Klie wrote:
Hi Luis!
Luis EG Ontanon wrote:
I haven't been able to figure out how to obtain the fixed length of a non-implied object string index element given:
elNode = smiGetElementNode(smiElementPtr) && elType = smiGetNodeType(elNode) && elType->basetype == SMI_BASETYPE_OCTETSTRING
Length restrictions for strings are stored in smiRanges. Use smiGetFirstRange( smiTypePtr ) / smiGetNextRange( smiRangePtr ) to retrieve this information. In case of a fixed-length string there should be only one smiRange, and within this smiRange struct, minvalue and maxvalue should be equal. When dealing with non-implied types, also have a look at the ranges of the parent type (smiGetParentType( smiTypePtr )).
A slightly simpler check is possible using the utility functions smiGetMinSize() and smiGetMaxSize() since they automatically do the recursion:
isFixedLength = (smiGetMinSize(elType) == smiGetMaxSize(elType))
/js