summaryrefslogtreecommitdiff
path: root/src/udev/udev-rules.c
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2015-02-11 15:44:15 -0500
committerAnthony G. Basile <blueness@gentoo.org>2015-02-11 15:44:15 -0500
commit691df3c5c399899a9fd6624f6148883cc20fa18a (patch)
treef15e27dc578e665f9d436da1b75de8f737f631b6 /src/udev/udev-rules.c
parentff78357e5505d52f025b2f2d04420a90bf2e7699 (diff)
rule_generator: remove legacy code
Diffstat (limited to 'src/udev/udev-rules.c')
-rw-r--r--src/udev/udev-rules.c64
1 files changed, 0 insertions, 64 deletions
diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c
index f51691143b..11cf21a4fb 100644
--- a/src/udev/udev-rules.c
+++ b/src/udev/udev-rules.c
@@ -1877,70 +1877,6 @@ enum escape_type {
ESCAPE_REPLACE,
};
-#ifdef ENABLE_RULE_GENERATOR
-/* function to return the count of rules that assign NAME= to a value matching arg#2 - returns 0,1 */
-int udev_rules_assigning_name_to(struct udev_rules *rules, const char *match_name) {
- struct token *cur;
- struct token *rule;
- enum escape_type esc = ESCAPE_UNSET;
- bool name_final = false;
-
- if (rules->tokens == NULL)
- return 0;
-
- /* loop through token list, match, run actions or forward to next rule */
- cur = &rules->tokens[0];
- rule = cur;
- for (;;) {
- dump_token(rules, cur);
- switch (cur->type) {
- case TK_RULE:
- /* current rule */
- rule = cur;
- if (!rule->rule.can_set_name)
- goto nomatch;
- break;
- case TK_M_SUBSYSTEM:
- if (match_key(rules, cur, "net") != 0)
- goto nomatch;
- break;
- case TK_M_ACTION:
- if (match_key(rules, cur, "add") != 0)
- goto nomatch;
- break;
- case TK_A_NAME: {
- const char *name = rules_str(rules, cur->key.value_off);
- char name_str[UTIL_PATH_SIZE];
- int count;
-
- strscpy(name_str,UTIL_PATH_SIZE,name);
- count = util_replace_chars(name_str, "/");
- if (count > 0)
- log_debug("%i character(s) replaced", count);
- if (streq(name_str,match_name)) {
- log_debug("found a match! NAME assigns %s in: %s:%u",
- name,
- rules_str(rules, rule->rule.filename_off),
- rule->rule.filename_line);
- return 1; /* no need to find more than one */
- }
-
- /* skip to next rule */
- goto nomatch;
- }
- case TK_END:
- return 0;
- }
-
- cur++;
- continue;
- nomatch:
- /* fast-forward to next rule */
- cur = rule + rule->rule.token_count;
- }
-}
-#endif
-
int udev_rules_apply_to_event(struct udev_rules *rules,
struct udev_event *event,
usec_t timeout_usec,