don't rely on field order in namedev_parse
Hi,
here is a patch for the namedev-parser not to rely on the order of the fields given in the rule. The error handling now is relaxed, if a field is given twice, the last one wins. If a key is unknown we use it as a sysfs attribute.
It is not as efficient as the current version,
cause we need to loop over the list of known fields for every given field, but we are free to sort the fields in udev.rules.
What do you think?
thanks,
Kay
namedev.h +0 -5
@@ -44,11 +44,6 @@#define ID_SIZE 50#define PLACE_SIZE 50 -#define TYPE_LABEL "LABEL" -#define TYPE_NUMBER "NUMBER" -#define TYPE_TOPOLOGY "TOPOLOGY" -#define TYPE_REPLACE "REPLACE" -#define TYPE_CALLOUT "CALLOUT"#define CALLOUT_MAXARG 8struct config_device {
namedev_parse.c +111 -173
349 lines not on this page · raw message