rename some stuff

git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@212 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Lennart Poettering 2004-09-17 20:06:17 +00:00
parent 24f3781507
commit f077958747
12 changed files with 43 additions and 39 deletions

View file

@ -157,7 +157,7 @@ polypaudio_SOURCES = idxset.c idxset.h \
log.c log.h \
gcc-printf.h \
modinfo.c modinfo.h \
conf.c conf.h \
daemon-conf.c daemon-conf.h \
dumpmodules.c dumpmodules.h \
conparser.h confparser.c
@ -334,7 +334,7 @@ libpolyp_@PA_MAJORMINOR@_la_SOURCES = polyplib.h \
llist.h \
log.c log.h \
gcc-printf.h \
config-client.c config-client.h \
client-conf.c client-conf.h \
confparser.c confparser.h
libpolyp_@PA_MAJORMINOR@_la_CFLAGS = $(AM_CFLAGS)

View file

@ -23,7 +23,7 @@
#include <assert.h>
#include <unistd.h>
#include "config-client.h"
#include "client-conf.h"
#include "xmalloc.h"
#include "log.h"
#include "confparser.h"

View file

@ -1,5 +1,5 @@
#ifndef fooconfigclienthfoo
#define fooconfigclienthfoo
#ifndef fooclientconfhfoo
#define fooclientconfhfoo
/* $Id$ */

View file

@ -107,7 +107,7 @@ void pa_cmdline_help(const char *argv0) {
" -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;
int c;
assert(conf && argc && argv);

View file

@ -22,9 +22,9 @@
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);

View file

@ -30,7 +30,7 @@
#include <unistd.h>
#include <samplerate.h>
#include "conf.h"
#include "daemon-conf.h"
#include "util.h"
#include "xmalloc.h"
#include "strbuf.h"
@ -56,7 +56,7 @@
#define ENV_CONFIG_FILE "POLYP_CONFIG"
#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,
.daemonize = 0,
.fail = 1,
@ -93,8 +93,8 @@ char* default_file(const char *envvar, const char *global, const char *local) {
return pa_xstrdup(global);
}
struct pa_conf* pa_conf_new(void) {
struct pa_conf *c = pa_xmemdup(&default_conf, sizeof(default_conf));
struct pa_daemon_conf* pa_daemon_conf_new(void) {
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);
#ifdef DLSEARCHPATH
c->dl_search_path = pa_xstrdup(DLSEARCHPATH);
@ -102,7 +102,7 @@ struct pa_conf* pa_conf_new(void) {
return c;
}
void pa_conf_free(struct pa_conf *c) {
void pa_daemon_conf_free(struct pa_daemon_conf *c) {
assert(c);
pa_xfree(c->script_commands);
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) {
struct pa_conf *c = data;
struct pa_daemon_conf *c = data;
assert(filename && lvalue && rvalue && data);
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) {
struct pa_conf *c = data;
struct pa_daemon_conf *c = data;
assert(filename && lvalue && rvalue && data);
if (!strcmp(rvalue, "sinc-best-quality"))
@ -152,7 +152,7 @@ int parse_resample_method(const char *filename, unsigned line, const char *lvalu
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;
int r;
@ -180,7 +180,7 @@ int pa_conf_load(struct pa_conf *c, const char *filename) {
return r;
}
int pa_conf_env(struct pa_conf *c) {
int pa_daemon_conf_env(struct pa_daemon_conf *c) {
char *e;
if ((e = getenv(ENV_DL_SEARCH_PATH))) {
@ -195,7 +195,7 @@ int pa_conf_env(struct pa_conf *c) {
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();
char *d;

View file

@ -1,5 +1,5 @@
#ifndef fooconfhfoo
#define fooconfhfoo
#ifndef foodaemonconfhfoo
#define foodaemonconfhfoo
/* $Id$ */
@ -24,7 +24,7 @@
#include "log.h"
enum pa_conf_cmd {
enum pa_daemon_conf_cmd {
PA_CMD_DAEMON,
PA_CMD_HELP,
PA_CMD_VERSION,
@ -32,8 +32,8 @@ enum pa_conf_cmd {
PA_CMD_DUMP_MODULES
};
struct pa_conf {
enum pa_conf_cmd cmd;
struct pa_daemon_conf {
enum pa_daemon_conf_cmd cmd;
int daemonize,
fail,
verbose,
@ -48,10 +48,11 @@ struct pa_conf {
int resample_method;
};
struct pa_conf* pa_conf_new(void);
void pa_conf_free(struct pa_conf*c);
struct pa_daemon_conf* pa_daemon_conf_new(void);
void pa_daemon_conf_free(struct pa_daemon_conf*c);
int pa_conf_load(struct pa_conf *c, const char *filename);
char *pa_conf_dump(struct pa_conf *c);
int pa_daemon_conf_load(struct pa_daemon_conf *c, const char *filename);
char *pa_daemon_conf_dump(struct pa_daemon_conf *c);
int pa_daemon_conf_env(struct pa_daemon_conf *c);
#endif

View file

@ -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) {
const char *e;
struct pa_conf *c = (data);
struct pa_daemon_conf *c = (data);
if ((e = (const char*) strrchr(path, '/')))
e++;
@ -91,7 +91,7 @@ static int callback(const char *path, lt_ptr data) {
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) {
int i;
for (i = 0; i < argc; i++)

View file

@ -22,8 +22,8 @@
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

View file

@ -45,7 +45,7 @@
#include "xmalloc.h"
#include "cpulimit.h"
#include "log.h"
#include "conf.h"
#include "daemon-conf.h"
#include "dumpmodules.h"
static struct pa_mainloop *mainloop;
@ -90,7 +90,7 @@ static void close_pipe(int p[2]) {
int main(int argc, char *argv[]) {
struct pa_core *c;
struct pa_strbuf *buf = NULL;
struct pa_conf *conf;
struct pa_daemon_conf *conf;
char *s;
int r, retval = 1, d = 0;
int daemon_pipe[2] = { -1, -1 };
@ -100,11 +100,14 @@ int main(int argc, char *argv[]) {
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;
if (pa_cmdline_parse(conf, argc, argv, &d) < 0) {
pa_log(__FILE__": failed to parse command line.\n");
goto finish;
@ -127,7 +130,7 @@ int main(int argc, char *argv[]) {
goto finish;
case PA_CMD_DUMP_CONF: {
char *s = pa_conf_dump(conf);
char *s = pa_daemon_conf_dump(conf);
fputs(s, stdout);
pa_xfree(s);
retval = 0;
@ -261,7 +264,7 @@ int main(int argc, char *argv[]) {
finish:
if (conf)
pa_conf_free(conf);
pa_daemon_conf_free(conf);
close_pipe(daemon_pipe);

View file

@ -47,7 +47,7 @@
#include "util.h"
#include "xmalloc.h"
#include "log.h"
#include "config-client.h"
#include "client-conf.h"
#define DEFAULT_SERVER "/tmp/polypaudio/native"

View file

@ -33,7 +33,7 @@
#include "polyplib-operation.h"
#include "llist.h"
#include "native-common.h"
#include "config-client.h"
#include "client-conf.h"
#define DEFAULT_TLENGTH (10240*8)
#define DEFAULT_MAXLENGTH ((DEFAULT_TLENGTH*3)/2)