2013-01-08 15:00:23 +01:00
|
|
|
/*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Library Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
* any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Library Public License for more details.
|
|
|
|
*/
|
2009-02-03 22:12:03 +01:00
|
|
|
#ifndef CANONICALIZE_H
|
|
|
|
#define CANONICALIZE_H
|
|
|
|
|
2009-10-16 01:45:42 +02:00
|
|
|
#include "c.h" /* for PATH_MAX */
|
2016-03-24 11:51:12 +01:00
|
|
|
#include "strutils.h"
|
2009-02-03 22:12:03 +01:00
|
|
|
|
|
|
|
extern char *canonicalize_path(const char *path);
|
2012-11-26 16:24:28 +01:00
|
|
|
extern char *canonicalize_path_restricted(const char *path);
|
2009-10-26 13:33:03 +01:00
|
|
|
extern char *canonicalize_dm_name(const char *ptname);
|
2018-06-19 12:02:52 +02:00
|
|
|
extern char *__canonicalize_dm_name(const char *prefix, const char *ptname);
|
2009-02-03 22:12:03 +01:00
|
|
|
|
2016-03-24 11:51:12 +01:00
|
|
|
extern char *absolute_path(const char *path);
|
|
|
|
|
|
|
|
static inline int is_relative_path(const char *path)
|
|
|
|
{
|
|
|
|
if (!path || *path == '/')
|
|
|
|
return 0;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2009-02-03 22:12:03 +01:00
|
|
|
#endif /* CANONICALIZE_H */
|