00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef LIBAEGIS_DIR_STACK_H
00021 #define LIBAEGIS_DIR_STACK_H
00022
00023 #include <common/main.h>
00024 #include <common/str_list.h>
00025
00026 enum dir_stack_walk_message_t
00027 {
00028 dir_stack_walk_dir_before,
00029 dir_stack_walk_dir_after,
00030 dir_stack_walk_file,
00031 dir_stack_walk_special,
00032 dir_stack_walk_symlink
00033 };
00034
00035 struct stat;
00036
00042 #define TOP_LEVEL_SYMLINK (~(~0u >> 1))
00043
00049 void dir_stack_readdir(string_list_ty *stack, string_ty *path,
00050 string_list_ty *result);
00051
00080 typedef void (*dir_stack_walk_callback_t)(void *arg,
00081 dir_stack_walk_message_t msg, string_ty *relpath, struct stat *statbuf,
00082 int depth, int ignore_symlinks);
00083
00108 void dir_stack_walk(string_list_ty *viewpath, string_ty *path,
00109 dir_stack_walk_callback_t callback, void *arg, int ignore_symlinks);
00110
00139 string_ty *dir_stack_find(string_list_ty *viewpath, size_t start_pos,
00140 string_ty *path, struct stat *statbuf, int *depth,
00141 int ignore_symlinks);
00142
00169 void dir_stack_stat(string_list_ty *viewpath, string_ty *filename,
00170 struct stat *statbuf, int *depth, int ignore_symlinks);
00171
00183 string_ty *dir_stack_relative(string_list_ty *viewpath, string_ty *abspath);
00184
00185 #endif // LIBAEGIS_DIR_STACK_H