mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	rename some stuff
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@212 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
		
							parent
							
								
									24f3781507
								
							
						
					
					
						commit
						f077958747
					
				
					 12 changed files with 43 additions and 39 deletions
				
			
		| 
						 | 
					@ -157,7 +157,7 @@ polypaudio_SOURCES = idxset.c idxset.h \
 | 
				
			||||||
		log.c log.h \
 | 
							log.c log.h \
 | 
				
			||||||
		gcc-printf.h \
 | 
							gcc-printf.h \
 | 
				
			||||||
		modinfo.c modinfo.h \
 | 
							modinfo.c modinfo.h \
 | 
				
			||||||
		conf.c conf.h \
 | 
							daemon-conf.c daemon-conf.h \
 | 
				
			||||||
		dumpmodules.c dumpmodules.h \
 | 
							dumpmodules.c dumpmodules.h \
 | 
				
			||||||
		conparser.h confparser.c 
 | 
							conparser.h confparser.c 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -334,7 +334,7 @@ libpolyp_@PA_MAJORMINOR@_la_SOURCES = polyplib.h \
 | 
				
			||||||
		llist.h \
 | 
							llist.h \
 | 
				
			||||||
		log.c log.h \
 | 
							log.c log.h \
 | 
				
			||||||
		gcc-printf.h \
 | 
							gcc-printf.h \
 | 
				
			||||||
        config-client.c config-client.h \
 | 
					        client-conf.c client-conf.h \
 | 
				
			||||||
		confparser.c confparser.h
 | 
							confparser.c confparser.h
 | 
				
			||||||
 | 
					
 | 
				
			||||||
libpolyp_@PA_MAJORMINOR@_la_CFLAGS = $(AM_CFLAGS)
 | 
					libpolyp_@PA_MAJORMINOR@_la_CFLAGS = $(AM_CFLAGS)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -23,7 +23,7 @@
 | 
				
			||||||
#include <assert.h>
 | 
					#include <assert.h>
 | 
				
			||||||
#include <unistd.h>
 | 
					#include <unistd.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "config-client.h"
 | 
					#include "client-conf.h"
 | 
				
			||||||
#include "xmalloc.h"
 | 
					#include "xmalloc.h"
 | 
				
			||||||
#include "log.h"
 | 
					#include "log.h"
 | 
				
			||||||
#include "confparser.h"
 | 
					#include "confparser.h"
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
#ifndef fooconfigclienthfoo
 | 
					#ifndef fooclientconfhfoo
 | 
				
			||||||
#define fooconfigclienthfoo
 | 
					#define fooclientconfhfoo
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* $Id$ */
 | 
					/* $Id$ */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -107,7 +107,7 @@ void pa_cmdline_help(const char *argv0) {
 | 
				
			||||||
           "  -n                                    Don't load default script file\n", e);
 | 
					           "  -n                                    Don't load default script file\n", e);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int pa_cmdline_parse(struct pa_conf *conf, int argc, char *const argv [], int *d) {
 | 
					int pa_cmdline_parse(struct pa_daemon_conf *conf, int argc, char *const argv [], int *d) {
 | 
				
			||||||
    struct pa_strbuf *buf = NULL;
 | 
					    struct pa_strbuf *buf = NULL;
 | 
				
			||||||
    int c;
 | 
					    int c;
 | 
				
			||||||
    assert(conf && argc && argv);
 | 
					    assert(conf && argc && argv);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -22,9 +22,9 @@
 | 
				
			||||||
  USA.
 | 
					  USA.
 | 
				
			||||||
***/
 | 
					***/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "conf.h"
 | 
					#include "daemon-conf.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int pa_cmdline_parse(struct pa_conf*c, int argc, char *const argv [], int *d);
 | 
					int pa_cmdline_parse(struct pa_daemon_conf*c, int argc, char *const argv [], int *d);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void pa_cmdline_help(const char *argv0);
 | 
					void pa_cmdline_help(const char *argv0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -30,7 +30,7 @@
 | 
				
			||||||
#include <unistd.h>
 | 
					#include <unistd.h>
 | 
				
			||||||
#include <samplerate.h>
 | 
					#include <samplerate.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "conf.h"
 | 
					#include "daemon-conf.h"
 | 
				
			||||||
#include "util.h"
 | 
					#include "util.h"
 | 
				
			||||||
#include "xmalloc.h"
 | 
					#include "xmalloc.h"
 | 
				
			||||||
#include "strbuf.h"
 | 
					#include "strbuf.h"
 | 
				
			||||||
| 
						 | 
					@ -56,7 +56,7 @@
 | 
				
			||||||
#define ENV_CONFIG_FILE "POLYP_CONFIG"
 | 
					#define ENV_CONFIG_FILE "POLYP_CONFIG"
 | 
				
			||||||
#define ENV_DL_SEARCH_PATH "POLYP_DLPATH"
 | 
					#define ENV_DL_SEARCH_PATH "POLYP_DLPATH"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static const struct pa_conf default_conf = {
 | 
					static const struct pa_daemon_conf default_conf = {
 | 
				
			||||||
    .cmd = PA_CMD_DAEMON,
 | 
					    .cmd = PA_CMD_DAEMON,
 | 
				
			||||||
    .daemonize = 0,
 | 
					    .daemonize = 0,
 | 
				
			||||||
    .fail = 1,
 | 
					    .fail = 1,
 | 
				
			||||||
| 
						 | 
					@ -93,8 +93,8 @@ char* default_file(const char *envvar, const char *global, const char *local) {
 | 
				
			||||||
    return pa_xstrdup(global);
 | 
					    return pa_xstrdup(global);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct pa_conf* pa_conf_new(void) {
 | 
					struct pa_daemon_conf* pa_daemon_conf_new(void) {
 | 
				
			||||||
    struct pa_conf *c = pa_xmemdup(&default_conf, sizeof(default_conf));
 | 
					    struct pa_daemon_conf *c = pa_xmemdup(&default_conf, sizeof(default_conf));
 | 
				
			||||||
    c->default_script_file = default_file(ENV_SCRIPT_FILE, DEFAULT_SCRIPT_FILE, DEFAULT_SCRIPT_FILE_USER);
 | 
					    c->default_script_file = default_file(ENV_SCRIPT_FILE, DEFAULT_SCRIPT_FILE, DEFAULT_SCRIPT_FILE_USER);
 | 
				
			||||||
#ifdef DLSEARCHPATH
 | 
					#ifdef DLSEARCHPATH
 | 
				
			||||||
    c->dl_search_path = pa_xstrdup(DLSEARCHPATH);
 | 
					    c->dl_search_path = pa_xstrdup(DLSEARCHPATH);
 | 
				
			||||||
| 
						 | 
					@ -102,7 +102,7 @@ struct pa_conf* pa_conf_new(void) {
 | 
				
			||||||
    return c;
 | 
					    return c;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void pa_conf_free(struct pa_conf *c) {
 | 
					void pa_daemon_conf_free(struct pa_daemon_conf *c) {
 | 
				
			||||||
    assert(c);
 | 
					    assert(c);
 | 
				
			||||||
    pa_xfree(c->script_commands);
 | 
					    pa_xfree(c->script_commands);
 | 
				
			||||||
    pa_xfree(c->dl_search_path);
 | 
					    pa_xfree(c->dl_search_path);
 | 
				
			||||||
| 
						 | 
					@ -111,7 +111,7 @@ void pa_conf_free(struct pa_conf *c) {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int parse_log_target(const char *filename, unsigned line, const char *lvalue, const char *rvalue, void *data, void *userdata) {
 | 
					int parse_log_target(const char *filename, unsigned line, const char *lvalue, const char *rvalue, void *data, void *userdata) {
 | 
				
			||||||
    struct pa_conf *c = data;
 | 
					    struct pa_daemon_conf *c = data;
 | 
				
			||||||
    assert(filename && lvalue && rvalue && data);
 | 
					    assert(filename && lvalue && rvalue && data);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    if (!strcmp(rvalue, "auto"))
 | 
					    if (!strcmp(rvalue, "auto"))
 | 
				
			||||||
| 
						 | 
					@ -131,7 +131,7 @@ int parse_log_target(const char *filename, unsigned line, const char *lvalue, co
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int parse_resample_method(const char *filename, unsigned line, const char *lvalue, const char *rvalue, void *data, void *userdata) {
 | 
					int parse_resample_method(const char *filename, unsigned line, const char *lvalue, const char *rvalue, void *data, void *userdata) {
 | 
				
			||||||
    struct pa_conf *c = data;
 | 
					    struct pa_daemon_conf *c = data;
 | 
				
			||||||
    assert(filename && lvalue && rvalue && data);
 | 
					    assert(filename && lvalue && rvalue && data);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (!strcmp(rvalue, "sinc-best-quality"))
 | 
					    if (!strcmp(rvalue, "sinc-best-quality"))
 | 
				
			||||||
| 
						 | 
					@ -152,7 +152,7 @@ int parse_resample_method(const char *filename, unsigned line, const char *lvalu
 | 
				
			||||||
    return 0;
 | 
					    return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int pa_conf_load(struct pa_conf *c, const char *filename) {
 | 
					int pa_daemon_conf_load(struct pa_daemon_conf *c, const char *filename) {
 | 
				
			||||||
    char *def = NULL;
 | 
					    char *def = NULL;
 | 
				
			||||||
    int r;
 | 
					    int r;
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
| 
						 | 
					@ -180,7 +180,7 @@ int pa_conf_load(struct pa_conf *c, const char *filename) {
 | 
				
			||||||
    return r;
 | 
					    return r;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int pa_conf_env(struct pa_conf *c) {
 | 
					int pa_daemon_conf_env(struct pa_daemon_conf *c) {
 | 
				
			||||||
    char *e;
 | 
					    char *e;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if ((e = getenv(ENV_DL_SEARCH_PATH))) {
 | 
					    if ((e = getenv(ENV_DL_SEARCH_PATH))) {
 | 
				
			||||||
| 
						 | 
					@ -195,7 +195,7 @@ int pa_conf_env(struct pa_conf *c) {
 | 
				
			||||||
    return 0;
 | 
					    return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
char *pa_conf_dump(struct pa_conf *c) {
 | 
					char *pa_daemon_conf_dump(struct pa_daemon_conf *c) {
 | 
				
			||||||
    struct pa_strbuf *s = pa_strbuf_new();
 | 
					    struct pa_strbuf *s = pa_strbuf_new();
 | 
				
			||||||
    char *d;
 | 
					    char *d;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
#ifndef fooconfhfoo
 | 
					#ifndef foodaemonconfhfoo
 | 
				
			||||||
#define fooconfhfoo
 | 
					#define foodaemonconfhfoo
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* $Id$ */
 | 
					/* $Id$ */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -24,7 +24,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "log.h"
 | 
					#include "log.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum pa_conf_cmd {
 | 
					enum pa_daemon_conf_cmd {
 | 
				
			||||||
	PA_CMD_DAEMON,
 | 
						PA_CMD_DAEMON,
 | 
				
			||||||
	PA_CMD_HELP,
 | 
						PA_CMD_HELP,
 | 
				
			||||||
        PA_CMD_VERSION,
 | 
					        PA_CMD_VERSION,
 | 
				
			||||||
| 
						 | 
					@ -32,8 +32,8 @@ enum pa_conf_cmd {
 | 
				
			||||||
	PA_CMD_DUMP_MODULES
 | 
						PA_CMD_DUMP_MODULES
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct pa_conf {
 | 
					struct pa_daemon_conf {
 | 
				
			||||||
    enum pa_conf_cmd cmd;
 | 
					    enum pa_daemon_conf_cmd cmd;
 | 
				
			||||||
    int daemonize,
 | 
					    int daemonize,
 | 
				
			||||||
        fail,
 | 
					        fail,
 | 
				
			||||||
        verbose,
 | 
					        verbose,
 | 
				
			||||||
| 
						 | 
					@ -48,10 +48,11 @@ struct pa_conf {
 | 
				
			||||||
    int resample_method;
 | 
					    int resample_method;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct pa_conf* pa_conf_new(void);
 | 
					struct pa_daemon_conf* pa_daemon_conf_new(void);
 | 
				
			||||||
void pa_conf_free(struct pa_conf*c);
 | 
					void pa_daemon_conf_free(struct pa_daemon_conf*c);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int pa_conf_load(struct pa_conf *c, const char *filename);
 | 
					int pa_daemon_conf_load(struct pa_daemon_conf *c, const char *filename);
 | 
				
			||||||
char *pa_conf_dump(struct pa_conf *c);
 | 
					char *pa_daemon_conf_dump(struct pa_daemon_conf *c);
 | 
				
			||||||
 | 
					int pa_daemon_conf_env(struct pa_daemon_conf *c);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
| 
						 | 
					@ -78,7 +78,7 @@ static void show_info(const char *name, const char *path, void (*info)(const cha
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static int callback(const char *path, lt_ptr data) {
 | 
					static int callback(const char *path, lt_ptr data) {
 | 
				
			||||||
    const char *e;
 | 
					    const char *e;
 | 
				
			||||||
    struct pa_conf *c = (data);
 | 
					    struct pa_daemon_conf *c = (data);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if ((e = (const char*) strrchr(path, '/')))
 | 
					    if ((e = (const char*) strrchr(path, '/')))
 | 
				
			||||||
        e++;
 | 
					        e++;
 | 
				
			||||||
| 
						 | 
					@ -91,7 +91,7 @@ static int callback(const char *path, lt_ptr data) {
 | 
				
			||||||
    return 0;
 | 
					    return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void pa_dump_modules(struct pa_conf *c, int argc, char * const argv[]) {
 | 
					void pa_dump_modules(struct pa_daemon_conf *c, int argc, char * const argv[]) {
 | 
				
			||||||
    if (argc > 0) {
 | 
					    if (argc > 0) {
 | 
				
			||||||
        int i;
 | 
					        int i;
 | 
				
			||||||
        for (i = 0; i < argc; i++)
 | 
					        for (i = 0; i < argc; i++)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -22,8 +22,8 @@
 | 
				
			||||||
  USA.
 | 
					  USA.
 | 
				
			||||||
***/
 | 
					***/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "conf.h"
 | 
					#include "daemon-conf.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void pa_dump_modules(struct pa_conf *c, int argc, char * const argv[]);
 | 
					void pa_dump_modules(struct pa_daemon_conf *c, int argc, char * const argv[]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										15
									
								
								polyp/main.c
									
										
									
									
									
								
							
							
						
						
									
										15
									
								
								polyp/main.c
									
										
									
									
									
								
							| 
						 | 
					@ -45,7 +45,7 @@
 | 
				
			||||||
#include "xmalloc.h"
 | 
					#include "xmalloc.h"
 | 
				
			||||||
#include "cpulimit.h"
 | 
					#include "cpulimit.h"
 | 
				
			||||||
#include "log.h"
 | 
					#include "log.h"
 | 
				
			||||||
#include "conf.h"
 | 
					#include "daemon-conf.h"
 | 
				
			||||||
#include "dumpmodules.h"
 | 
					#include "dumpmodules.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static struct pa_mainloop *mainloop;
 | 
					static struct pa_mainloop *mainloop;
 | 
				
			||||||
| 
						 | 
					@ -90,7 +90,7 @@ static void close_pipe(int p[2]) {
 | 
				
			||||||
int main(int argc, char *argv[]) {
 | 
					int main(int argc, char *argv[]) {
 | 
				
			||||||
    struct pa_core *c;
 | 
					    struct pa_core *c;
 | 
				
			||||||
    struct pa_strbuf *buf = NULL;
 | 
					    struct pa_strbuf *buf = NULL;
 | 
				
			||||||
    struct pa_conf *conf;
 | 
					    struct pa_daemon_conf *conf;
 | 
				
			||||||
    char *s;
 | 
					    char *s;
 | 
				
			||||||
    int r, retval = 1, d = 0;
 | 
					    int r, retval = 1, d = 0;
 | 
				
			||||||
    int daemon_pipe[2] = { -1, -1 };
 | 
					    int daemon_pipe[2] = { -1, -1 };
 | 
				
			||||||
| 
						 | 
					@ -100,9 +100,12 @@ int main(int argc, char *argv[]) {
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    pa_log_set_ident("polypaudio");
 | 
					    pa_log_set_ident("polypaudio");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    conf = pa_conf_new();
 | 
					    conf = pa_daemon_conf_new();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (pa_conf_load(conf, NULL) < 0)
 | 
					    if (pa_daemon_conf_load(conf, NULL) < 0)
 | 
				
			||||||
 | 
					        goto finish;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (pa_daemon_conf_env(conf) < 0)
 | 
				
			||||||
        goto finish;
 | 
					        goto finish;
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    if (pa_cmdline_parse(conf, argc, argv, &d) < 0) {
 | 
					    if (pa_cmdline_parse(conf, argc, argv, &d) < 0) {
 | 
				
			||||||
| 
						 | 
					@ -127,7 +130,7 @@ int main(int argc, char *argv[]) {
 | 
				
			||||||
            goto finish;
 | 
					            goto finish;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        case PA_CMD_DUMP_CONF: {
 | 
					        case PA_CMD_DUMP_CONF: {
 | 
				
			||||||
            char *s = pa_conf_dump(conf);
 | 
					            char *s = pa_daemon_conf_dump(conf);
 | 
				
			||||||
            fputs(s, stdout);
 | 
					            fputs(s, stdout);
 | 
				
			||||||
            pa_xfree(s);
 | 
					            pa_xfree(s);
 | 
				
			||||||
            retval = 0;
 | 
					            retval = 0;
 | 
				
			||||||
| 
						 | 
					@ -261,7 +264,7 @@ int main(int argc, char *argv[]) {
 | 
				
			||||||
finish:
 | 
					finish:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (conf)
 | 
					    if (conf)
 | 
				
			||||||
        pa_conf_free(conf);
 | 
					        pa_daemon_conf_free(conf);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    close_pipe(daemon_pipe);
 | 
					    close_pipe(daemon_pipe);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -47,7 +47,7 @@
 | 
				
			||||||
#include "util.h"
 | 
					#include "util.h"
 | 
				
			||||||
#include "xmalloc.h"
 | 
					#include "xmalloc.h"
 | 
				
			||||||
#include "log.h"
 | 
					#include "log.h"
 | 
				
			||||||
#include "config-client.h"
 | 
					#include "client-conf.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define DEFAULT_SERVER "/tmp/polypaudio/native"
 | 
					#define DEFAULT_SERVER "/tmp/polypaudio/native"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -33,7 +33,7 @@
 | 
				
			||||||
#include "polyplib-operation.h"
 | 
					#include "polyplib-operation.h"
 | 
				
			||||||
#include "llist.h"
 | 
					#include "llist.h"
 | 
				
			||||||
#include "native-common.h"
 | 
					#include "native-common.h"
 | 
				
			||||||
#include "config-client.h"
 | 
					#include "client-conf.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define DEFAULT_TLENGTH (10240*8)
 | 
					#define DEFAULT_TLENGTH (10240*8)
 | 
				
			||||||
#define DEFAULT_MAXLENGTH ((DEFAULT_TLENGTH*3)/2)
 | 
					#define DEFAULT_MAXLENGTH ((DEFAULT_TLENGTH*3)/2)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue