mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-10 13:29:58 -05:00
add globally defined PA_PATH_SEP macro, replacing private per-file macros
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1801 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
6ac66e453f
commit
55d9fcb126
5 changed files with 17 additions and 29 deletions
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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 @@ char *pa_path_get_filename(const char *p) {
|
|||
|
||||
pa_assert(p);
|
||||
|
||||
if ((fn = strrchr(p, PATH_SEP)))
|
||||
if ((fn = strrchr(p, PA_PATH_SEP_CHAR)))
|
||||
return fn+1;
|
||||
|
||||
return (char*) p;
|
||||
|
|
|
|||
|
|
@ -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 @@ int pa_set_root(HANDLE handle) {
|
|||
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 @@ char *pa_runtime_path(const char *fn, char *s, size_t l) {
|
|||
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 *pa_runtime_path(const char *fn, char *s, size_t l) {
|
|||
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)));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,4 +114,12 @@ static inline size_t pa_page_align(size_t l) {
|
|||
#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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue