2004-09-17 20:06:17 +00:00
|
|
|
#ifndef foodaemonconfhfoo
|
|
|
|
|
#define foodaemonconfhfoo
|
2004-09-13 23:28:30 +00:00
|
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
|
|
|
|
|
/***
|
2006-06-19 21:53:48 +00:00
|
|
|
This file is part of PulseAudio.
|
2004-09-13 23:28:30 +00:00
|
|
|
|
2007-02-13 15:35:19 +00:00
|
|
|
Copyright 2004-2006 Lennart Poettering
|
|
|
|
|
Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
|
|
|
|
|
2006-06-19 21:53:48 +00:00
|
|
|
PulseAudio is free software; you can redistribute it and/or modify
|
2004-11-14 14:58:54 +00:00
|
|
|
it under the terms of the GNU Lesser General Public License as published
|
2004-09-13 23:28:30 +00:00
|
|
|
by the Free Software Foundation; either version 2 of the License,
|
|
|
|
|
or (at your option) any later version.
|
|
|
|
|
|
2006-06-19 21:53:48 +00:00
|
|
|
PulseAudio is distributed in the hope that it will be useful, but
|
2004-09-13 23:28:30 +00:00
|
|
|
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.
|
|
|
|
|
|
2004-11-14 14:58:54 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public License
|
2006-06-19 21:53:48 +00:00
|
|
|
along with PulseAudio; if not, write to the Free Software
|
2004-09-13 23:28:30 +00:00
|
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
|
|
|
USA.
|
|
|
|
|
***/
|
|
|
|
|
|
2006-06-19 21:53:48 +00:00
|
|
|
#include <pulsecore/log.h>
|
2007-10-28 19:13:50 +00:00
|
|
|
#include <pulse/sample.h>
|
2004-09-13 23:28:30 +00:00
|
|
|
|
2006-07-20 01:25:37 +00:00
|
|
|
#ifdef HAVE_SYS_RESOURCE_H
|
|
|
|
|
#include <sys/resource.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
2004-11-21 21:31:28 +00:00
|
|
|
/* The actual command to execute */
|
2006-01-11 01:17:39 +00:00
|
|
|
typedef enum pa_daemon_conf_cmd {
|
2004-11-21 21:31:28 +00:00
|
|
|
PA_CMD_DAEMON, /* the default */
|
|
|
|
|
PA_CMD_HELP,
|
|
|
|
|
PA_CMD_VERSION,
|
|
|
|
|
PA_CMD_DUMP_CONF,
|
|
|
|
|
PA_CMD_DUMP_MODULES,
|
|
|
|
|
PA_CMD_KILL,
|
2007-10-28 19:13:50 +00:00
|
|
|
PA_CMD_CHECK,
|
|
|
|
|
PA_CMD_DUMP_RESAMPLE_METHODS,
|
|
|
|
|
PA_CMD_CLEANUP_SHM
|
2006-01-27 16:25:31 +00:00
|
|
|
} pa_daemon_conf_cmd_t;
|
2004-09-14 17:52:11 +00:00
|
|
|
|
2006-07-20 01:25:37 +00:00
|
|
|
#ifdef HAVE_SYS_RESOURCE_H
|
|
|
|
|
typedef struct pa_rlimit {
|
|
|
|
|
rlim_t value;
|
|
|
|
|
int is_set;
|
|
|
|
|
} pa_rlimit;
|
|
|
|
|
#endif
|
|
|
|
|
|
2006-06-19 22:11:49 +00:00
|
|
|
/* A structure containing configuration data for the PulseAudio server . */
|
2006-01-11 01:17:39 +00:00
|
|
|
typedef struct pa_daemon_conf {
|
2006-01-27 16:25:31 +00:00
|
|
|
pa_daemon_conf_cmd_t cmd;
|
2004-09-14 17:52:11 +00:00
|
|
|
int daemonize,
|
2004-09-13 23:28:30 +00:00
|
|
|
fail,
|
|
|
|
|
high_priority,
|
|
|
|
|
disallow_module_loading,
|
|
|
|
|
exit_idle_time,
|
|
|
|
|
module_idle_time,
|
2004-09-14 23:08:39 +00:00
|
|
|
scache_idle_time,
|
2004-11-20 23:48:18 +00:00
|
|
|
auto_log_target,
|
2006-07-19 17:44:19 +00:00
|
|
|
use_pid_file,
|
2006-07-25 20:51:15 +00:00
|
|
|
system_instance,
|
2006-08-19 01:20:13 +00:00
|
|
|
no_cpu_limit,
|
|
|
|
|
disable_shm;
|
2004-09-13 23:28:30 +00:00
|
|
|
char *script_commands, *dl_search_path, *default_script_file;
|
2006-01-27 16:25:31 +00:00
|
|
|
pa_log_target_t log_target;
|
|
|
|
|
pa_log_level_t log_level;
|
2004-09-17 19:45:44 +00:00
|
|
|
int resample_method;
|
2004-11-04 21:27:12 +00:00
|
|
|
char *config_file;
|
2007-01-04 13:43:45 +00:00
|
|
|
|
2006-07-20 01:25:37 +00:00
|
|
|
#ifdef HAVE_SYS_RESOURCE_H
|
|
|
|
|
pa_rlimit rlimit_as, rlimit_core, rlimit_data, rlimit_fsize, rlimit_nofile, rlimit_stack;
|
|
|
|
|
#ifdef RLIMIT_NPROC
|
|
|
|
|
pa_rlimit rlimit_nproc;
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef RLIMIT_MEMLOCK
|
|
|
|
|
pa_rlimit rlimit_memlock;
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
2007-01-04 13:43:45 +00:00
|
|
|
|
2007-10-28 19:13:50 +00:00
|
|
|
unsigned default_n_fragments, default_fragment_size_msec;
|
|
|
|
|
pa_sample_spec default_sample_spec;
|
2006-01-11 01:17:39 +00:00
|
|
|
} pa_daemon_conf;
|
2004-09-13 23:28:30 +00:00
|
|
|
|
2004-11-21 21:31:28 +00:00
|
|
|
/* Allocate a new structure and fill it with sane defaults */
|
2006-01-11 01:17:39 +00:00
|
|
|
pa_daemon_conf* pa_daemon_conf_new(void);
|
|
|
|
|
void pa_daemon_conf_free(pa_daemon_conf*c);
|
2004-09-13 23:28:30 +00:00
|
|
|
|
2004-11-21 21:31:28 +00:00
|
|
|
/* Load configuration data from the specified file overwriting the
|
|
|
|
|
* current settings in *c. If filename is NULL load the default daemon
|
|
|
|
|
* configuration file */
|
2006-01-11 01:17:39 +00:00
|
|
|
int pa_daemon_conf_load(pa_daemon_conf *c, const char *filename);
|
2004-11-21 21:31:28 +00:00
|
|
|
|
|
|
|
|
/* Pretty print the current configuration data of the daemon. The
|
|
|
|
|
* returned string has to be freed manually. The output of this
|
|
|
|
|
* function may be parsed with pa_daemon_conf_load(). */
|
2006-01-11 01:17:39 +00:00
|
|
|
char *pa_daemon_conf_dump(pa_daemon_conf *c);
|
2004-11-21 21:31:28 +00:00
|
|
|
|
|
|
|
|
/* Load the configuration data from the process' environment
|
|
|
|
|
* overwriting the current settings in *c. */
|
2006-01-11 01:17:39 +00:00
|
|
|
int pa_daemon_conf_env(pa_daemon_conf *c);
|
2004-09-13 23:28:30 +00:00
|
|
|
|
2004-11-21 21:31:28 +00:00
|
|
|
/* Set these configuration variables in the structure by passing a string */
|
2006-01-11 01:17:39 +00:00
|
|
|
int pa_daemon_conf_set_log_target(pa_daemon_conf *c, const char *string);
|
|
|
|
|
int pa_daemon_conf_set_log_level(pa_daemon_conf *c, const char *string);
|
|
|
|
|
int pa_daemon_conf_set_resample_method(pa_daemon_conf *c, const char *string);
|
2004-09-17 20:43:40 +00:00
|
|
|
|
2004-09-13 23:28:30 +00:00
|
|
|
#endif
|