*p = '\0';
p = strrchr(toplevel, PA_PATH_SEP_CHAR);
- if (p && (strcmp(p + 1, "bin") == 0))
+ if (p && pa_streq(p + 1, "bin"))
*p = '\0';
}
pa_assert(v);
/* First we check language independent */
- if (!strcmp(v, "1") || v[0] == 'y' || v[0] == 'Y' || v[0] == 't' || v[0] == 'T' || !strcasecmp(v, "on"))
+ if (pa_streq(v, "1") || v[0] == 'y' || v[0] == 'Y' || v[0] == 't' || v[0] == 'T' || !strcasecmp(v, "on"))
return 1;
- else if (!strcmp(v, "0") || v[0] == 'n' || v[0] == 'N' || v[0] == 'f' || v[0] == 'F' || !strcasecmp(v, "off"))
+ else if (pa_streq(v, "0") || v[0] == 'n' || v[0] == 'N' || v[0] == 'f' || v[0] == 'F' || !strcasecmp(v, "off"))
return 0;
#ifdef HAVE_LANGINFO_H
goto finish;
}
- r = strcmp(name, group->gr_name) == 0;
+ r = pa_streq(name, group->gr_name);
finish:
pa_getgrgid_free(group);
l1 = strlen(s);
l2 = strlen(sfx);
- return l1 >= l2 && strcmp(s+l1-l2, sfx) == 0;
+ return l1 >= l2 && pa_streq(s + l1 - l2, sfx);
}
pa_bool_t pa_is_path_absolute(const char *fn) {
char *current;
while ((current = pa_split_spaces(line, &state))) {
- if (!strcmp(current, "vfp"))
+ if (pa_streq(current, "vfp"))
*flags |= PA_CPU_ARM_VFP;
- else if (!strcmp(current, "edsp"))
+ else if (pa_streq(current, "edsp"))
*flags |= PA_CPU_ARM_EDSP;
- else if (!strcmp(current, "neon"))
+ else if (pa_streq(current, "neon"))
*flags |= PA_CPU_ARM_NEON;
- else if (!strcmp(current, "vfpv3"))
+ else if (pa_streq(current, "vfpv3"))
*flags |= PA_CPU_ARM_VFPV3;
pa_xfree(current);
if (valid_keys) {
const char*const* v;
for (v = valid_keys; *v; v++)
- if (strcmp(*v, key) == 0)
+ if (pa_streq(*v, key))
break;
if (!*v) {
/* OK, the module only wants to be loaded once, let's make sure it is */
PA_IDXSET_FOREACH(i, c->modules, idx) {
- if (strcmp(name, i->name) == 0) {
+ if (pa_streq(name, i->name)) {
pa_log("Module \"%s\" should be loaded once at most. Refusing to load.", name);
goto fail;
}
#include <pulsecore/macro.h>
#include <pulsecore/strbuf.h>
#include <pulsecore/remap.h>
-
+#include <pulsecore/core-util.h>
#include "ffmpeg/avcodec.h"
#include "resampler.h"
pa_assert(string);
for (m = 0; m < PA_RESAMPLER_MAX; m++)
- if (!strcmp(string, resample_methods[m]))
+ if (pa_streq(string, resample_methods[m]))
return m;
- if (!strcmp(string, "speex-fixed"))
+ if (pa_streq(string, "speex-fixed"))
return PA_RESAMPLER_SPEEX_FIXED_BASE + 3;
- if (!strcmp(string, "speex-float"))
+ if (pa_streq(string, "speex-float"))
return PA_RESAMPLER_SPEEX_FLOAT_BASE + 3;
return PA_RESAMPLER_INVALID;
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/syscall.h>
+#include <pulsecore/core-util.h>
static pid_t _gettid(void) {
return (pid_t) syscall(SYS_gettid);
}
static int translate_error(const char *name) {
- if (strcmp(name, DBUS_ERROR_NO_MEMORY) == 0)
+ if (pa_streq(name, DBUS_ERROR_NO_MEMORY))
return -ENOMEM;
- if (strcmp(name, DBUS_ERROR_SERVICE_UNKNOWN) == 0 ||
- strcmp(name, DBUS_ERROR_NAME_HAS_NO_OWNER) == 0)
+ if (pa_streq(name, DBUS_ERROR_SERVICE_UNKNOWN) ||
+ pa_streq(name, DBUS_ERROR_NAME_HAS_NO_OWNER))
return -ENOENT;
- if (strcmp(name, DBUS_ERROR_ACCESS_DENIED) == 0 ||
- strcmp(name, DBUS_ERROR_AUTH_FAILED) == 0)
+ if (pa_streq(name, DBUS_ERROR_ACCESS_DENIED) ||
+ pa_streq(name, DBUS_ERROR_AUTH_FAILED))
return -EACCES;
return -EIO;
old = pa_proplist_gets(o->proplist, PA_PROP_MEDIA_NAME);
- if (old && name && !strcmp(old, name))
+ if (old && name && pa_streq(old, name))
return;
if (name)
pa_assert(s);
while (l) {
- if (!strcmp(ITEM_TO_TEXT(l), s)) {
+ if (pa_streq(ITEM_TO_TEXT(l), s)) {
pa_strlist *n = l->next;
if (!prev) {