[pulseaudio-commits] r1801 - in /branches/lennart/src: daemon/daemon-conf.c pulse/client-conf.c pulse/util.c pulsecore/core-util.c pulsecore/macro.h
svnmailer-noreply at 0pointer.de
svnmailer-noreply at 0pointer.de
Mon Sep 10 18:00:34 PDT 2007
Author: lennart
Date: Tue Sep 11 03:00:33 2007
New Revision: 1801
URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=1801&root=pulseaudio&view=rev
Log:
add globally defined PA_PATH_SEP macro, replacing private per-file macros
Modified:
branches/lennart/src/daemon/daemon-conf.c
branches/lennart/src/pulse/client-conf.c
branches/lennart/src/pulse/util.c
branches/lennart/src/pulsecore/core-util.c
branches/lennart/src/pulsecore/macro.h
Modified: branches/lennart/src/daemon/daemon-conf.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/daemon/daemon-conf.c?rev=1801&root=pulseaudio&r1=1800&r2=1801&view=diff
==============================================================================
--- branches/lennart/src/daemon/daemon-conf.c (original)
+++ branches/lennart/src/daemon/daemon-conf.c Tue Sep 11 03:00:33 2007
@@ -42,16 +42,10 @@
#include "daemon-conf.h"
-#ifndef OS_IS_WIN32
-# define PATH_SEP "/"
-#else
-# define PATH_SEP "\\"
-#endif
-
-#define DEFAULT_SCRIPT_FILE PA_DEFAULT_CONFIG_DIR PATH_SEP "default.pa"
-#define DEFAULT_SCRIPT_FILE_USER PATH_SEP "default.pa"
-#define DEFAULT_CONFIG_FILE PA_DEFAULT_CONFIG_DIR PATH_SEP "daemon.conf"
-#define DEFAULT_CONFIG_FILE_USER PATH_SEP "daemon.conf"
+#define DEFAULT_SCRIPT_FILE PA_DEFAULT_CONFIG_DIR PA_PATH_SEP "default.pa"
+#define DEFAULT_SCRIPT_FILE_USER PA_PATH_SEP "default.pa"
+#define DEFAULT_CONFIG_FILE PA_DEFAULT_CONFIG_DIR PA_PATH_SEP "daemon.conf"
+#define DEFAULT_CONFIG_FILE_USER PA_PATH_SEP "daemon.conf"
#define ENV_SCRIPT_FILE "PULSE_SCRIPT"
#define ENV_CONFIG_FILE "PULSE_CONFIG"
Modified: branches/lennart/src/pulse/client-conf.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulse/client-conf.c?rev=1801&root=pulseaudio&r1=1800&r2=1801&view=diff
==============================================================================
--- branches/lennart/src/pulse/client-conf.c (original)
+++ branches/lennart/src/pulse/client-conf.c Tue Sep 11 03:00:33 2007
@@ -42,13 +42,7 @@
#include "client-conf.h"
-#ifndef OS_IS_WIN32
-# define PATH_SEP "/"
-#else
-# define PATH_SEP "\\"
-#endif
-
-#define DEFAULT_CLIENT_CONFIG_FILE PA_DEFAULT_CONFIG_DIR PATH_SEP "client.conf"
+#define DEFAULT_CLIENT_CONFIG_FILE PA_DEFAULT_CONFIG_DIR PA_PATH_SEP "client.conf"
#define DEFAULT_CLIENT_CONFIG_FILE_USER "client.conf"
#define ENV_CLIENT_CONFIG_FILE "PULSE_CLIENTCONFIG"
Modified: branches/lennart/src/pulse/util.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulse/util.c?rev=1801&root=pulseaudio&r1=1800&r2=1801&view=diff
==============================================================================
--- branches/lennart/src/pulse/util.c (original)
+++ branches/lennart/src/pulse/util.c Tue Sep 11 03:00:33 2007
@@ -64,12 +64,6 @@
#include "util.h"
-#ifndef OS_IS_WIN32
-#define PATH_SEP '/'
-#else
-#define PATH_SEP '\\'
-#endif
-
char *pa_get_user_name(char *s, size_t l) {
char *p;
char buf[1024];
@@ -217,7 +211,7 @@
pa_assert(p);
- if ((fn = strrchr(p, PATH_SEP)))
+ if ((fn = strrchr(p, PA_PATH_SEP_CHAR)))
return fn+1;
return (char*) p;
Modified: branches/lennart/src/pulsecore/core-util.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/core-util.c?rev=1801&root=pulseaudio&r1=1800&r2=1801&view=diff
==============================================================================
--- branches/lennart/src/pulsecore/core-util.c (original)
+++ branches/lennart/src/pulsecore/core-util.c Tue Sep 11 03:00:33 2007
@@ -100,10 +100,8 @@
#ifndef OS_IS_WIN32
#define PA_USER_RUNTIME_PATH_PREFIX "/tmp/pulse-"
-#define PATH_SEP '/'
#else
#define PA_USER_RUNTIME_PATH_PREFIX "%TEMP%\\pulse-"
-#define PATH_SEP '\\'
#endif
#ifdef OS_IS_WIN32
@@ -118,7 +116,7 @@
if (!GetModuleFileName(handle, library_path + sizeof(PULSE_ROOTENV), MAX_PATH))
return 0;
- sep = strrchr(library_path, '\\');
+ sep = strrchr(library_path, PA_PATH_SEP_CHAR);
if (sep)
*sep = '\0';
@@ -1123,7 +1121,7 @@
if ((e = getenv("PULSE_RUNTIME_PATH"))) {
if (fn)
- pa_snprintf(s, l, "%s%c%s", e, PATH_SEP, fn);
+ pa_snprintf(s, l, "%s%c%s", e, PA_PATH_SEP_CHAR, fn);
else
pa_snprintf(s, l, "%s", e);
@@ -1131,7 +1129,7 @@
char u[256];
if (fn)
- pa_snprintf(s, l, "%s%s%c%s", PA_USER_RUNTIME_PATH_PREFIX, pa_get_user_name(u, sizeof(u)), PATH_SEP, fn);
+ pa_snprintf(s, l, "%s%s%c%s", PA_USER_RUNTIME_PATH_PREFIX, pa_get_user_name(u, sizeof(u)), PA_PATH_SEP_CHAR, fn);
else
pa_snprintf(s, l, "%s%s", PA_USER_RUNTIME_PATH_PREFIX, pa_get_user_name(u, sizeof(u)));
}
Modified: branches/lennart/src/pulsecore/macro.h
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/macro.h?rev=1801&root=pulseaudio&r1=1800&r2=1801&view=diff
==============================================================================
--- branches/lennart/src/pulsecore/macro.h (original)
+++ branches/lennart/src/pulsecore/macro.h Tue Sep 11 03:00:33 2007
@@ -114,4 +114,12 @@
#define PA_PTR_TO_INT32(p) ((int32_t) PA_PTR_TO_UINT(p))
#define PA_INT32_TO_PTR(u) PA_UINT_TO_PTR((int32_t) u)
+#ifdef OS_IS_WIN32
+#define PA_PATH_SEP "\\"
+#define PA_PATH_SEP_CHAR '\\'
+#else
+#define PA_PATH_SEP "/"
+#define PA_PATH_SEP_CHAR '/'
#endif
+
+#endif
More information about the pulseaudio-commits
mailing list