X-Git-Url: https://code.delx.au/pulseaudio/blobdiff_plain/0a583fe0c330d167f52784585afffdd8065a92cd..1116daa5ebe75073b6701e50ad80ac894d6e05f3:/src/pulse/client-conf.h diff --git a/src/pulse/client-conf.h b/src/pulse/client-conf.h index c6c74cad..cf424f55 100644 --- a/src/pulse/client-conf.h +++ b/src/pulse/client-conf.h @@ -28,10 +28,18 @@ /* A structure containing configuration data for PulseAudio clients. */ typedef struct pa_client_conf { - char *daemon_binary, *extra_arguments, *default_sink, *default_source, *default_server, *default_dbus_server, *cookie_file; + char *daemon_binary; + char *extra_arguments; + char *default_sink; + char *default_source; + char *default_server; + char *default_dbus_server; + char *cookie_file_from_env; + uint8_t cookie_from_x11[PA_NATIVE_COOKIE_LENGTH]; + bool cookie_from_x11_valid; + char *cookie_file_from_application; + char *cookie_file_from_client_conf; bool autospawn, disable_shm, auto_connect_localhost, auto_connect_display; - uint8_t cookie[PA_NATIVE_COOKIE_LENGTH]; - bool cookie_valid; /* non-zero, when cookie is valid */ size_t shm_size; } pa_client_conf; @@ -43,17 +51,16 @@ void pa_client_conf_free(pa_client_conf *c); * the current settings in *c. */ int pa_client_conf_load(pa_client_conf *c); +/* Load the cookie from the cookie sources specified in the configuration, or + * if nothing is specified or none of the sources work, load the cookie from + * the default source. If the default source doesn't work either, this function + * returns a negative value and initializes the cookie to all-zeroes. */ +int pa_client_conf_load_cookie(pa_client_conf *c, uint8_t *cookie, size_t cookie_length); + /* Load the configuration data from the environment of the current process, overwriting the current settings in *c. */ int pa_client_conf_env(pa_client_conf *c); -/* Load cookie data from cookie_file_path into c->cookie */ -int pa_client_conf_load_cookie_from_file(pa_client_conf *c, const char *cookie_file_path); - -/* Load cookie data from hexdecimal string into c->cookie */ -int pa_client_conf_load_cookie_from_hex(pa_client_conf *c, const char *cookie_in_hex); - -/* Set cookie direct from memory */ -int pa_client_conf_set_cookie(pa_client_conf *c, uint8_t *cookie, size_t cookie_size); +void pa_client_conf_set_cookie_file_from_application(pa_client_conf *c, const char *cookie_file); #endif