2005-08-10 03:12:03 +02:00
|
|
|
#ifndef VFS_PATH_H__
|
|
|
|
#define VFS_PATH_H__
|
2005-03-27 03:46:54 +02:00
|
|
|
|
|
|
|
#include "lib.h"
|
|
|
|
|
2005-08-10 03:12:03 +02:00
|
|
|
// internal use only:
|
|
|
|
|
2005-03-27 03:46:54 +02:00
|
|
|
// if path is invalid (see source for criteria), print a diagnostic message
|
|
|
|
// (indicating line number of the call that failed) and
|
|
|
|
// return a negative error code. used by CHECK_PATH.
|
2005-12-11 23:23:55 +01:00
|
|
|
extern LibError path_validate(const uint line, const char* path);
|
2005-08-10 03:12:03 +02:00
|
|
|
#define CHECK_PATH(path) CHECK_ERR(path_validate(__LINE__, path))
|
2005-03-27 03:46:54 +02:00
|
|
|
|
2005-08-10 03:12:03 +02:00
|
|
|
extern bool path_component_valid(const char* name);
|
2005-03-27 03:46:54 +02:00
|
|
|
|
|
|
|
// strip <remove> from the start of <src>, prepend <replace>,
|
|
|
|
// and write to <dst>.
|
|
|
|
// used when converting VFS <--> real paths.
|
2005-12-11 23:23:55 +01:00
|
|
|
extern LibError path_replace(char* dst, const char* src, const char* remove, const char* replace);
|
2005-03-27 03:46:54 +02:00
|
|
|
|
2006-01-31 04:47:52 +01:00
|
|
|
|
|
|
|
struct PathName
|
|
|
|
{
|
|
|
|
const char* path;
|
|
|
|
const char* name;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern LibError pathname_split(const char* V_path_tmp, PathName* V_path);
|
|
|
|
|
2005-08-10 03:12:03 +02:00
|
|
|
#endif // #ifndef VFS_PATH_H__
|