/* $Id$ */
/***
- This file is part of polypaudio.
+ This file is part of PulseAudio.
- polypaudio is free software; you can redistribute it and/or modify
+ PulseAudio is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
- polypaudio is distributed in the hope that it will be useful, but
+ PulseAudio is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
- along with polypaudio; if not, write to the Free Software
+ along with PulseAudio; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA.
***/
#include <assert.h>
#include <unistd.h>
-#include <polyp/error.h>
-#include <polyp/xmalloc.h>
+#include <pulse/xmalloc.h>
-#include <polypcore/core-util.h>
-#include <polypcore/strbuf.h>
-#include <polypcore/conf-parser.h>
-#include <polypcore/resampler.h>
+#include <pulsecore/core-error.h>
+#include <pulsecore/core-util.h>
+#include <pulsecore/strbuf.h>
+#include <pulsecore/conf-parser.h>
+#include <pulsecore/resampler.h>
#include "daemon-conf.h"
-#ifndef DEFAULT_CONFIG_DIR
-# ifndef OS_IS_WIN32
-# define DEFAULT_CONFIG_DIR "/etc/polypaudio"
-# else
-# define DEFAULT_CONFIG_DIR "%POLYP_ROOT%"
-# endif
-#endif
-
#ifndef OS_IS_WIN32
# define PATH_SEP "/"
#else
# define PATH_SEP "\\"
#endif
-#define DEFAULT_SCRIPT_FILE DEFAULT_CONFIG_DIR PATH_SEP "default.pa"
-#define DEFAULT_SCRIPT_FILE_USER ".polypaudio" PATH_SEP "default.pa"
-#define DEFAULT_CONFIG_FILE DEFAULT_CONFIG_DIR PATH_SEP "daemon.conf"
-#define DEFAULT_CONFIG_FILE_USER ".polypaudio" PATH_SEP "daemon.conf"
+#define DEFAULT_SCRIPT_FILE PA_DEFAULT_CONFIG_DIR PATH_SEP "default.pa"
+#define DEFAULT_SCRIPT_FILE_USER PATH_SEP "default.pa"
+#define DEFAULT_CONFIG_FILE PA_DEFAULT_CONFIG_DIR PATH_SEP "daemon.conf"
+#define DEFAULT_CONFIG_FILE_USER PATH_SEP "daemon.conf"
-#define ENV_SCRIPT_FILE "POLYP_SCRIPT"
-#define ENV_CONFIG_FILE "POLYP_CONFIG"
-#define ENV_DL_SEARCH_PATH "POLYP_DLPATH"
+#define ENV_SCRIPT_FILE "PULSE_SCRIPT"
+#define ENV_CONFIG_FILE "PULSE_CONFIG"
+#define ENV_DL_SEARCH_PATH "PULSE_DLPATH"
static const pa_daemon_conf default_conf = {
.cmd = PA_CMD_DAEMON,
.log_level = PA_LOG_NOTICE,
.resample_method = PA_RESAMPLER_SRC_SINC_FASTEST,
.config_file = NULL,
- .use_pid_file = 1
+ .use_pid_file = 1,
+ .system_instance = 0
};
pa_daemon_conf* pa_daemon_conf_new(void) {
if ((f = pa_open_config_file(DEFAULT_SCRIPT_FILE, DEFAULT_SCRIPT_FILE_USER, ENV_SCRIPT_FILE, &c->default_script_file, "r")))
fclose(f);
-#ifdef DLSEARCHPATH
- c->dl_search_path = pa_xstrdup(DLSEARCHPATH);
-#endif
+ c->dl_search_path = pa_xstrdup(PA_DLSEARCHPATH);
return c;
}
{ "verbose", parse_log_level, NULL },
{ "resample-method", parse_resample_method, NULL },
{ "use-pid-file", pa_config_parse_bool, NULL },
+ { "system-instance", pa_config_parse_bool, NULL },
{ NULL, NULL, NULL },
};
table[11].data = c;
table[12].data = c;
table[13].data = &c->use_pid_file;
+ table[14].data = &c->system_instance;
pa_xfree(c->config_file);
c->config_file = NULL;
pa_open_config_file(DEFAULT_CONFIG_FILE, DEFAULT_CONFIG_FILE_USER, ENV_CONFIG_FILE, &c->config_file, "r");
if (!f && errno != ENOENT) {
- pa_log(__FILE__": WARNING: failed to open configuration file '%s': %s", filename, pa_cstrerror(errno));
+ pa_log(__FILE__": WARNING: failed to open configuration file '%s': %s", c->config_file, pa_cstrerror(errno));
goto finish;
}
pa_strbuf_printf(s, "log-level = %s\n", log_level_to_string[c->log_level]);
pa_strbuf_printf(s, "resample-method = %s\n", pa_resample_method_to_string(c->resample_method));
pa_strbuf_printf(s, "use-pid-file = %i\n", c->use_pid_file);
+ pa_strbuf_printf(s, "system-instance = %i\n", !!c->system_instance);
return pa_strbuf_tostring_free(s);
}