Browse code

htable: docs for sht_has_name(...) and sht_has_str_value(...)

Daniel-Constantin Mierla authored on 04/09/2018 09:12:16
Showing 1 changed files
... ...
@@ -1026,6 +1026,114 @@ sht_iterator_end("i1");
1026 1026
     }
1027 1027
     sht_iterator_end("i1");
1028 1028
 ...
1029
+</programlisting>
1030
+		</example>
1031
+	</section>
1032
+	<section id="htable.f.sht_has_name">
1033
+		<title>
1034
+		<function moreinfo="none">sht_has_name(htable, op, mval)</function>
1035
+		</title>
1036
+		<para>
1037
+			Return greater than 0 (true) if the htable has an item that matches
1038
+			the name against the mval parameter.
1039
+		</para>
1040
+		<para>
1041
+			The op parameter can be:
1042
+		</para>
1043
+		<itemizedlist>
1044
+		<listitem>
1045
+		<para>
1046
+			<emphasis>eq</emphasis> - match the val parameter as string equal
1047
+			expression.
1048
+		</para>
1049
+		</listitem>
1050
+		<listitem>
1051
+		<para>
1052
+			<emphasis>ne</emphasis> - match the val parameter as string not-equal
1053
+			expression.
1054
+		</para>
1055
+		</listitem>
1056
+		<listitem>
1057
+		<para>
1058
+			<emphasis>re</emphasis> - match the val parameter as regular
1059
+			expression.
1060
+		</para>
1061
+		</listitem>
1062
+		<listitem>
1063
+		<para>
1064
+			<emphasis>sw</emphasis> - match the val parameter as 'starts
1065
+			with' expression.
1066
+		</para>
1067
+		</listitem>
1068
+		</itemizedlist>
1069
+		<para>
1070
+			All parameters can be static strings or contain variables.
1071
+		</para>
1072
+		<para>
1073
+			This function can be used from ANY_ROUTE.
1074
+		</para>
1075
+		<example>
1076
+		<title><function>sht_has_name</function> usage</title>
1077
+		<programlisting format="linespecific">
1078
+...
1079
+if(sht_has_name("ha", "eq", "alice")) {
1080
+  ...
1081
+}
1082
+...
1083
+</programlisting>
1084
+		</example>
1085
+	</section>
1086
+	<section id="htable.f.sht_has_str_value">
1087
+		<title>
1088
+		<function moreinfo="none">sht_has_str_value(htable, op, mval)</function>
1089
+		</title>
1090
+		<para>
1091
+			Return greater than 0 (true) if the htable has an item that matches
1092
+			the string value against the mval parameter.
1093
+		</para>
1094
+		<para>
1095
+			The op parameter can be:
1096
+		</para>
1097
+		<itemizedlist>
1098
+		<listitem>
1099
+		<para>
1100
+			<emphasis>eq</emphasis> - match the val parameter as string equal
1101
+			expression.
1102
+		</para>
1103
+		</listitem>
1104
+		<listitem>
1105
+		<para>
1106
+			<emphasis>ne</emphasis> - match the val parameter as string not-equal
1107
+			expression.
1108
+		</para>
1109
+		</listitem>
1110
+		<listitem>
1111
+		<para>
1112
+			<emphasis>re</emphasis> - match the val parameter as regular
1113
+			expression.
1114
+		</para>
1115
+		</listitem>
1116
+		<listitem>
1117
+		<para>
1118
+			<emphasis>sw</emphasis> - match the val parameter as 'starts
1119
+			with' expression.
1120
+		</para>
1121
+		</listitem>
1122
+		</itemizedlist>
1123
+		<para>
1124
+			All parameters can be static strings or contain variables.
1125
+		</para>
1126
+		<para>
1127
+			This function can be used from ANY_ROUTE.
1128
+		</para>
1129
+		<example>
1130
+		<title><function>sht_has_name</function> usage</title>
1131
+		<programlisting format="linespecific">
1132
+...
1133
+if(sht_has_str_value("ha", "eq", "alice")) {
1134
+  ...
1135
+}
1136
+...
1029 1137
 </programlisting>
1030 1138
 		</example>
1031 1139
 	</section>