mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
Finish the Core dbus interface.
This commit is contained in:
parent
5c7952e4fa
commit
9347e90fed
14 changed files with 1526 additions and 1861 deletions
|
|
@ -2656,6 +2656,28 @@ char *pa_replace(const char*s, const char*a, const char *b) {
|
|||
return pa_strbuf_tostring_free(sb);
|
||||
}
|
||||
|
||||
char *pa_escape(const char *p, const char *chars) {
|
||||
const char *s;
|
||||
const char *c;
|
||||
pa_strbuf *buf = pa_strbuf_new();
|
||||
|
||||
for (s = p; *s; ++s) {
|
||||
if (*s == '\\')
|
||||
pa_strbuf_putc(buf, '\\');
|
||||
else if (chars) {
|
||||
for (c = chars; *c; ++c) {
|
||||
if (*s == *c) {
|
||||
pa_strbuf_putc(buf, '\\');
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
pa_strbuf_putc(buf, *s);
|
||||
}
|
||||
|
||||
return pa_strbuf_tostring_free(buf);
|
||||
}
|
||||
|
||||
char *pa_unescape(char *p) {
|
||||
char *s, *d;
|
||||
pa_bool_t escaped = FALSE;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue