153a5a1b3Sopenharmony_ci#ifndef fooclientconfhfoo 253a5a1b3Sopenharmony_ci#define fooclientconfhfoo 353a5a1b3Sopenharmony_ci 453a5a1b3Sopenharmony_ci/*** 553a5a1b3Sopenharmony_ci This file is part of PulseAudio. 653a5a1b3Sopenharmony_ci 753a5a1b3Sopenharmony_ci Copyright 2004-2006 Lennart Poettering 853a5a1b3Sopenharmony_ci 953a5a1b3Sopenharmony_ci PulseAudio is free software; you can redistribute it and/or modify 1053a5a1b3Sopenharmony_ci it under the terms of the GNU Lesser General Public License as published 1153a5a1b3Sopenharmony_ci by the Free Software Foundation; either version 2.1 of the License, 1253a5a1b3Sopenharmony_ci or (at your option) any later version. 1353a5a1b3Sopenharmony_ci 1453a5a1b3Sopenharmony_ci PulseAudio is distributed in the hope that it will be useful, but 1553a5a1b3Sopenharmony_ci WITHOUT ANY WARRANTY; without even the implied warranty of 1653a5a1b3Sopenharmony_ci MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1753a5a1b3Sopenharmony_ci General Public License for more details. 1853a5a1b3Sopenharmony_ci 1953a5a1b3Sopenharmony_ci You should have received a copy of the GNU Lesser General Public License 2053a5a1b3Sopenharmony_ci along with PulseAudio; if not, see <http://www.gnu.org/licenses/>. 2153a5a1b3Sopenharmony_ci***/ 2253a5a1b3Sopenharmony_ci 2353a5a1b3Sopenharmony_ci#include <pulsecore/macro.h> 2453a5a1b3Sopenharmony_ci#include <pulsecore/native-common.h> 2553a5a1b3Sopenharmony_ci 2653a5a1b3Sopenharmony_ci/* A structure containing configuration data for PulseAudio clients. */ 2753a5a1b3Sopenharmony_ci 2853a5a1b3Sopenharmony_citypedef struct pa_client_conf { 2953a5a1b3Sopenharmony_ci char *daemon_binary; 3053a5a1b3Sopenharmony_ci char *extra_arguments; 3153a5a1b3Sopenharmony_ci char *default_sink; 3253a5a1b3Sopenharmony_ci char *default_source; 3353a5a1b3Sopenharmony_ci char *default_server; 3453a5a1b3Sopenharmony_ci char *default_dbus_server; 3553a5a1b3Sopenharmony_ci char *cookie_file_from_env; 3653a5a1b3Sopenharmony_ci uint8_t cookie_from_x11[PA_NATIVE_COOKIE_LENGTH]; 3753a5a1b3Sopenharmony_ci bool cookie_from_x11_valid; 3853a5a1b3Sopenharmony_ci char *cookie_file_from_application; 3953a5a1b3Sopenharmony_ci char *cookie_file_from_client_conf; 4053a5a1b3Sopenharmony_ci bool autospawn, disable_shm, disable_memfd, auto_connect_localhost, auto_connect_display; 4153a5a1b3Sopenharmony_ci size_t shm_size; 4253a5a1b3Sopenharmony_ci} pa_client_conf; 4353a5a1b3Sopenharmony_ci 4453a5a1b3Sopenharmony_ci/* Create a new configuration data object and reset it to defaults */ 4553a5a1b3Sopenharmony_cipa_client_conf *pa_client_conf_new(void); 4653a5a1b3Sopenharmony_civoid pa_client_conf_free(pa_client_conf *c); 4753a5a1b3Sopenharmony_ci 4853a5a1b3Sopenharmony_ci/* Load the configuration data from the client configuration file and 4953a5a1b3Sopenharmony_ci * optionally from X11 and/or environment variables, overwriting the current 5053a5a1b3Sopenharmony_ci * settings in *c. */ 5153a5a1b3Sopenharmony_civoid pa_client_conf_load(pa_client_conf *c, bool load_from_x11, bool load_from_env); 5253a5a1b3Sopenharmony_ci 5353a5a1b3Sopenharmony_ci/* Load the cookie from the cookie sources specified in the configuration, or 5453a5a1b3Sopenharmony_ci * if nothing is specified or none of the sources work, load the cookie from 5553a5a1b3Sopenharmony_ci * the default source. If the default source doesn't work either, this function 5653a5a1b3Sopenharmony_ci * returns a negative value and initializes the cookie to all-zeroes. */ 5753a5a1b3Sopenharmony_ciint pa_client_conf_load_cookie(pa_client_conf *c, uint8_t *cookie, size_t cookie_length); 5853a5a1b3Sopenharmony_ci 5953a5a1b3Sopenharmony_civoid pa_client_conf_set_cookie_file_from_application(pa_client_conf *c, const char *cookie_file); 6053a5a1b3Sopenharmony_ci 6153a5a1b3Sopenharmony_ci#endif 62