]> code.delx.au - pulseaudio/blob - src/daemon/daemon-conf.h
add new "disable-shm" server config option
[pulseaudio] / src / daemon / daemon-conf.h
1 #ifndef foodaemonconfhfoo
2 #define foodaemonconfhfoo
3
4 /* $Id$ */
5
6 /***
7 This file is part of PulseAudio.
8
9 PulseAudio is free software; you can redistribute it and/or modify
10 it under the terms of the GNU Lesser General Public License as published
11 by the Free Software Foundation; either version 2 of the License,
12 or (at your option) any later version.
13
14 PulseAudio is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public License
20 along with PulseAudio; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22 USA.
23 ***/
24
25 #include <pulsecore/log.h>
26
27 #ifdef HAVE_SYS_RESOURCE_H
28 #include <sys/resource.h>
29 #endif
30
31 /* The actual command to execute */
32 typedef enum pa_daemon_conf_cmd {
33 PA_CMD_DAEMON, /* the default */
34 PA_CMD_HELP,
35 PA_CMD_VERSION,
36 PA_CMD_DUMP_CONF,
37 PA_CMD_DUMP_MODULES,
38 PA_CMD_KILL,
39 PA_CMD_CHECK
40 } pa_daemon_conf_cmd_t;
41
42 #ifdef HAVE_SYS_RESOURCE_H
43 typedef struct pa_rlimit {
44 rlim_t value;
45 int is_set;
46 } pa_rlimit;
47 #endif
48
49 /* A structure containing configuration data for the PulseAudio server . */
50 typedef struct pa_daemon_conf {
51 pa_daemon_conf_cmd_t cmd;
52 int daemonize,
53 fail,
54 high_priority,
55 disallow_module_loading,
56 exit_idle_time,
57 module_idle_time,
58 scache_idle_time,
59 auto_log_target,
60 use_pid_file,
61 system_instance,
62 no_cpu_limit,
63 disable_shm;
64 char *script_commands, *dl_search_path, *default_script_file;
65 pa_log_target_t log_target;
66 pa_log_level_t log_level;
67 int resample_method;
68 char *config_file;
69
70 #ifdef HAVE_SYS_RESOURCE_H
71 pa_rlimit rlimit_as, rlimit_core, rlimit_data, rlimit_fsize, rlimit_nofile, rlimit_stack;
72 #ifdef RLIMIT_NPROC
73 pa_rlimit rlimit_nproc;
74 #endif
75 #ifdef RLIMIT_MEMLOCK
76 pa_rlimit rlimit_memlock;
77 #endif
78 #endif
79
80 } pa_daemon_conf;
81
82 /* Allocate a new structure and fill it with sane defaults */
83 pa_daemon_conf* pa_daemon_conf_new(void);
84 void pa_daemon_conf_free(pa_daemon_conf*c);
85
86 /* Load configuration data from the specified file overwriting the
87 * current settings in *c. If filename is NULL load the default daemon
88 * configuration file */
89 int pa_daemon_conf_load(pa_daemon_conf *c, const char *filename);
90
91 /* Pretty print the current configuration data of the daemon. The
92 * returned string has to be freed manually. The output of this
93 * function may be parsed with pa_daemon_conf_load(). */
94 char *pa_daemon_conf_dump(pa_daemon_conf *c);
95
96 /* Load the configuration data from the process' environment
97 * overwriting the current settings in *c. */
98 int pa_daemon_conf_env(pa_daemon_conf *c);
99
100 /* Set these configuration variables in the structure by passing a string */
101 int pa_daemon_conf_set_log_target(pa_daemon_conf *c, const char *string);
102 int pa_daemon_conf_set_log_level(pa_daemon_conf *c, const char *string);
103 int pa_daemon_conf_set_resample_method(pa_daemon_conf *c, const char *string);
104
105 #endif