sd-path.c   sd-path.c 
skipping to change at line 25 skipping to change at line 25
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "util.h" #include "util.h"
#include "architecture.h" #include "architecture.h"
#include "path-util.h" #include "path-util.h"
#include "strv.h" #include "strv.h"
#include "sd-path.h" #include "sd-path.h"
#include "missing.h"
static int from_environment(const char *envname, const char *fallback, cons t char **ret) { static int from_environment(const char *envname, const char *fallback, cons t char **ret) {
assert(ret); assert(ret);
if (envname) { if (envname) {
const char *e; const char *e;
e = secure_getenv(envname); e = secure_getenv(envname);
if (e && path_is_absolute(e)) { if (e && path_is_absolute(e)) {
*ret = e; *ret = e;
skipping to change at line 328 skipping to change at line 329
case SD_PATH_USER_TEMPLATES: case SD_PATH_USER_TEMPLATES:
return from_user_dir("XDG_TEMPLATES_DIR", buffer, ret); return from_user_dir("XDG_TEMPLATES_DIR", buffer, ret);
case SD_PATH_USER_DESKTOP: case SD_PATH_USER_DESKTOP:
return from_user_dir("XDG_DESKTOP_DIR", buffer, ret); return from_user_dir("XDG_DESKTOP_DIR", buffer, ret);
} }
return -ENOTSUP; return -ENOTSUP;
} }
int sd_path_home(uint64_t type, const char *suffix, char **path) { _public_ int sd_path_home(uint64_t type, const char *suffix, char **path) {
char *buffer = NULL, *cc; char *buffer = NULL, *cc;
const char *ret; const char *ret;
int r; int r;
assert_return(path, -EINVAL); assert_return(path, -EINVAL);
if (IN_SET(type, if (IN_SET(type,
SD_PATH_SEARCH_BINARIES, SD_PATH_SEARCH_BINARIES,
SD_PATH_SEARCH_LIBRARY_PRIVATE, SD_PATH_SEARCH_LIBRARY_PRIVATE,
SD_PATH_SEARCH_LIBRARY_ARCH, SD_PATH_SEARCH_LIBRARY_ARCH,
skipping to change at line 557 skipping to change at line 558
".config", ".config",
"XDG_CONFIG_DIRS", "XDG_CONFIG_DIRS",
false, false,
"/etc", "/etc",
NULL); NULL);
} }
return -ENOTSUP; return -ENOTSUP;
} }
int sd_path_search(uint64_t type, const char *suffix, char ***paths) { _public_ int sd_path_search(uint64_t type, const char *suffix, char ***path s) {
char **l, **i, **j, **n; char **l, **i, **j, **n;
int r; int r;
assert_return(paths, -EINVAL); assert_return(paths, -EINVAL);
if (!IN_SET(type, if (!IN_SET(type,
SD_PATH_SEARCH_BINARIES, SD_PATH_SEARCH_BINARIES,
SD_PATH_SEARCH_LIBRARY_PRIVATE, SD_PATH_SEARCH_LIBRARY_PRIVATE,
SD_PATH_SEARCH_LIBRARY_ARCH, SD_PATH_SEARCH_LIBRARY_ARCH,
SD_PATH_SEARCH_SHARED, SD_PATH_SEARCH_SHARED,
 End of changes. 3 change blocks. 
2 lines changed or deleted 3 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/