• Home
  • Raw
  • Download

Lines Matching refs:rule

58   BusMatchRule *rule;  in bus_match_rule_new()  local
60 rule = dbus_new0 (BusMatchRule, 1); in bus_match_rule_new()
61 if (rule == NULL) in bus_match_rule_new()
64 rule->refcount = 1; in bus_match_rule_new()
65 rule->matches_go_to = matches_go_to; in bus_match_rule_new()
68 _dbus_assert (rule->matches_go_to != NULL); in bus_match_rule_new()
71 return rule; in bus_match_rule_new()
75 bus_match_rule_ref (BusMatchRule *rule) in bus_match_rule_ref() argument
77 _dbus_assert (rule->refcount > 0); in bus_match_rule_ref()
79 rule->refcount += 1; in bus_match_rule_ref()
81 return rule; in bus_match_rule_ref()
85 bus_match_rule_unref (BusMatchRule *rule) in bus_match_rule_unref() argument
87 _dbus_assert (rule->refcount > 0); in bus_match_rule_unref()
89 rule->refcount -= 1; in bus_match_rule_unref()
90 if (rule->refcount == 0) in bus_match_rule_unref()
92 dbus_free (rule->interface); in bus_match_rule_unref()
93 dbus_free (rule->member); in bus_match_rule_unref()
94 dbus_free (rule->sender); in bus_match_rule_unref()
95 dbus_free (rule->destination); in bus_match_rule_unref()
96 dbus_free (rule->path); in bus_match_rule_unref()
97 dbus_free (rule->arg_lens); in bus_match_rule_unref()
102 if (rule->args) in bus_match_rule_unref()
107 while (i < rule->args_len) in bus_match_rule_unref()
109 if (rule->args[i]) in bus_match_rule_unref()
110 dbus_free (rule->args[i]); in bus_match_rule_unref()
114 dbus_free (rule->args); in bus_match_rule_unref()
117 dbus_free (rule); in bus_match_rule_unref()
126 match_rule_to_string (BusMatchRule *rule) in match_rule_to_string() argument
139 if (rule->flags & BUS_MATCH_MESSAGE_TYPE) in match_rule_to_string()
142 dbus_message_type_to_string (rule->message_type))) in match_rule_to_string()
146 if (rule->flags & BUS_MATCH_INTERFACE) in match_rule_to_string()
154 if (!_dbus_string_append_printf (&str, "interface='%s'", rule->interface)) in match_rule_to_string()
158 if (rule->flags & BUS_MATCH_MEMBER) in match_rule_to_string()
166 if (!_dbus_string_append_printf (&str, "member='%s'", rule->member)) in match_rule_to_string()
170 if (rule->flags & BUS_MATCH_PATH) in match_rule_to_string()
178 if (!_dbus_string_append_printf (&str, "path='%s'", rule->path)) in match_rule_to_string()
182 if (rule->flags & BUS_MATCH_PATH_NAMESPACE) in match_rule_to_string()
190 if (!_dbus_string_append_printf (&str, "path_namespace='%s'", rule->path)) in match_rule_to_string()
194 if (rule->flags & BUS_MATCH_SENDER) in match_rule_to_string()
202 if (!_dbus_string_append_printf (&str, "sender='%s'", rule->sender)) in match_rule_to_string()
206 if (rule->flags & BUS_MATCH_DESTINATION) in match_rule_to_string()
214 if (!_dbus_string_append_printf (&str, "destination='%s'", rule->destination)) in match_rule_to_string()
218 if (rule->flags & BUS_MATCH_CLIENT_IS_EAVESDROPPING) in match_rule_to_string()
227 (rule->flags & BUS_MATCH_CLIENT_IS_EAVESDROPPING) ? in match_rule_to_string()
232 if (rule->flags & BUS_MATCH_ARGS) in match_rule_to_string()
236 _dbus_assert (rule->args != NULL); in match_rule_to_string()
239 while (i < rule->args_len) in match_rule_to_string()
241 if (rule->args[i] != NULL) in match_rule_to_string()
251 is_path = (rule->arg_lens[i] & BUS_MATCH_ARG_IS_PATH) != 0; in match_rule_to_string()
252 is_namespace = (rule->arg_lens[i] & BUS_MATCH_ARG_NAMESPACE) != 0; in match_rule_to_string()
259 rule->args[i])) in match_rule_to_string()
285 bus_match_rule_set_message_type (BusMatchRule *rule, in bus_match_rule_set_message_type() argument
288 rule->flags |= BUS_MATCH_MESSAGE_TYPE; in bus_match_rule_set_message_type()
290 rule->message_type = type; in bus_match_rule_set_message_type()
296 bus_match_rule_set_interface (BusMatchRule *rule, in bus_match_rule_set_interface() argument
307 rule->flags |= BUS_MATCH_INTERFACE; in bus_match_rule_set_interface()
308 dbus_free (rule->interface); in bus_match_rule_set_interface()
309 rule->interface = new; in bus_match_rule_set_interface()
315 bus_match_rule_set_member (BusMatchRule *rule, in bus_match_rule_set_member() argument
326 rule->flags |= BUS_MATCH_MEMBER; in bus_match_rule_set_member()
327 dbus_free (rule->member); in bus_match_rule_set_member()
328 rule->member = new; in bus_match_rule_set_member()
334 bus_match_rule_set_sender (BusMatchRule *rule, in bus_match_rule_set_sender() argument
345 rule->flags |= BUS_MATCH_SENDER; in bus_match_rule_set_sender()
346 dbus_free (rule->sender); in bus_match_rule_set_sender()
347 rule->sender = new; in bus_match_rule_set_sender()
353 bus_match_rule_set_destination (BusMatchRule *rule, in bus_match_rule_set_destination() argument
364 rule->flags |= BUS_MATCH_DESTINATION; in bus_match_rule_set_destination()
365 dbus_free (rule->destination); in bus_match_rule_set_destination()
366 rule->destination = new; in bus_match_rule_set_destination()
372 bus_match_rule_set_client_is_eavesdropping (BusMatchRule *rule, in bus_match_rule_set_client_is_eavesdropping() argument
376 rule->flags |= BUS_MATCH_CLIENT_IS_EAVESDROPPING; in bus_match_rule_set_client_is_eavesdropping()
378 rule->flags &= ~(BUS_MATCH_CLIENT_IS_EAVESDROPPING); in bus_match_rule_set_client_is_eavesdropping()
382 bus_match_rule_set_path (BusMatchRule *rule, in bus_match_rule_set_path() argument
394 rule->flags &= ~(BUS_MATCH_PATH|BUS_MATCH_PATH_NAMESPACE); in bus_match_rule_set_path()
397 rule->flags |= BUS_MATCH_PATH_NAMESPACE; in bus_match_rule_set_path()
399 rule->flags |= BUS_MATCH_PATH; in bus_match_rule_set_path()
401 dbus_free (rule->path); in bus_match_rule_set_path()
402 rule->path = new; in bus_match_rule_set_path()
408 bus_match_rule_set_arg (BusMatchRule *rule, in bus_match_rule_set_arg() argument
422 if (arg >= rule->args_len) in bus_match_rule_set_arg()
432 new_args = dbus_realloc (rule->args, in bus_match_rule_set_arg()
438 i = rule->args_len; in bus_match_rule_set_arg()
445 rule->args = new_args; in bus_match_rule_set_arg()
448 new_arg_lens = dbus_realloc (rule->arg_lens, in bus_match_rule_set_arg()
455 i = rule->args_len; in bus_match_rule_set_arg()
462 rule->arg_lens = new_arg_lens; in bus_match_rule_set_arg()
463 rule->args_len = new_args_len; in bus_match_rule_set_arg()
470 rule->flags |= BUS_MATCH_ARGS; in bus_match_rule_set_arg()
472 dbus_free (rule->args[arg]); in bus_match_rule_set_arg()
473 rule->arg_lens[arg] = length; in bus_match_rule_set_arg()
474 rule->args[arg] = new; in bus_match_rule_set_arg()
477 rule->arg_lens[arg] |= BUS_MATCH_ARG_IS_PATH; in bus_match_rule_set_arg()
480 rule->arg_lens[arg] |= BUS_MATCH_ARG_NAMESPACE; in bus_match_rule_set_arg()
483 _dbus_assert (rule->args[rule->args_len] == NULL); in bus_match_rule_set_arg()
484 _dbus_assert (rule->arg_lens[rule->args_len] == 0); in bus_match_rule_set_arg()
771 bus_match_rule_parse_arg_match (BusMatchRule *rule, in bus_match_rule_parse_arg_match() argument
845 if ((rule->flags & BUS_MATCH_ARGS) && in bus_match_rule_parse_arg_match()
846 rule->args_len > (int) arg && in bus_match_rule_parse_arg_match()
847 rule->args[arg] != NULL) in bus_match_rule_parse_arg_match()
854 if (!bus_match_rule_set_arg (rule, arg, value, is_path, is_namespace)) in bus_match_rule_parse_arg_match()
880 BusMatchRule *rule; in bus_match_rule_parse() local
897 rule = bus_match_rule_new (matches_go_to); in bus_match_rule_parse()
898 if (rule == NULL) in bus_match_rule_parse()
922 if (rule->flags & BUS_MATCH_MESSAGE_TYPE) in bus_match_rule_parse()
938 if (!bus_match_rule_set_message_type (rule, t)) in bus_match_rule_parse()
946 if (rule->flags & BUS_MATCH_SENDER) in bus_match_rule_parse()
960 if (!bus_match_rule_set_sender (rule, value)) in bus_match_rule_parse()
968 if (rule->flags & BUS_MATCH_INTERFACE) in bus_match_rule_parse()
982 if (!bus_match_rule_set_interface (rule, value)) in bus_match_rule_parse()
990 if (rule->flags & BUS_MATCH_MEMBER) in bus_match_rule_parse()
1004 if (!bus_match_rule_set_member (rule, value)) in bus_match_rule_parse()
1015 if (rule->flags & (BUS_MATCH_PATH | BUS_MATCH_PATH_NAMESPACE)) in bus_match_rule_parse()
1029 if (!bus_match_rule_set_path (rule, value, is_namespace)) in bus_match_rule_parse()
1037 if (rule->flags & BUS_MATCH_DESTINATION) in bus_match_rule_parse()
1051 if (!bus_match_rule_set_destination (rule, value)) in bus_match_rule_parse()
1067 bus_match_rule_set_client_is_eavesdropping (rule, TRUE); in bus_match_rule_parse()
1071 bus_match_rule_set_client_is_eavesdropping (rule, FALSE); in bus_match_rule_parse()
1084 if (!bus_match_rule_parse_arg_match (rule, key, &tmp_str, error)) in bus_match_rule_parse()
1103 if (rule) in bus_match_rule_parse()
1105 bus_match_rule_unref (rule); in bus_match_rule_parse()
1106 rule = NULL; in bus_match_rule_parse()
1120 return rule; in bus_match_rule_parse()
1149 BusMatchRule *rule; in rule_list_free() local
1151 rule = (*rules)->data; in rule_list_free()
1152 bus_match_rule_unref (rule); in rule_list_free()
1328 BusMatchRule *rule) in bus_matchmaker_add_rule() argument
1332 _dbus_assert (bus_connection_is_active (rule->matches_go_to)); in bus_matchmaker_add_rule()
1335 rule->message_type, in bus_matchmaker_add_rule()
1336 rule->interface != NULL ? rule->interface : "<null>"); in bus_matchmaker_add_rule()
1338 rules = bus_matchmaker_get_rules (matchmaker, rule->message_type, in bus_matchmaker_add_rule()
1339 rule->interface, TRUE); in bus_matchmaker_add_rule()
1344 if (!_dbus_list_append (rules, rule)) in bus_matchmaker_add_rule()
1347 if (!bus_connection_add_match_rule (rule->matches_go_to, rule)) in bus_matchmaker_add_rule()
1349 _dbus_list_remove_last (rules, rule); in bus_matchmaker_add_rule()
1350 bus_matchmaker_gc_rules (matchmaker, rule->message_type, in bus_matchmaker_add_rule()
1351 rule->interface, rules); in bus_matchmaker_add_rule()
1355 bus_match_rule_ref (rule); in bus_matchmaker_add_rule()
1359 char *s = match_rule_to_string (rule); in bus_matchmaker_add_rule()
1362 s, rule->matches_go_to); in bus_matchmaker_add_rule()
1445 BusMatchRule *rule = link->data; in bus_matchmaker_remove_rule_link() local
1447 bus_connection_remove_match_rule (rule->matches_go_to, rule); in bus_matchmaker_remove_rule_link()
1452 char *s = match_rule_to_string (rule); in bus_matchmaker_remove_rule_link()
1455 s, rule->matches_go_to); in bus_matchmaker_remove_rule_link()
1460 bus_match_rule_unref (rule); in bus_matchmaker_remove_rule_link()
1465 BusMatchRule *rule) in bus_matchmaker_remove_rule() argument
1470 rule->message_type, in bus_matchmaker_remove_rule()
1471 rule->interface != NULL ? rule->interface : "<null>"); in bus_matchmaker_remove_rule()
1473 bus_connection_remove_match_rule (rule->matches_go_to, rule); in bus_matchmaker_remove_rule()
1475 rules = bus_matchmaker_get_rules (matchmaker, rule->message_type, in bus_matchmaker_remove_rule()
1476 rule->interface, FALSE); in bus_matchmaker_remove_rule()
1483 _dbus_list_remove (rules, rule); in bus_matchmaker_remove_rule()
1484 bus_matchmaker_gc_rules (matchmaker, rule->message_type, rule->interface, in bus_matchmaker_remove_rule()
1489 char *s = match_rule_to_string (rule); in bus_matchmaker_remove_rule()
1492 s, rule->matches_go_to); in bus_matchmaker_remove_rule()
1497 bus_match_rule_unref (rule); in bus_matchmaker_remove_rule()
1524 BusMatchRule *rule; in bus_matchmaker_remove_rule_by_value() local
1527 rule = link->data; in bus_matchmaker_remove_rule_by_value()
1530 if (match_rule_equal (rule, value)) in bus_matchmaker_remove_rule_by_value()
1562 BusMatchRule *rule; in rule_list_remove_by_connection() local
1565 rule = link->data; in rule_list_remove_by_connection()
1568 if (rule->matches_go_to == connection) in rule_list_remove_by_connection()
1572 else if (((rule->flags & BUS_MATCH_SENDER) && *rule->sender == ':') || in rule_list_remove_by_connection()
1573 ((rule->flags & BUS_MATCH_DESTINATION) && *rule->destination == ':')) in rule_list_remove_by_connection()
1584 if (((rule->flags & BUS_MATCH_SENDER) && in rule_list_remove_by_connection()
1585 strcmp (rule->sender, name) == 0) || in rule_list_remove_by_connection()
1586 ((rule->flags & BUS_MATCH_DESTINATION) && in rule_list_remove_by_connection()
1587 strcmp (rule->destination, name) == 0)) in rule_list_remove_by_connection()
1668 match_rule_matches (BusMatchRule *rule, in match_rule_matches() argument
1687 flags = rule->flags & (~already_matched); in match_rule_matches()
1694 _dbus_assert (rule->message_type != DBUS_MESSAGE_TYPE_INVALID); in match_rule_matches()
1696 if (rule->message_type != dbus_message_get_type (message)) in match_rule_matches()
1704 _dbus_assert (rule->interface != NULL); in match_rule_matches()
1710 if (strcmp (iface, rule->interface) != 0) in match_rule_matches()
1718 _dbus_assert (rule->member != NULL); in match_rule_matches()
1724 if (strcmp (member, rule->member) != 0) in match_rule_matches()
1730 _dbus_assert (rule->sender != NULL); in match_rule_matches()
1734 if (strcmp (rule->sender, in match_rule_matches()
1740 if (!connection_is_primary_owner (sender, rule->sender)) in match_rule_matches()
1767 _dbus_assert (rule->destination != NULL); in match_rule_matches()
1781 if (strcmp (rule->destination, in match_rule_matches()
1787 if (!connection_is_primary_owner (addressed_recipient, rule->destination)) in match_rule_matches()
1793 _dbus_assert (rule->destination == NULL); in match_rule_matches()
1809 _dbus_assert (rule->path != NULL); in match_rule_matches()
1815 if (strcmp (path, rule->path) != 0) in match_rule_matches()
1824 _dbus_assert (rule->path != NULL); in match_rule_matches()
1830 if (!str_has_prefix (path, rule->path)) in match_rule_matches()
1833 len = strlen (rule->path); in match_rule_matches()
1849 _dbus_assert (rule->args != NULL); in match_rule_matches()
1854 while (i < rule->args_len) in match_rule_matches()
1861 expected_arg = rule->args[i]; in match_rule_matches()
1862 expected_length = rule->arg_lens[i] & ~BUS_MATCH_ARG_FLAGS; in match_rule_matches()
1863 is_path = (rule->arg_lens[i] & BUS_MATCH_ARG_IS_PATH) != 0; in match_rule_matches()
1864 is_namespace = (rule->arg_lens[i] & BUS_MATCH_ARG_NAMESPACE) != 0; in match_rule_matches()
1957 BusMatchRule *rule; in get_recipients_from_list() local
1959 rule = link->data; in get_recipients_from_list()
1963 char *s = match_rule_to_string (rule); in get_recipients_from_list()
1966 s, rule->matches_go_to); in get_recipients_from_list()
1971 if (match_rule_matches (rule, in get_recipients_from_list()
1978 if (bus_connection_mark_stamp (rule->matches_go_to)) in get_recipients_from_list()
1980 if (!_dbus_list_append (recipients_p, rule->matches_go_to)) in get_recipients_from_list()
2067 BusMatchRule *rule; in check_parse() local
2075 rule = bus_match_rule_parse (NULL, &str, &error); in check_parse()
2082 if (should_succeed && rule == NULL) in check_parse()
2090 if (!should_succeed && rule != NULL) in check_parse()
2099 return rule; in check_parse()
2103 assert_large_rule (BusMatchRule *rule) in assert_large_rule() argument
2105 _dbus_assert (rule->flags & BUS_MATCH_MESSAGE_TYPE); in assert_large_rule()
2106 _dbus_assert (rule->flags & BUS_MATCH_SENDER); in assert_large_rule()
2107 _dbus_assert (rule->flags & BUS_MATCH_INTERFACE); in assert_large_rule()
2108 _dbus_assert (rule->flags & BUS_MATCH_MEMBER); in assert_large_rule()
2109 _dbus_assert (rule->flags & BUS_MATCH_DESTINATION); in assert_large_rule()
2110 _dbus_assert (rule->flags & BUS_MATCH_PATH); in assert_large_rule()
2112 _dbus_assert (rule->message_type == DBUS_MESSAGE_TYPE_SIGNAL); in assert_large_rule()
2113 _dbus_assert (rule->interface != NULL); in assert_large_rule()
2114 _dbus_assert (rule->member != NULL); in assert_large_rule()
2115 _dbus_assert (rule->sender != NULL); in assert_large_rule()
2116 _dbus_assert (rule->destination != NULL); in assert_large_rule()
2117 _dbus_assert (rule->path != NULL); in assert_large_rule()
2119 _dbus_assert (strcmp (rule->interface, "org.freedesktop.DBusInterface") == 0); in assert_large_rule()
2120 _dbus_assert (strcmp (rule->sender, "org.freedesktop.DBusSender") == 0); in assert_large_rule()
2121 _dbus_assert (strcmp (rule->member, "Foo") == 0); in assert_large_rule()
2122 _dbus_assert (strcmp (rule->path, "/bar/foo") == 0); in assert_large_rule()
2123 _dbus_assert (strcmp (rule->destination, ":452345.34") == 0); in assert_large_rule()
2129 BusMatchRule *rule; in test_parsing() local
2131rule = check_parse (TRUE, "type='signal',sender='org.freedesktop.DBusSender',interface='org.freede… in test_parsing()
2132 if (rule != NULL) in test_parsing()
2134 assert_large_rule (rule); in test_parsing()
2135 bus_match_rule_unref (rule); in test_parsing()
2139rule = check_parse (TRUE, " type='signal', \tsender='org.freedes''ktop.DBusSender', interfac… in test_parsing()
2140 if (rule != NULL) in test_parsing()
2142 assert_large_rule (rule); in test_parsing()
2143 bus_match_rule_unref (rule); in test_parsing()
2148 rule = check_parse (TRUE, "type='signal',path='/foo',interface='org.Bar'"); in test_parsing()
2149 if (rule != NULL) in test_parsing()
2151 _dbus_assert (rule->flags & BUS_MATCH_MESSAGE_TYPE); in test_parsing()
2152 _dbus_assert (rule->flags & BUS_MATCH_INTERFACE); in test_parsing()
2153 _dbus_assert (rule->flags & BUS_MATCH_PATH); in test_parsing()
2155 _dbus_assert (rule->message_type == DBUS_MESSAGE_TYPE_SIGNAL); in test_parsing()
2156 _dbus_assert (rule->interface != NULL); in test_parsing()
2157 _dbus_assert (rule->path != NULL); in test_parsing()
2159 _dbus_assert (strcmp (rule->interface, "org.Bar") == 0); in test_parsing()
2160 _dbus_assert (strcmp (rule->path, "/foo") == 0); in test_parsing()
2162 bus_match_rule_unref (rule); in test_parsing()
2166 rule = check_parse (TRUE, "arg0='foo'"); in test_parsing()
2167 if (rule != NULL) in test_parsing()
2169 _dbus_assert (rule->flags == BUS_MATCH_ARGS); in test_parsing()
2170 _dbus_assert (rule->args != NULL); in test_parsing()
2171 _dbus_assert (rule->args_len == 1); in test_parsing()
2172 _dbus_assert (rule->args[0] != NULL); in test_parsing()
2173 _dbus_assert (rule->args[1] == NULL); in test_parsing()
2174 _dbus_assert (strcmp (rule->args[0], "foo") == 0); in test_parsing()
2176 bus_match_rule_unref (rule); in test_parsing()
2179 rule = check_parse (TRUE, "arg1='foo'"); in test_parsing()
2180 if (rule != NULL) in test_parsing()
2182 _dbus_assert (rule->flags == BUS_MATCH_ARGS); in test_parsing()
2183 _dbus_assert (rule->args != NULL); in test_parsing()
2184 _dbus_assert (rule->args_len == 2); in test_parsing()
2185 _dbus_assert (rule->args[0] == NULL); in test_parsing()
2186 _dbus_assert (rule->args[1] != NULL); in test_parsing()
2187 _dbus_assert (rule->args[2] == NULL); in test_parsing()
2188 _dbus_assert (strcmp (rule->args[1], "foo") == 0); in test_parsing()
2190 bus_match_rule_unref (rule); in test_parsing()
2193 rule = check_parse (TRUE, "arg2='foo'"); in test_parsing()
2194 if (rule != NULL) in test_parsing()
2196 _dbus_assert (rule->flags == BUS_MATCH_ARGS); in test_parsing()
2197 _dbus_assert (rule->args != NULL); in test_parsing()
2198 _dbus_assert (rule->args_len == 3); in test_parsing()
2199 _dbus_assert (rule->args[0] == NULL); in test_parsing()
2200 _dbus_assert (rule->args[1] == NULL); in test_parsing()
2201 _dbus_assert (rule->args[2] != NULL); in test_parsing()
2202 _dbus_assert (rule->args[3] == NULL); in test_parsing()
2203 _dbus_assert (strcmp (rule->args[2], "foo") == 0); in test_parsing()
2205 bus_match_rule_unref (rule); in test_parsing()
2208 rule = check_parse (TRUE, "arg40='foo'"); in test_parsing()
2209 if (rule != NULL) in test_parsing()
2211 _dbus_assert (rule->flags == BUS_MATCH_ARGS); in test_parsing()
2212 _dbus_assert (rule->args != NULL); in test_parsing()
2213 _dbus_assert (rule->args_len == 41); in test_parsing()
2214 _dbus_assert (rule->args[0] == NULL); in test_parsing()
2215 _dbus_assert (rule->args[1] == NULL); in test_parsing()
2216 _dbus_assert (rule->args[40] != NULL); in test_parsing()
2217 _dbus_assert (rule->args[41] == NULL); in test_parsing()
2218 _dbus_assert (strcmp (rule->args[40], "foo") == 0); in test_parsing()
2220 bus_match_rule_unref (rule); in test_parsing()
2223 rule = check_parse (TRUE, "arg63='foo'"); in test_parsing()
2224 if (rule != NULL) in test_parsing()
2226 _dbus_assert (rule->flags == BUS_MATCH_ARGS); in test_parsing()
2227 _dbus_assert (rule->args != NULL); in test_parsing()
2228 _dbus_assert (rule->args_len == 64); in test_parsing()
2229 _dbus_assert (rule->args[0] == NULL); in test_parsing()
2230 _dbus_assert (rule->args[1] == NULL); in test_parsing()
2231 _dbus_assert (rule->args[63] != NULL); in test_parsing()
2232 _dbus_assert (rule->args[64] == NULL); in test_parsing()
2233 _dbus_assert (strcmp (rule->args[63], "foo") == 0); in test_parsing()
2235 bus_match_rule_unref (rule); in test_parsing()
2238 rule = check_parse (TRUE, "arg7path='/foo'"); in test_parsing()
2239 if (rule != NULL) in test_parsing()
2241 _dbus_assert (rule->flags = BUS_MATCH_ARGS); in test_parsing()
2242 _dbus_assert (rule->args != NULL); in test_parsing()
2243 _dbus_assert (rule->args_len == 8); in test_parsing()
2244 _dbus_assert (rule->args[7] != NULL); in test_parsing()
2245 _dbus_assert (rule->args[8] == NULL); in test_parsing()
2246 _dbus_assert (strcmp (rule->args[7], "/foo") == 0); in test_parsing()
2247 _dbus_assert ((rule->arg_lens[7] & BUS_MATCH_ARG_IS_PATH) in test_parsing()
2250 bus_match_rule_unref (rule); in test_parsing()
2254 rule = check_parse (TRUE, "arg0namespace='foo'"); in test_parsing()
2255 if (rule != NULL) in test_parsing()
2257 _dbus_assert (rule->flags == BUS_MATCH_ARGS); in test_parsing()
2258 _dbus_assert (rule->args != NULL); in test_parsing()
2259 _dbus_assert (rule->args_len == 1); in test_parsing()
2260 _dbus_assert (strcmp (rule->args[0], "foo") == 0); in test_parsing()
2261 _dbus_assert ((rule->arg_lens[0] & BUS_MATCH_ARG_NAMESPACE) in test_parsing()
2264 bus_match_rule_unref (rule); in test_parsing()
2267 rule = check_parse (TRUE, "arg0namespace='foo.bar'"); in test_parsing()
2268 if (rule != NULL) in test_parsing()
2270 _dbus_assert (rule->flags == BUS_MATCH_ARGS); in test_parsing()
2271 _dbus_assert (rule->args != NULL); in test_parsing()
2272 _dbus_assert (rule->args_len == 1); in test_parsing()
2273 _dbus_assert (strcmp (rule->args[0], "foo.bar") == 0); in test_parsing()
2274 _dbus_assert ((rule->arg_lens[0] & BUS_MATCH_ARG_NAMESPACE) in test_parsing()
2277 bus_match_rule_unref (rule); in test_parsing()
2281 rule = check_parse (FALSE, "arg1namespace='foo'"); in test_parsing()
2282 _dbus_assert (rule == NULL); in test_parsing()
2287 rule = check_parse (FALSE, "arg0namespace=''"); in test_parsing()
2288 _dbus_assert (rule == NULL); in test_parsing()
2292 rule = check_parse (FALSE, "arg0namespace='foo.'"); in test_parsing()
2293 _dbus_assert (rule == NULL); in test_parsing()
2295 rule = check_parse (FALSE, "arg0namespace='foo.bar.'"); in test_parsing()
2296 _dbus_assert (rule == NULL); in test_parsing()
2298 rule = check_parse (FALSE, "arg0namespace='foo..'"); in test_parsing()
2299 _dbus_assert (rule == NULL); in test_parsing()
2301 rule = check_parse (FALSE, "arg0namespace='foo.bar..'"); in test_parsing()
2302 _dbus_assert (rule == NULL); in test_parsing()
2305 rule = check_parse (FALSE, "arg300='foo'"); in test_parsing()
2306 _dbus_assert (rule == NULL); in test_parsing()
2307 rule = check_parse (FALSE, "arg64='foo'"); in test_parsing()
2308 _dbus_assert (rule == NULL); in test_parsing()
2311 rule = check_parse (FALSE, "arg='foo'"); in test_parsing()
2312 _dbus_assert (rule == NULL); in test_parsing()
2313 rule = check_parse (FALSE, "argv='foo'"); in test_parsing()
2314 _dbus_assert (rule == NULL); in test_parsing()
2315 rule = check_parse (FALSE, "arg3junk='foo'"); in test_parsing()
2316 _dbus_assert (rule == NULL); in test_parsing()
2317 rule = check_parse (FALSE, "argument='foo'"); in test_parsing()
2318 _dbus_assert (rule == NULL); in test_parsing()
2321 rule = check_parse (FALSE, "type='signal',type='method_call'"); in test_parsing()
2322 _dbus_assert (rule == NULL); in test_parsing()
2324 rule = check_parse (TRUE, "path_namespace='/foo/bar'"); in test_parsing()
2325 if (rule != NULL) in test_parsing()
2327 _dbus_assert (rule->flags == BUS_MATCH_PATH_NAMESPACE); in test_parsing()
2328 _dbus_assert (rule->path != NULL); in test_parsing()
2329 _dbus_assert (strcmp (rule->path, "/foo/bar") == 0); in test_parsing()
2331 bus_match_rule_unref (rule); in test_parsing()
2335 rule = check_parse (FALSE, "path='/foo',path_namespace='/foo'"); in test_parsing()
2336 _dbus_assert (rule == NULL); in test_parsing()
2339 rule = check_parse (FALSE, "path_namespace='/foo/'"); in test_parsing()
2340 _dbus_assert (rule == NULL); in test_parsing()
2343 rule = check_parse (FALSE, "arg0='foo',arg0='bar'"); in test_parsing()
2344 _dbus_assert (rule == NULL); in test_parsing()
2345 rule = check_parse (FALSE, "arg3='foo',arg3='bar'"); in test_parsing()
2346 _dbus_assert (rule == NULL); in test_parsing()
2347 rule = check_parse (FALSE, "arg30='foo',arg30='bar'"); in test_parsing()
2348 _dbus_assert (rule == NULL); in test_parsing()
2351 rule = check_parse (FALSE, "blah='signal'"); in test_parsing()
2352 _dbus_assert (rule == NULL); in test_parsing()
2355 rule = check_parse (FALSE, "type='chouin'"); in test_parsing()
2356 _dbus_assert (rule == NULL); in test_parsing()
2357 rule = check_parse (FALSE, "interface='abc@def++'"); in test_parsing()
2358 _dbus_assert (rule == NULL); in test_parsing()
2359 rule = check_parse (FALSE, "service='youpi'"); in test_parsing()
2360 _dbus_assert (rule == NULL); in test_parsing()
2363 rule = check_parse (TRUE, ""); in test_parsing()
2364 if (rule != NULL) in test_parsing()
2366 _dbus_assert (rule->flags == 0); in test_parsing()
2368 bus_match_rule_unref (rule); in test_parsing()
2372 rule = check_parse (TRUE, " \t"); in test_parsing()
2373 if (rule != NULL) in test_parsing()
2375 _dbus_assert (rule->flags == 0); in test_parsing()
2377 bus_match_rule_unref (rule); in test_parsing()
2381 rule = check_parse (FALSE, "type"); in test_parsing()
2382 _dbus_assert (rule == NULL); in test_parsing()
2544 BusMatchRule *rule; in check_matches() local
2547 rule = check_parse (TRUE, rule_text); in check_matches()
2548 _dbus_assert (rule != NULL); in check_matches()
2551 matched = match_rule_matches (rule, NULL, NULL, message, 0); in check_matches()
2561 bus_match_rule_unref (rule); in check_matches()
2664 BusMatchRule *rule, in test_path_match() argument
2679 matched = match_rule_matches (rule, NULL, NULL, message, 0); in test_path_match()
2698 BusMatchRule *rule; in test_path_matching() local
2701 rule = check_parse (TRUE, PATH_MATCH_RULE); in test_path_matching()
2702 _dbus_assert (rule != NULL); in test_path_matching()
2705 test_path_match (DBUS_TYPE_STRING, *s, PATH_MATCH_RULE, rule, TRUE); in test_path_matching()
2709 test_path_match (DBUS_TYPE_OBJECT_PATH, *s, PATH_MATCH_RULE, rule, TRUE); in test_path_matching()
2713 test_path_match (DBUS_TYPE_STRING, *s, PATH_MATCH_RULE, rule, FALSE); in test_path_matching()
2714 test_path_match (DBUS_TYPE_OBJECT_PATH, *s, PATH_MATCH_RULE, rule, FALSE); in test_path_matching()
2717 bus_match_rule_unref (rule); in test_path_matching()