Lines Matching refs:value

108                 _cleanup_free_ char *key = NULL, *value = NULL, *old_key = NULL, *old_value = NULL;
119 value = strdup(_value);
120 if (!value)
125 r = ordered_hashmap_replace(*properties, key, value);
130 value = NULL;
133 _cleanup_free_ char *value = NULL;
135 value = ordered_hashmap_remove2(*properties, _key, (void**) &key);
146 int device_add_property_internal(sd_device *device, const char *key, const char *value) {
147 return device_add_property_aux(device, key, value, false);
457 static int handle_uevent_line(sd_device *device, const char *key, const char *value, const char **major, const char **minor) {
462 assert(value);
467 r = device_set_devtype(device, value);
471 r = device_set_ifindex(device, value);
475 r = device_set_devname(device, value);
479 r = device_set_devmode(device, value);
483 *major = value;
485 *minor = value;
487 r = device_add_property_internal(device, key, value);
497 const char *syspath, *key = NULL, *value = NULL, *major = NULL, *minor = NULL;
560 value = &uevent[i];
569 r = handle_uevent_line(device, key, value, &major, &minor);
571 log_debug_errno(r, "sd-device: failed to handle uevent entry '%s=%s': %m", key, value);
1097 char *value;
1106 value = strchr(key, '=');
1107 if (!value)
1110 *value = '\0';
1112 if (isempty(++value))
1113 value = NULL;
1115 return device_add_property_internal(device, key, value);
1138 static int handle_db_line(sd_device *device, char key, const char *value) {
1143 assert(value);
1147 r = device_add_tag(device, value);
1153 path = strjoina("/dev/", value);
1160 r = device_add_property_internal_from_string(device, value);
1166 r = device_set_usec_initialized(device, value);
1172 r = safe_atoi(value, &device->devlink_priority);
1178 r = safe_atoi(value, &device->watch_handle);
1256 const char *id, *value;
1315 value = &db[i];
1328 r = handle_db_line(device, key, value);
1330 log_debug_errno(r, "sd-device: failed to handle db entry '%c:%s': %m", key, value);
1502 const char *value;
1514 ordered_hashmap_iterate(device->properties, &device->properties_iterator, (void**)&value, (const void**)&key);
1517 *_value = value;
1524 const char *value;
1536 ordered_hashmap_iterate(device->properties, &device->properties_iterator, (void**)&value, (const void**)&key);
1539 *_value = value;
1635 char *value;
1646 value = ordered_hashmap_get(device->properties, key);
1647 if (!value)
1650 *_value = value;
1655 /* replaces the value if it already exists */
1656 static int device_add_sysattr_value(sd_device *device, const char *_key, char *value) {
1675 r = hashmap_put(device->sysattr_values, key, value);
1685 const char *key = NULL, *value;
1690 value = hashmap_get2(device->sysattr_values, _key, (void **) &key);
1695 *_value = value;
1701 * with a NULL value in the cache, otherwise the returned string is stored */
1703 _cleanup_free_ char *value = NULL;
1745 r = readlink_value(path, &value);
1759 /* read attribute value */
1760 r = read_full_file(path, &value, &size);
1765 while (size > 0 && value[--size] == '\n')
1766 value[size] = '\0';
1769 r = device_add_sysattr_value(device, sysattr, value);
1773 *_value = value;
1774 value = NULL;
1781 _cleanup_free_ char *value = NULL;
1786 value = hashmap_remove2(device->sysattr_values, _key, (void **) &key);
1791 /* set the attribute and save it in the cache. If a NULL value is passed the
1795 _cleanup_free_ char *value = NULL;
1819 value = strdup("");
1820 if (!value)
1823 r = device_add_sysattr_value(device, sysattr, value);
1847 /* value length is limited to 4k */
1855 value = strdup(_value);
1856 if (!value)
1859 size = write(fd, value, value_len);
1866 r = device_add_sysattr_value(device, sysattr, value);
1870 value = NULL;