1 /* max path length for bam */ 2 #define MAX_PATH_LENGTH 1024 3 4 /* returns a pointer to the filename, /foo/bar.a -> bar.a */ 5 extern const char *path_filename(const char *path); 6 7 /* /foo/bar.a -> /foo */ 8 extern int path_directory(const char *path, char *directory, int size); 9 10 /* normalizes a path, rewrites the path */ 11 extern int path_normalize(char *path); 12 13 /* joins to paths together and normalizes them. returns 0 on success */ 14 extern int path_join(const char *base, int base_len, const char *extend, int extend_len, char *output, int size); 15 16 /* returns 1 if the path is absolute, else it returns 0 */ 17 extern int path_isabs(const char *path); 18 19 /* checks so that the path is nice */ 20 /* no /.. /./ or // */ 21 /* must begin with / (absolute) */ 22 /* does not end with / */ 23 extern int path_isnice(const char *path); 24 25 /* */ 26 struct lua_State; 27 extern int lf_path_isnice(struct lua_State *L); 28 extern int lf_path_isabs(struct lua_State *L); 29 extern int lf_path_join(struct lua_State *L); 30 extern int lf_path_normalize(struct lua_State *L); 31 32 extern int lf_path_ext(struct lua_State *L); 33 extern int lf_path_dir(struct lua_State *L); 34 extern int lf_path_base(struct lua_State *L); 35 extern int lf_path_filename(struct lua_State *L); 36 37