[sr-dev] htable add/delete RPC commands
osas at voipembedded.com
Tue Feb 25 20:57:19 CET 2014
As it is implemented right now, there's no hole, because we don't have
a true array, just keys with a shared prefix.
I guess the term array that is used right now is not right (it sets
Maybe map is a better term.
Anyway, I updated the documentation to reflect the current code.
And the loop example that you provided is what one would expect based
on the 'array' term. If we would use 'map' term, maybe the confusion
could be avoided.
Also, it is true that there's no bulletproof way to iterate through
all value/pairs of a given key after performing operations on an
'array' key. It seems that this is what's really missing here.
Although, a well crafted script could handle this.
On Tue, Feb 25, 2014 at 2:47 PM, Juha Heinanen <jh at tutpro.com> wrote:
> Ovidiu Sas writes:
>> Based on how htable works now, a specific pseudoarray entry can be
>> deleted by specifying it's position:
>> kamcmd htable.delete H_TABLE H_KEY[INDEX]
>> I tested it and it works ok.
> yes, but it breaks the while loop example unless you also fill the hole
> and decrement key::size.
> -- juha
VoIP Embedded, Inc.
More information about the sr-dev