diff options
author | Anders Broman <anders.broman@ericsson.com> | 2010-05-23 10:00:50 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2010-05-23 10:00:50 +0000 |
commit | be717625ff45e08918952ac092c0a0a34ae05a8a (patch) | |
tree | d754d77e04e8ab41eb8e92eca42638c5ed0111e4 /doc | |
parent | 2e191a7a6b14fa32105dff97664573597456f5d8 (diff) |
Describe values_string_ext.
svn path=/trunk/; revision=32916
Diffstat (limited to 'doc')
-rw-r--r-- | doc/README.developer | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/doc/README.developer b/doc/README.developer index 570818b51e..eabdb53f47 100644 --- a/doc/README.developer +++ b/doc/README.developer @@ -1803,6 +1803,23 @@ indicate the end of the array). The 'strings' field would be set to If the field has a numeric rather than an enumerated type, the 'strings' field would be set to NULL. +You can also use an extended version of the value_string for faster lookups. +It requires a value_string as input. +It will use the value as a pointer to the string if all values from 0 to max +are present in the array, otherwise a binary search will be used this requires +that the values are in assending order. The init macro will performe a check on the value string +the first time it is used to determine which search algorithm fits an fall back to a linear search +if the value_string does not meet the criteria above. + +Use this macro to initialise the extended value_string: + +static value_string_ext valstringname_ext = VALUE_STRING_EXT_INIT(valstringname); + +For FT_(U)INT* fields that need a 'valstringname_ext' struct, the 'strings' field +would be set to '&valstringname_ext)'. Furthermore, 'display' field must be +ORed with 'BASE_EXT_STRING' (e.g. BASE_DEC|BASE_EXT_STRING). + + If the field has a numeric type that might logically fit in ranges of values one can use a range_string struct. |