0ad/source/lib/res/file/vfs_path.h
janwas 1c1200a049 - massive overhaul of lib error code returning. int -> LibError everywhere.
- add translators from errno and GetLastError to LibError
- clarified return values of callbacks (they must return
INFO_CB_CONTINUE to continue)
- this exposed a few bugs in error handling chains (returning incorrect
values); also reduced say-nothing instances of return -1.
- move CHECK_ERR etc. macros to lib_error

This was SVN commit r3229.
2005-12-11 22:23:55 +00:00

22 lines
736 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 LibError 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 LibError path_replace(char* dst, const char* src, const char* remove, const char* replace);
#endif // #ifndef VFS_PATH_H__