Browse code

modules: readme files regenerated - htable ... [skip ci]

Kamailio Dev authored on 08/10/2021 08:01:20
Showing 1 changed files
... ...
@@ -66,10 +66,11 @@ Ovidiu Sas
66 66
               4.10. sht_iterator_start(iname, hname)
67 67
               4.11. sht_iterator_end(iname)
68 68
               4.12. sht_iterator_next(iname)
69
-              4.13. sht_match_name(htable, op, mval)
70
-              4.14. sht_has_name(htable, op, mval)
71
-              4.15. sht_match_str_value(htable, op, mval)
72
-              4.16. sht_has_str_value(htable, op, mval)
69
+              4.13. sht_iterator_rm(iname)
70
+              4.14. sht_match_name(htable, op, mval)
71
+              4.15. sht_has_name(htable, op, mval)
72
+              4.16. sht_match_str_value(htable, op, mval)
73
+              4.17. sht_has_str_value(htable, op, mval)
73 74
 
74 75
         5. Exported pseudo-variables
75 76
         6. RPC Commands
... ...
@@ -123,8 +124,9 @@ Ovidiu Sas
123 124
    1.29. sht_iterator_start usage
124 125
    1.30. sht_iterator_end usage
125 126
    1.31. sht_iterator_next usage
126
-   1.32. sht_match_name usage
127
+   1.32. sht_iterator_rm usage
127 128
    1.33. sht_match_name usage
129
+   1.34. sht_match_name usage
128 130
 
129 131
 Chapter 1. Admin Guide
130 132
 
... ...
@@ -170,10 +172,11 @@ Chapter 1. Admin Guide
170 172
         4.10. sht_iterator_start(iname, hname)
171 173
         4.11. sht_iterator_end(iname)
172 174
         4.12. sht_iterator_next(iname)
173
-        4.13. sht_match_name(htable, op, mval)
174
-        4.14. sht_has_name(htable, op, mval)
175
-        4.15. sht_match_str_value(htable, op, mval)
176
-        4.16. sht_has_str_value(htable, op, mval)
175
+        4.13. sht_iterator_rm(iname)
176
+        4.14. sht_match_name(htable, op, mval)
177
+        4.15. sht_has_name(htable, op, mval)
178
+        4.16. sht_match_str_value(htable, op, mval)
179
+        4.17. sht_has_str_value(htable, op, mval)
177 180
 
178 181
    5. Exported pseudo-variables
179 182
    6. RPC Commands
... ...
@@ -718,10 +721,11 @@ modparam("htable", "event_callback_mode", 1)
718 721
    4.10. sht_iterator_start(iname, hname)
719 722
    4.11. sht_iterator_end(iname)
720 723
    4.12. sht_iterator_next(iname)
721
-   4.13. sht_match_name(htable, op, mval)
722
-   4.14. sht_has_name(htable, op, mval)
723
-   4.15. sht_match_str_value(htable, op, mval)
724
-   4.16. sht_has_str_value(htable, op, mval)
724
+   4.13. sht_iterator_rm(iname)
725
+   4.14. sht_match_name(htable, op, mval)
726
+   4.15. sht_has_name(htable, op, mval)
727
+   4.16. sht_match_str_value(htable, op, mval)
728
+   4.17. sht_has_str_value(htable, op, mval)
725 729
 
726 730
 4.1.  sht_print()
727 731
 
... ...
@@ -911,7 +915,32 @@ sht_iterator_end("i1");
911 915
     sht_iterator_end("i1");
912 916
 ...
913 917
 
914
-4.13.  sht_match_name(htable, op, mval)
918
+4.13.  sht_iterator_rm(iname)
919
+
920
+   Remove the current item in the iterator and move the iterator to the
921
+   next one.
922
+
923
+   The return code is 1 (true) if the item was removed and next item
924
+   exists; -2 (false) if the item was removed and there is no next item
925
+   (end of items); other negative value (false) can be returned on error
926
+   (e.g., iterator or item not found).
927
+
928
+   The parameter can be dynamic string with variables.
929
+
930
+   This function can be used from ANY_ROUTE.
931
+
932
+   Example 1.32. sht_iterator_rm usage
933
+...
934
+    sht_iterator_start("i1", "h1");
935
+    while(sht_iterator_next("i1")) {
936
+        while($shtitkey(i1) =~ "xyz" and sht_iterator_rm("i1")) {
937
+            xdbg("item removed\n");
938
+        }
939
+    }
940
+    sht_iterator_end("i1");
941
+...
942
+
943
+4.14.  sht_match_name(htable, op, mval)
915 944
 
916 945
    Return greater than 0 (true) if the htable has an item that matches the
917 946
    name against the mval parameter.
... ...
@@ -926,18 +955,18 @@ sht_iterator_end("i1");
926 955
 
927 956
    This function can be used from ANY_ROUTE.
928 957
 
929
-   Example 1.32. sht_match_name usage
958
+   Example 1.33. sht_match_name usage
930 959
 ...
931 960
 if(sht_match_name("ha", "eq", "alice")) {
932 961
   ...
933 962
 }
934 963
 ...
935 964
 
936
-4.14.  sht_has_name(htable, op, mval)
965
+4.15.  sht_has_name(htable, op, mval)
937 966
 
938 967
    Alias for sht_match_name().
939 968
 
940
-4.15.  sht_match_str_value(htable, op, mval)
969
+4.16.  sht_match_str_value(htable, op, mval)
941 970
 
942 971
    Return greater than 0 (true) if the htable has an item that matches the
943 972
    string value against the mval parameter.
... ...
@@ -952,14 +981,14 @@ if(sht_match_name("ha", "eq", "alice")) {
952 981
 
953 982
    This function can be used from ANY_ROUTE.
954 983
 
955
-   Example 1.33. sht_match_name usage
984
+   Example 1.34. sht_match_name usage
956 985
 ...
957 986
 if(sht_match_str_value("ha", "eq", "alice")) {
958 987
   ...
959 988
 }
960 989
 ...
961 990
 
962
-4.16.  sht_has_str_value(htable, op, mval)
991
+4.17.  sht_has_str_value(htable, op, mval)
963 992
 
964 993
    Alias for sht_match_str_value().
965 994