new configuration subsystem

git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@198 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Lennart Poettering 2004-09-13 23:28:30 +00:00
parent fbefe67d52
commit 829656c5fc
23 changed files with 755 additions and 231 deletions

View file

@ -268,6 +268,22 @@ pa_usec_t pa_age(const struct timeval *tv) {
return pa_timeval_diff(&now, tv);
}
void pa_timeval_add(struct timeval *tv, pa_usec_t v) {
unsigned long secs;
assert(tv);
secs = (v/1000000);
tv->tv_sec += (unsigned long) secs;
v -= secs*1000000;
tv->tv_usec += v;
while (tv->tv_usec >= 1000000) {
tv->tv_sec++;
tv->tv_usec -= 1000000;
}
}
#define NICE_LEVEL (-15)
void pa_raise_priority(void) {
@ -347,3 +363,13 @@ char *pa_path_get_filename(const char *p) {
return (char*) p;
}
int pa_parse_boolean(const char *v) {
if (!strcmp(v, "1") || !strcasecmp(v, "yes") || !strcasecmp(v, "y") || !strcasecmp(v, "on"))
return 1;
else if (!strcmp(v, "0") || !strcasecmp(v, "no") || !strcasecmp(v, "n") || !strcasecmp(v, "off"))
return 0;
return -1;
}