+ if (strcasecmp(temp2, FIELD_BUS) == 0) {
+ strfieldcpy(dev.bus, temp3);
+ valid = 1;
+ continue;
+ }
+
+ if (strcasecmp(temp2, FIELD_ID) == 0) {
+ strfieldcpy(dev.id, temp3);
+ valid = 1;
+ continue;
+ }
+
+ if (strcasecmp(temp2, FIELD_PLACE) == 0) {
+ strfieldcpy(dev.place, temp3);
+ valid = 1;
+ continue;
+ }
+
+ if (strncasecmp(temp2, FIELD_SYSFS, sizeof(FIELD_SYSFS)-1) == 0) {
+ struct sysfs_pair *pair = &dev.sysfs_pair[0];
+ int sysfs_pair_num = 0;
+
+ /* find first unused pair */
+ while (pair->file[0] != '\0') {
+ ++sysfs_pair_num;
+ if (sysfs_pair_num >= MAX_SYSFS_PAIRS) {
+ pair = NULL;
+ break;
+ }
+ ++pair;
+ }
+ if (pair) {
+ attr = get_key_attribute(temp2 + sizeof(FIELD_SYSFS)-1);
+ if (attr == NULL) {
+ dbg("error parsing " FIELD_SYSFS " attribute");
+ continue;
+ }
+ strfieldcpy(pair->file, attr);
+ strfieldcpy(pair->value, temp3);
+ valid = 1;
+ }
+ continue;
+ }
+
+ if (strcasecmp(temp2, FIELD_KERNEL) == 0) {
+ strfieldcpy(dev.kernel, temp3);
+ valid = 1;
+ continue;
+ }
+
+ if (strcasecmp(temp2, FIELD_PROGRAM) == 0) {
+ program_given = 1;
+ strfieldcpy(dev.program, temp3);
+ valid = 1;
+ continue;
+ }
+
+ if (strcasecmp(temp2, FIELD_RESULT) == 0) {
+ strfieldcpy(dev.result, temp3);
+ valid = 1;
+ continue;
+ }
+
+ if (strncasecmp(temp2, FIELD_NAME, sizeof(FIELD_NAME)-1) == 0) {
+ attr = get_key_attribute(temp2 + sizeof(FIELD_NAME)-1);
+ if (attr != NULL && strcasecmp(attr, ATTR_PARTITIONS) == 0) {
+ dbg_parse("creation of partition nodes requested");
+ dev.partitions = PARTITIONS_COUNT;
+ }
+ strfieldcpy(dev.name, temp3);
+ valid = 1;
+ continue;
+ }
+
+ if (strcasecmp(temp2, FIELD_SYMLINK) == 0) {