1 #ifndef foodaemonconfhfoo
2 #define foodaemonconfhfoo
7 This file is part of PulseAudio.
9 Copyright 2004-2006 Lennart Poettering
10 Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
12 PulseAudio is free software; you can redistribute it and/or modify
13 it under the terms of the GNU Lesser General Public License as published
14 by the Free Software Foundation; either version 2 of the License,
15 or (at your option) any later version.
17 PulseAudio is distributed in the hope that it will be useful, but
18 WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 General Public License for more details.
22 You should have received a copy of the GNU Lesser General Public License
23 along with PulseAudio; if not, write to the Free Software
24 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
28 #include <pulsecore/log.h>
29 #include <pulsecore/macro.h>
30 #include <pulse/sample.h>
32 #ifdef HAVE_SYS_RESOURCE_H
33 #include <sys/resource.h>
36 /* The actual command to execute */
37 typedef enum pa_daemon_conf_cmd
{
38 PA_CMD_DAEMON
, /* the default */
45 PA_CMD_DUMP_RESAMPLE_METHODS
,
47 } pa_daemon_conf_cmd_t
;
49 #ifdef HAVE_SYS_RESOURCE_H
50 typedef struct pa_rlimit
{
56 /* A structure containing configuration data for the PulseAudio server . */
57 typedef struct pa_daemon_conf
{
58 pa_daemon_conf_cmd_t cmd
;
63 disallow_module_loading
,
75 char *script_commands
, *dl_search_path
, *default_script_file
;
76 pa_log_target_t log_target
;
77 pa_log_level_t log_level
;
80 #ifdef HAVE_SYS_RESOURCE_H
81 pa_rlimit rlimit_as
, rlimit_core
, rlimit_data
, rlimit_fsize
, rlimit_nofile
, rlimit_stack
;
83 pa_rlimit rlimit_nproc
;
86 pa_rlimit rlimit_memlock
;
89 pa_rlimit rlimit_nice
;
92 pa_rlimit rlimit_rtprio
;
96 unsigned default_n_fragments
, default_fragment_size_msec
;
97 pa_sample_spec default_sample_spec
;
100 /* Allocate a new structure and fill it with sane defaults */
101 pa_daemon_conf
* pa_daemon_conf_new(void);
102 void pa_daemon_conf_free(pa_daemon_conf
*c
);
104 /* Load configuration data from the specified file overwriting the
105 * current settings in *c. If filename is NULL load the default daemon
106 * configuration file */
107 int pa_daemon_conf_load(pa_daemon_conf
*c
, const char *filename
);
109 /* Pretty print the current configuration data of the daemon. The
110 * returned string has to be freed manually. The output of this
111 * function may be parsed with pa_daemon_conf_load(). */
112 char *pa_daemon_conf_dump(pa_daemon_conf
*c
);
114 /* Load the configuration data from the process' environment
115 * overwriting the current settings in *c. */
116 int pa_daemon_conf_env(pa_daemon_conf
*c
);
118 /* Set these configuration variables in the structure by passing a string */
119 int pa_daemon_conf_set_log_target(pa_daemon_conf
*c
, const char *string
);
120 int pa_daemon_conf_set_log_level(pa_daemon_conf
*c
, const char *string
);
121 int pa_daemon_conf_set_resample_method(pa_daemon_conf
*c
, const char *string
);