(dir_list_load): rename argument: fltr -> filter.

(dir_list_reload): likewise.
(handle_dirent): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2022-02-23 17:40:34 +03:00
parent 2101026d4c
commit 4518885f93
2 changed files with 10 additions and 10 deletions

View File

@ -145,7 +145,7 @@ clean_sort_keys (dir_list * list, int start, int count)
*/ */
static gboolean static gboolean
handle_dirent (struct vfs_dirent *dp, const char *fltr, struct stat *buf1, gboolean * link_to_dir, handle_dirent (struct vfs_dirent *dp, const char *filter, struct stat *buf1, gboolean * link_to_dir,
gboolean * stale_link) gboolean * stale_link)
{ {
vfs_path_t *vpath; vfs_path_t *vpath;
@ -176,8 +176,8 @@ handle_dirent (struct vfs_dirent *dp, const char *fltr, struct stat *buf1, gbool
vfs_path_free (vpath, TRUE); vfs_path_free (vpath, TRUE);
return (S_ISDIR (buf1->st_mode) || *link_to_dir || fltr == NULL return (S_ISDIR (buf1->st_mode) || *link_to_dir || filter == NULL
|| mc_search (fltr, NULL, dp->d_name, MC_SEARCH_T_GLOB)); || mc_search (filter, NULL, dp->d_name, MC_SEARCH_T_GLOB));
} }
/* --------------------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------------------- */
@ -620,7 +620,7 @@ handle_path (const char *path, struct stat * buf1, gboolean * link_to_dir, gbool
gboolean gboolean
dir_list_load (dir_list * list, const vfs_path_t * vpath, GCompareFunc sort, dir_list_load (dir_list * list, const vfs_path_t * vpath, GCompareFunc sort,
const dir_sort_options_t * sort_op, const char *fltr) const dir_sort_options_t * sort_op, const char *filter)
{ {
DIR *dirp; DIR *dirp;
struct vfs_dirent *dp; struct vfs_dirent *dp;
@ -657,7 +657,7 @@ dir_list_load (dir_list * list, const vfs_path_t * vpath, GCompareFunc sort,
if (list->callback != NULL) if (list->callback != NULL)
list->callback (DIR_READ, dp); list->callback (DIR_READ, dp);
if (!handle_dirent (dp, fltr, &st, &link_to_dir, &stale_link)) if (!handle_dirent (dp, filter, &st, &link_to_dir, &stale_link))
continue; continue;
if (!dir_list_append (list, dp->d_name, &st, link_to_dir, stale_link)) if (!dir_list_append (list, dp->d_name, &st, link_to_dir, stale_link))
@ -689,11 +689,11 @@ if_link_is_exe (const vfs_path_t * full_name_vpath, const file_entry_t * file)
} }
/* --------------------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------------------- */
/** If fltr is null, then it is a match */ /** If filter is null, then it is a match */
gboolean gboolean
dir_list_reload (dir_list * list, const vfs_path_t * vpath, GCompareFunc sort, dir_list_reload (dir_list * list, const vfs_path_t * vpath, GCompareFunc sort,
const dir_sort_options_t * sort_op, const char *fltr) const dir_sort_options_t * sort_op, const char *filter)
{ {
DIR *dirp; DIR *dirp;
struct vfs_dirent *dp; struct vfs_dirent *dp;
@ -776,7 +776,7 @@ dir_list_reload (dir_list * list, const vfs_path_t * vpath, GCompareFunc sort,
if (list->callback != NULL) if (list->callback != NULL)
list->callback (DIR_READ, dp); list->callback (DIR_READ, dp);
if (!handle_dirent (dp, fltr, &st, &link_to_dir, &stale_link)) if (!handle_dirent (dp, filter, &st, &link_to_dir, &stale_link))
continue; continue;
if (!dir_list_append (list, dp->d_name, &st, link_to_dir, stale_link)) if (!dir_list_append (list, dp->d_name, &st, link_to_dir, stale_link))

View File

@ -60,9 +60,9 @@ gboolean dir_list_append (dir_list * list, const char *fname, const struct stat
gboolean link_to_dir, gboolean stale_link); gboolean link_to_dir, gboolean stale_link);
gboolean dir_list_load (dir_list * list, const vfs_path_t * vpath, GCompareFunc sort, gboolean dir_list_load (dir_list * list, const vfs_path_t * vpath, GCompareFunc sort,
const dir_sort_options_t * sort_op, const char *fltr); const dir_sort_options_t * sort_op, const char *filter);
gboolean dir_list_reload (dir_list * list, const vfs_path_t * vpath, GCompareFunc sort, gboolean dir_list_reload (dir_list * list, const vfs_path_t * vpath, GCompareFunc sort,
const dir_sort_options_t * sort_op, const char *fltr); const dir_sort_options_t * sort_op, const char *filter);
void dir_list_sort (dir_list * list, GCompareFunc sort, const dir_sort_options_t * sort_op); void dir_list_sort (dir_list * list, GCompareFunc sort, const dir_sort_options_t * sort_op);
gboolean dir_list_init (dir_list * list); gboolean dir_list_init (dir_list * list);
void dir_list_clean (dir_list * list); void dir_list_clean (dir_list * list);