diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2011-10-06 01:10:59 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2011-10-06 01:10:59 +0200 |
commit | 0bbe8838e75bf97792d61b33f8592a32f1fc8bd4 (patch) | |
tree | ed9c94996deef6d333599c022298828427b3d1cd /udev | |
parent | 289a1821a4a7636ce42a6c7adc3a9bb49421a5ea (diff) |
libudev: export udev_util_encode_string()
Diffstat (limited to 'udev')
-rw-r--r-- | udev/udev-builtin-usb_id.c | 28 | ||||
-rw-r--r-- | udev/udev-event.c | 2 | ||||
-rw-r--r-- | udev/udev-rules.c | 8 |
3 files changed, 19 insertions, 19 deletions
diff --git a/udev/udev-builtin-usb_id.c b/udev/udev-builtin-usb_id.c index 1585b107a0..587c21667b 100644 --- a/udev/udev-builtin-usb_id.c +++ b/udev/udev-builtin-usb_id.c @@ -350,8 +350,8 @@ static int builtin_usb_id(struct udev_device *dev, bool test) goto fallback; } udev_util_encode_string(scsi_vendor, vendor_str_enc, sizeof(vendor_str_enc)); - udev_util_replace_whitespace(scsi_vendor, vendor_str, sizeof(vendor_str)-1); - udev_util_replace_chars(vendor_str, NULL); + util_replace_whitespace(scsi_vendor, vendor_str, sizeof(vendor_str)-1); + util_replace_chars(vendor_str, NULL); scsi_model = udev_device_get_sysattr_value(dev_scsi, "model"); if (!scsi_model) { @@ -360,8 +360,8 @@ static int builtin_usb_id(struct udev_device *dev, bool test) goto fallback; } udev_util_encode_string(scsi_model, model_str_enc, sizeof(model_str_enc)); - udev_util_replace_whitespace(scsi_model, model_str, sizeof(model_str)-1); - udev_util_replace_chars(model_str, NULL); + util_replace_whitespace(scsi_model, model_str, sizeof(model_str)-1); + util_replace_chars(model_str, NULL); scsi_type = udev_device_get_sysattr_value(dev_scsi, "type"); if (!scsi_type) { @@ -377,8 +377,8 @@ static int builtin_usb_id(struct udev_device *dev, bool test) udev_device_get_sysname(dev_scsi)); goto fallback; } - udev_util_replace_whitespace(scsi_rev, revision_str, sizeof(revision_str)-1); - udev_util_replace_chars(revision_str, NULL); + util_replace_whitespace(scsi_rev, revision_str, sizeof(revision_str)-1); + util_replace_chars(revision_str, NULL); /* * some broken devices have the same identifiers @@ -403,8 +403,8 @@ fallback: return EXIT_FAILURE; } udev_util_encode_string(usb_vendor, vendor_str_enc, sizeof(vendor_str_enc)); - udev_util_replace_whitespace(usb_vendor, vendor_str, sizeof(vendor_str)-1); - udev_util_replace_chars(vendor_str, NULL); + util_replace_whitespace(usb_vendor, vendor_str, sizeof(vendor_str)-1); + util_replace_chars(vendor_str, NULL); } if (model_str[0] == '\0') { @@ -418,8 +418,8 @@ fallback: return EXIT_FAILURE; } udev_util_encode_string(usb_model, model_str_enc, sizeof(model_str_enc)); - udev_util_replace_whitespace(usb_model, model_str, sizeof(model_str)-1); - udev_util_replace_chars(model_str, NULL); + util_replace_whitespace(usb_model, model_str, sizeof(model_str)-1); + util_replace_chars(model_str, NULL); } if (revision_str[0] == '\0') { @@ -427,8 +427,8 @@ fallback: usb_rev = udev_device_get_sysattr_value(dev_usb, "bcdDevice"); if (usb_rev) { - udev_util_replace_whitespace(usb_rev, revision_str, sizeof(revision_str)-1); - udev_util_replace_chars(revision_str, NULL); + util_replace_whitespace(usb_rev, revision_str, sizeof(revision_str)-1); + util_replace_chars(revision_str, NULL); } } @@ -437,8 +437,8 @@ fallback: usb_serial = udev_device_get_sysattr_value(dev_usb, "serial"); if (usb_serial) { - udev_util_replace_whitespace(usb_serial, serial_str, sizeof(serial_str)-1); - udev_util_replace_chars(serial_str, NULL); + util_replace_whitespace(usb_serial, serial_str, sizeof(serial_str)-1); + util_replace_chars(serial_str, NULL); } } diff --git a/udev/udev-event.c b/udev/udev-event.c index 3c1a3e7aa7..7db7513247 100644 --- a/udev/udev-event.c +++ b/udev/udev-event.c @@ -318,7 +318,7 @@ subst: len = strlen(vbuf); while (len > 0 && isspace(vbuf[--len])) vbuf[len] = '\0'; - count = udev_util_replace_chars(vbuf, UDEV_ALLOWED_CHARS_INPUT); + count = util_replace_chars(vbuf, UDEV_ALLOWED_CHARS_INPUT); if (count > 0) info(event->udev, "%i character(s) replaced\n" , count); l = util_strpcpy(&s, l, vbuf); diff --git a/udev/udev-rules.c b/udev/udev-rules.c index 84033243c2..75636d9bd6 100644 --- a/udev/udev-rules.c +++ b/udev/udev-rules.c @@ -2271,7 +2271,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event util_remove_trailing_chars(result, '\n'); if (esc == ESCAPE_UNSET || esc == ESCAPE_REPLACE) { - count = udev_util_replace_chars(result, UDEV_ALLOWED_CHARS_INPUT); + count = util_replace_chars(result, UDEV_ALLOWED_CHARS_INPUT); if (count > 0) info(event->udev, "%i character(s) replaced\n" , count); } @@ -2562,7 +2562,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event event->name_final = true; udev_event_apply_format(event, name, name_str, sizeof(name_str)); if (esc == ESCAPE_UNSET || esc == ESCAPE_REPLACE) { - count = udev_util_replace_chars(name_str, "/"); + count = util_replace_chars(name_str, "/"); if (count > 0) info(event->udev, "%i character(s) replaced\n", count); } @@ -2592,9 +2592,9 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event /* allow multiple symlinks separated by spaces */ udev_event_apply_format(event, &rules->buf[cur->key.value_off], temp, sizeof(temp)); if (esc == ESCAPE_UNSET) - count = udev_util_replace_chars(temp, "/ "); + count = util_replace_chars(temp, "/ "); else if (esc == ESCAPE_REPLACE) - count = udev_util_replace_chars(temp, "/"); + count = util_replace_chars(temp, "/"); if (count > 0) info(event->udev, "%i character(s) replaced\n" , count); dbg(event->udev, "rule applied, added symlink(s) '%s'\n", temp); |