XMMS2
utils.c
Go to the documentation of this file.
1/* XMMS2 - X Music Multiplexer System
2 * Copyright (C) 2003-2011 XMMS2 Team
3 *
4 * PLUGINS ARE NOT CONSIDERED TO BE DERIVED WORK !!!
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 */
16
17/** @file
18 * Miscellaneous internal utility functions.
19 */
20
21#include <stdlib.h>
22#include <string.h>
23
24#include "xmms_configuration.h"
25#include "xmmsc/xmmsc_util.h"
26
27/**
28 * Get the default connection path.
29 *
30 * @param buf A char buffer
31 * @param len The length of buf (XMMS_PATH_MAX is a good choice)
32 * @return A pointer to buf, or NULL if an error occured.
33 */
34const char *
35xmms_default_ipcpath_get (char *buf, int len)
36{
37 const char *xmmspath;
38
39 xmmspath = getenv ("XMMS_PATH");
40 if (xmmspath && strlen (xmmspath) < len) {
41 strcpy (buf, xmmspath);
42 } else {
43 return xmms_fallback_ipcpath_get (buf, len);
44 }
45
46 return buf;
47}
const char * xmms_default_ipcpath_get(char *buf, int len)
Get the default connection path.
Definition utils.c:35
const char * xmms_fallback_ipcpath_get(char *buf, int len)
Get the fallback connection path (if XMMS_PATH is not accessible)
Definition utils_unix.c:93