0ad/source/lib/res/file/vfs_path.h
janwas 4aa740bff5 - split up lib/res into file, graphics and sound.
- wposix.cpp: initial support for MEM_RESERVE and MEM_COMMIT semantics
in mmap
- cstr: removed no longer necessary serialization header
- xmlutils: wrap new() calls in nommgr/mmgr; allows tracking other
allocs in this file.
- add u64_from_u32
- various minor comments/improvements.

This was SVN commit r2604.
2005-08-12 17:06:53 +00:00

22 lines
726 B
C

#ifndef VFS_PATH_H__
#define VFS_PATH_H__
#include "lib.h"
// internal use only:
// 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.
extern int path_validate(const uint line, const char* path);
#define CHECK_PATH(path) CHECK_ERR(path_validate(__LINE__, path))
extern bool path_component_valid(const char* name);
// strip <remove> from the start of <src>, prepend <replace>,
// and write to <dst>.
// used when converting VFS <--> real paths.
extern int path_replace(char* dst, const char* src, const char* remove, const char* replace);
#endif // #ifndef VFS_PATH_H__