Lines Matching defs:cur

1798 static int match_attr(struct udev_rules *rules, struct udev_device *dev, struct udev_event *event, struct token *cur) {
1805 name = rules_str(rules, cur->key.attr_off);
1806 switch (cur->key.attrsubst) {
1831 key_value = rules_str(rules, cur->key.value_off);
1843 return match_key(rules, cur, value);
1857 struct token *cur;
1870 cur = &rules->tokens[0];
1871 rule = cur;
1873 dump_token(rules, cur);
1874 switch (cur->type) {
1877 rule = cur;
1884 if (match_key(rules, cur, udev_device_get_action(event->dev)) != 0)
1888 if (match_key(rules, cur, udev_device_get_devpath(event->dev)) != 0)
1892 if (match_key(rules, cur, udev_device_get_sysname(event->dev)) != 0)
1903 if (match_key(rules, cur, devlink) == 0) {
1913 if (match_key(rules, cur, event->name) != 0)
1917 const char *key_name = rules_str(rules, cur->key.attr_off);
1934 if (match_key(rules, cur, value))
1943 if (streq(rules_str(rules, cur->key.value_off), udev_list_entry_get_name(list_entry))) {
1948 if ((!match && (cur->key.op != OP_NOMATCH)) ||
1949 (match && (cur->key.op == OP_NOMATCH)))
1954 if (match_key(rules, cur, udev_device_get_subsystem(event->dev)) != 0)
1958 if (match_key(rules, cur, udev_device_get_driver(event->dev)) != 0)
1962 if (match_attr(rules, event->dev, event, cur) != 0)
1970 udev_event_apply_format(event, rules_str(rules, cur->key.attr_off), filename, sizeof(filename));
1978 if (match_key(rules, cur, value) != 0)
1990 next = cur;
2000 for (key = cur; key < next; key++ ) {
2020 bool match = udev_device_has_tag(event->dev_parent, rules_str(rules, cur->key.value_off));
2040 cur = next;
2048 udev_event_apply_format(event, rules_str(rules, cur->key.value_off), filename, sizeof(filename));
2061 if (match && cur->key.mode > 0)
2062 match = ((statbuf.st_mode & cur->key.mode) > 0);
2063 if (match && cur->key.op == OP_NOMATCH)
2065 if (!match && cur->key.op == OP_MATCH)
2074 udev_event_apply_format(event, rules_str(rules, cur->key.value_off), program, sizeof(program));
2081 if (cur->key.op != OP_NOMATCH)
2093 if (cur->key.op == OP_NOMATCH)
2101 udev_event_apply_format(event, rules_str(rules, cur->key.value_off), import, sizeof(import));
2103 if (cur->key.op != OP_NOMATCH)
2110 udev_event_apply_format(event, rules_str(rules, cur->key.value_off), import, sizeof(import));
2117 if (cur->key.op != OP_NOMATCH)
2124 if (udev_builtin_run_once(cur->key.builtin_cmd)) {
2126 if (event->builtin_run & (1 << cur->key.builtin_cmd)) {
2128 udev_builtin_name(cur->key.builtin_cmd),
2132 if (event->builtin_ret & (1 << cur->key.builtin_cmd))
2133 if (cur->key.op != OP_NOMATCH)
2138 event->builtin_run |= (1 << cur->key.builtin_cmd);
2141 udev_event_apply_format(event, rules_str(rules, cur->key.value_off), command, sizeof(command));
2143 udev_builtin_name(cur->key.builtin_cmd),
2147 if (udev_builtin_run(event->dev, cur->key.builtin_cmd, command, false) != 0) {
2150 udev_builtin_name(cur->key.builtin_cmd));
2151 event->builtin_ret |= (1 << cur->key.builtin_cmd);
2152 if (cur->key.op != OP_NOMATCH)
2158 const char *key = rules_str(rules, cur->key.value_off);
2165 if (cur->key.op != OP_NOMATCH)
2179 const char *key = rules_str(rules, cur->key.value_off);
2204 if (!imported && cur->key.op != OP_NOMATCH)
2211 udev_event_apply_format(event, rules_str(rules, cur->key.value_off), import, sizeof(import));
2213 if (cur->key.op != OP_NOMATCH)
2218 if (match_key(rules, cur, event->program_result) != 0)
2233 if (cur->key.op == OP_ASSIGN_FINAL)
2235 event->inotify_watch = cur->key.watch;
2238 udev_device_set_devlink_priority(event->dev, cur->key.devlink_prio);
2247 if (cur->key.op == OP_ASSIGN_FINAL)
2249 udev_event_apply_format(event, rules_str(rules, cur->key.value_off), owner, sizeof(owner));
2273 if (cur->key.op == OP_ASSIGN_FINAL)
2275 udev_event_apply_format(event, rules_str(rules, cur->key.value_off), group, sizeof(group));
2299 udev_event_apply_format(event, rules_str(rules, cur->key.value_off), mode_str, sizeof(mode_str));
2305 if (cur->key.op == OP_ASSIGN_FINAL)
2318 if (cur->key.op == OP_ASSIGN_FINAL)
2321 event->uid = cur->key.uid;
2330 if (cur->key.op == OP_ASSIGN_FINAL)
2333 event->gid = cur->key.gid;
2342 if (cur->key.op == OP_ASSIGN_FINAL)
2345 event->mode = cur->key.mode;
2354 name = rules_str(rules, cur->key.attr_off);
2355 label = rules_str(rules, cur->key.value_off);
2356 if (cur->key.op == OP_ASSIGN || cur->key.op == OP_ASSIGN_FINAL)
2366 const char *name = rules_str(rules, cur->key.attr_off);
2367 char *value = rules_str(rules, cur->key.value_off);
2372 if (cur->key.op == OP_ADD)
2378 if (cur->key.op == OP_ADD)
2396 udev_event_apply_format(event, rules_str(rules, cur->key.value_off), tag, sizeof(tag));
2397 if (cur->key.op == OP_ASSIGN || cur->key.op == OP_ASSIGN_FINAL)
2408 if (cur->key.op == OP_REMOVE)
2415 const char *name = rules_str(rules, cur->key.value_off);
2422 if (cur->key.op == OP_ASSIGN_FINAL)
2454 if (cur->key.op == OP_ASSIGN_FINAL)
2456 if (cur->key.op == OP_ASSIGN || cur->key.op == OP_ASSIGN_FINAL)
2460 udev_event_apply_format(event, rules_str(rules, cur->key.value_off), temp, sizeof(temp));
2491 const char *key_name = rules_str(rules, cur->key.attr_off);
2500 udev_event_apply_format(event, rules_str(rules, cur->key.value_off), value, sizeof(value));
2519 udev_event_apply_format(event, rules_str(rules, cur->key.attr_off), filename, sizeof(filename));
2521 udev_event_apply_format(event, rules_str(rules, cur->key.value_off), value, sizeof(value));
2533 if (cur->key.op == OP_ASSIGN || cur->key.op == OP_ASSIGN_FINAL)
2536 rules_str(rules, cur->key.value_off),
2539 entry = udev_list_entry_add(&event->run_list, rules_str(rules, cur->key.value_off), NULL);
2540 udev_list_entry_set_num(entry, cur->key.builtin_cmd);
2544 if (cur->key.rule_goto == 0)
2546 cur = &rules->tokens[cur->key.rule_goto];
2555 log_error("wrong type %u", cur->type);
2559 cur++;
2563 cur = rule + rule->rule.token_count;
2568 struct token *cur;
2582 cur = &rules->tokens[0];
2583 rule = cur;
2585 switch (cur->type) {
2588 rule = cur;
2600 uid = cur->key.uid;
2603 gid = cur->key.gid;
2606 mode = cur->key.mode;
2609 r = strv_extend(&tags, rules_str(rules, cur->key.value_off));
2625 strscpyl(device_node, sizeof(device_node), "/dev/", rules_str(rules, cur->key.value_off), NULL);
2641 unescaped_filename = xescape(rules_str(rules, cur->key.value_off), "/.");
2688 cur++;
2692 cur = rule + rule->rule.token_count;