2013-01-08 08:00:23 -06: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 15:12:03 -06:00
|
|
|
#ifndef CANONICALIZE_H
|
|
|
|
#define CANONICALIZE_H
|
|
|
|
|
2009-10-15 18:45:42 -05:00
|
|
|
#include "c.h" /* for PATH_MAX */
|
2016-03-24 05:51:12 -05:00
|
|
|
#include "strutils.h"
|
2009-02-03 15:12:03 -06:00
|
|
|
|
|
|
|
extern char *canonicalize_path(const char *path);
|
2012-11-26 09:24:28 -06:00
|
|
|
extern char *canonicalize_path_restricted(const char *path);
|
2009-10-26 07:33:03 -05:00
|
|
|
extern char *canonicalize_dm_name(const char *ptname);
|
2018-06-19 05:02:52 -05:00
|
|
|
extern char *__canonicalize_dm_name(const char *prefix, const char *ptname);
|
2009-02-03 15:12:03 -06:00
|
|
|
|
2016-03-24 05:51:12 -05: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 15:12:03 -06:00
|
|
|
#endif /* CANONICALIZE_H */
|