log.c log.h \
gcc-printf.h \
modinfo.c modinfo.h \
- conf.c conf.h \
+ daemon-conf.c daemon-conf.h \
dumpmodules.c dumpmodules.h \
conparser.h confparser.c
llist.h \
log.c log.h \
gcc-printf.h \
- config-client.c config-client.h \
+ client-conf.c client-conf.h \
confparser.c confparser.h
libpolyp_@PA_MAJORMINOR@_la_CFLAGS = $(AM_CFLAGS)
#include <assert.h>
#include <unistd.h>
-#include "config-client.h"
+#include "client-conf.h"
#include "xmalloc.h"
#include "log.h"
#include "confparser.h"
-#ifndef fooconfigclienthfoo
-#define fooconfigclienthfoo
+#ifndef fooclientconfhfoo
+#define fooclientconfhfoo
/* $Id$ */
" -n Don't load default script file\n", e);
}
-int pa_cmdline_parse(struct pa_conf *conf, int argc, char *const argv [], int *d) {
+int pa_cmdline_parse(struct pa_daemon_conf *conf, int argc, char *const argv [], int *d) {
struct pa_strbuf *buf = NULL;
int c;
assert(conf && argc && argv);
USA.
***/
-#include "conf.h"
+#include "daemon-conf.h"
-int pa_cmdline_parse(struct pa_conf*c, int argc, char *const argv [], int *d);
+int pa_cmdline_parse(struct pa_daemon_conf*c, int argc, char *const argv [], int *d);
void pa_cmdline_help(const char *argv0);
#include <unistd.h>
#include <samplerate.h>
-#include "conf.h"
+#include "daemon-conf.h"
#include "util.h"
#include "xmalloc.h"
#include "strbuf.h"
#define ENV_CONFIG_FILE "POLYP_CONFIG"
#define ENV_DL_SEARCH_PATH "POLYP_DLPATH"
-static const struct pa_conf default_conf = {
+static const struct pa_daemon_conf default_conf = {
.cmd = PA_CMD_DAEMON,
.daemonize = 0,
.fail = 1,
return pa_xstrdup(global);
}
-struct pa_conf* pa_conf_new(void) {
- struct pa_conf *c = pa_xmemdup(&default_conf, sizeof(default_conf));
+struct pa_daemon_conf* pa_daemon_conf_new(void) {
+ struct pa_daemon_conf *c = pa_xmemdup(&default_conf, sizeof(default_conf));
c->default_script_file = default_file(ENV_SCRIPT_FILE, DEFAULT_SCRIPT_FILE, DEFAULT_SCRIPT_FILE_USER);
#ifdef DLSEARCHPATH
c->dl_search_path = pa_xstrdup(DLSEARCHPATH);
return c;
}
-void pa_conf_free(struct pa_conf *c) {
+void pa_daemon_conf_free(struct pa_daemon_conf *c) {
assert(c);
pa_xfree(c->script_commands);
pa_xfree(c->dl_search_path);
}
int parse_log_target(const char *filename, unsigned line, const char *lvalue, const char *rvalue, void *data, void *userdata) {
- struct pa_conf *c = data;
+ struct pa_daemon_conf *c = data;
assert(filename && lvalue && rvalue && data);
if (!strcmp(rvalue, "auto"))
}
int parse_resample_method(const char *filename, unsigned line, const char *lvalue, const char *rvalue, void *data, void *userdata) {
- struct pa_conf *c = data;
+ struct pa_daemon_conf *c = data;
assert(filename && lvalue && rvalue && data);
if (!strcmp(rvalue, "sinc-best-quality"))
return 0;
}
-int pa_conf_load(struct pa_conf *c, const char *filename) {
+int pa_daemon_conf_load(struct pa_daemon_conf *c, const char *filename) {
char *def = NULL;
int r;
return r;
}
-int pa_conf_env(struct pa_conf *c) {
+int pa_daemon_conf_env(struct pa_daemon_conf *c) {
char *e;
if ((e = getenv(ENV_DL_SEARCH_PATH))) {
return 0;
}
-char *pa_conf_dump(struct pa_conf *c) {
+char *pa_daemon_conf_dump(struct pa_daemon_conf *c) {
struct pa_strbuf *s = pa_strbuf_new();
char *d;
-#ifndef fooconfhfoo
-#define fooconfhfoo
+#ifndef foodaemonconfhfoo
+#define foodaemonconfhfoo
/* $Id$ */
#include "log.h"
-enum pa_conf_cmd {
+enum pa_daemon_conf_cmd {
PA_CMD_DAEMON,
PA_CMD_HELP,
PA_CMD_VERSION,
PA_CMD_DUMP_MODULES
};
-struct pa_conf {
- enum pa_conf_cmd cmd;
+struct pa_daemon_conf {
+ enum pa_daemon_conf_cmd cmd;
int daemonize,
fail,
verbose,
int resample_method;
};
-struct pa_conf* pa_conf_new(void);
-void pa_conf_free(struct pa_conf*c);
+struct pa_daemon_conf* pa_daemon_conf_new(void);
+void pa_daemon_conf_free(struct pa_daemon_conf*c);
-int pa_conf_load(struct pa_conf *c, const char *filename);
-char *pa_conf_dump(struct pa_conf *c);
+int pa_daemon_conf_load(struct pa_daemon_conf *c, const char *filename);
+char *pa_daemon_conf_dump(struct pa_daemon_conf *c);
+int pa_daemon_conf_env(struct pa_daemon_conf *c);
#endif
static int callback(const char *path, lt_ptr data) {
const char *e;
- struct pa_conf *c = (data);
+ struct pa_daemon_conf *c = (data);
if ((e = (const char*) strrchr(path, '/')))
e++;
return 0;
}
-void pa_dump_modules(struct pa_conf *c, int argc, char * const argv[]) {
+void pa_dump_modules(struct pa_daemon_conf *c, int argc, char * const argv[]) {
if (argc > 0) {
int i;
for (i = 0; i < argc; i++)
USA.
***/
-#include "conf.h"
+#include "daemon-conf.h"
-void pa_dump_modules(struct pa_conf *c, int argc, char * const argv[]);
+void pa_dump_modules(struct pa_daemon_conf *c, int argc, char * const argv[]);
#endif
#include "xmalloc.h"
#include "cpulimit.h"
#include "log.h"
-#include "conf.h"
+#include "daemon-conf.h"
#include "dumpmodules.h"
static struct pa_mainloop *mainloop;
int main(int argc, char *argv[]) {
struct pa_core *c;
struct pa_strbuf *buf = NULL;
- struct pa_conf *conf;
+ struct pa_daemon_conf *conf;
char *s;
int r, retval = 1, d = 0;
int daemon_pipe[2] = { -1, -1 };
pa_log_set_ident("polypaudio");
- conf = pa_conf_new();
+ conf = pa_daemon_conf_new();
- if (pa_conf_load(conf, NULL) < 0)
+ if (pa_daemon_conf_load(conf, NULL) < 0)
goto finish;
+ if (pa_daemon_conf_env(conf) < 0)
+ goto finish;
+
if (pa_cmdline_parse(conf, argc, argv, &d) < 0) {
pa_log(__FILE__": failed to parse command line.\n");
goto finish;
goto finish;
case PA_CMD_DUMP_CONF: {
- char *s = pa_conf_dump(conf);
+ char *s = pa_daemon_conf_dump(conf);
fputs(s, stdout);
pa_xfree(s);
retval = 0;
finish:
if (conf)
- pa_conf_free(conf);
+ pa_daemon_conf_free(conf);
close_pipe(daemon_pipe);
#include "util.h"
#include "xmalloc.h"
#include "log.h"
-#include "config-client.h"
+#include "client-conf.h"
#define DEFAULT_SERVER "/tmp/polypaudio/native"
#include "polyplib-operation.h"
#include "llist.h"
#include "native-common.h"
-#include "config-client.h"
+#include "client-conf.h"
#define DEFAULT_TLENGTH (10240*8)
#define DEFAULT_MAXLENGTH ((DEFAULT_TLENGTH*3)/2)