1 #ifndef foodaemonconfhfoo
2 #define foodaemonconfhfoo
5 This file is part of PulseAudio.
7 Copyright 2004-2006 Lennart Poettering
8 Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
10 PulseAudio is free software; you can redistribute it and/or modify
11 it under the terms of the GNU Lesser General Public License as published
12 by the Free Software Foundation; either version 2.1 of the License,
13 or (at your option) any later version.
15 PulseAudio is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 General Public License for more details.
20 You should have received a copy of the GNU Lesser General Public License
21 along with PulseAudio; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
26 #include <pulse/sample.h>
27 #include <pulse/channelmap.h>
29 #include <pulsecore/log.h>
30 #include <pulsecore/macro.h>
31 #include <pulsecore/core.h>
32 #include <pulsecore/core-util.h>
34 #ifdef HAVE_SYS_RESOURCE_H
35 #include <sys/resource.h>
38 /* The actual command to execute */
39 typedef enum pa_daemon_conf_cmd
{
40 PA_CMD_DAEMON
, /* the default */
48 PA_CMD_DUMP_RESAMPLE_METHODS
,
50 } pa_daemon_conf_cmd_t
;
52 #ifdef HAVE_SYS_RESOURCE_H
53 typedef struct pa_rlimit
{
59 /* A structure containing configuration data for the PulseAudio server . */
60 typedef struct pa_daemon_conf
{
61 pa_daemon_conf_cmd_t cmd
;
66 disallow_module_loading
,
73 load_default_script_file
,
80 pa_server_type_t local_server_type
;
87 char *script_commands
, *dl_search_path
, *default_script_file
;
88 pa_log_target_t log_target
;
89 pa_log_level_t log_level
;
90 unsigned log_backtrace
;
93 #ifdef HAVE_SYS_RESOURCE_H
94 pa_rlimit rlimit_fsize
, rlimit_data
, rlimit_stack
, rlimit_core
;
99 pa_rlimit rlimit_nofile
;
105 pa_rlimit rlimit_nproc
;
107 #ifdef RLIMIT_MEMLOCK
108 pa_rlimit rlimit_memlock
;
111 pa_rlimit rlimit_locks
;
113 #ifdef RLIMIT_SIGPENDING
114 pa_rlimit rlimit_sigpending
;
116 #ifdef RLIMIT_MSGQUEUE
117 pa_rlimit rlimit_msgqueue
;
120 pa_rlimit rlimit_nice
;
123 pa_rlimit rlimit_rtprio
;
126 pa_rlimit rlimit_rttime
;
130 unsigned default_n_fragments
, default_fragment_size_msec
;
131 unsigned sync_volume_safety_margin_usec
;
132 int sync_volume_extra_delay_usec
;
133 pa_sample_spec default_sample_spec
;
134 pa_channel_map default_channel_map
;
138 /* Allocate a new structure and fill it with sane defaults */
139 pa_daemon_conf
* pa_daemon_conf_new(void);
140 void pa_daemon_conf_free(pa_daemon_conf
*c
);
142 /* Load configuration data from the specified file overwriting the
143 * current settings in *c. If filename is NULL load the default daemon
144 * configuration file */
145 int pa_daemon_conf_load(pa_daemon_conf
*c
, const char *filename
);
147 /* Pretty print the current configuration data of the daemon. The
148 * returned string has to be freed manually. The output of this
149 * function may be parsed with pa_daemon_conf_load(). */
150 char *pa_daemon_conf_dump(pa_daemon_conf
*c
);
152 /* Load the configuration data from the process' environment
153 * overwriting the current settings in *c. */
154 int pa_daemon_conf_env(pa_daemon_conf
*c
);
156 /* Set these configuration variables in the structure by passing a string */
157 int pa_daemon_conf_set_log_target(pa_daemon_conf
*c
, const char *string
);
158 int pa_daemon_conf_set_log_level(pa_daemon_conf
*c
, const char *string
);
159 int pa_daemon_conf_set_resample_method(pa_daemon_conf
*c
, const char *string
);
160 int pa_daemon_conf_set_local_server_type(pa_daemon_conf
*c
, const char *string
);
162 const char *pa_daemon_conf_get_default_script_file(pa_daemon_conf
*c
);
163 FILE *pa_daemon_conf_open_default_script_file(pa_daemon_conf
*c
);