src/filemanager/file.c: rename structure: link -> link_t.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2024-04-06 09:21:03 +03:00
parent e6ae50191b
commit 56c661e6f4
1 changed files with 15 additions and 15 deletions

View File

@ -106,7 +106,7 @@ const char *op_names[3] = {
/*** file scope type declarations ****************************************************************/
/* This is a hard link cache */
struct link
typedef struct
{
const struct vfs_class *vfs;
dev_t dev;
@ -115,7 +115,7 @@ struct link
mode_t st_mode;
vfs_path_t *src_vpath;
vfs_path_t *dst_vpath;
};
} link_t;
/* Status of the destination file */
typedef enum
@ -195,7 +195,7 @@ static GQueue *erase_list = NULL;
* target directories and is used to detect when an directory is copied
* into itself (we don't want to copy infinitely).
* Both lists don't use the linkcount and name structure members of struct
* link.
* link_t.
*/
static GSList *dest_dirs = NULL;
@ -309,7 +309,7 @@ build_dest (file_op_context_t * ctx, const char *src, const char *dest, FileProg
static void
free_link (void *data)
{
struct link *lp = (struct link *) data;
link_t *lp = (link_t *) data;
vfs_path_free (lp->src_vpath, TRUE);
vfs_path_free (lp->dst_vpath, TRUE);
@ -339,7 +339,7 @@ free_linklist (GSList * lp)
/* --------------------------------------------------------------------------------------------- */
static const struct link *
static const link_t *
is_in_linklist (const GSList * lp, const vfs_path_t * vpath, const struct stat *sb)
{
const struct vfs_class *class;
@ -350,7 +350,7 @@ is_in_linklist (const GSList * lp, const vfs_path_t * vpath, const struct stat *
for (; lp != NULL; lp = (const GSList *) g_slist_next (lp))
{
const struct link *lnk = (const struct link *) lp->data;
const link_t *lnk = (const link_t *) lp->data;
if (lnk->vfs == class && lnk->ino == ino && lnk->dev == dev)
return lnk;
@ -371,7 +371,7 @@ static hardlink_status_t
check_hardlinks (const vfs_path_t * src_vpath, const struct stat *src_stat,
const vfs_path_t * dst_vpath, gboolean * skip_all)
{
struct link *lnk;
link_t *lnk;
ino_t ino = src_stat->st_ino;
dev_t dev = src_stat->st_dev;
@ -380,7 +380,7 @@ check_hardlinks (const vfs_path_t * src_vpath, const struct stat *src_stat,
if ((vfs_file_class_flags (src_vpath) & VFSF_NOLINKS) != 0)
return HARDLINK_UNSUPPORTED;
lnk = (struct link *) is_in_linklist (linklist, src_vpath, src_stat);
lnk = (link_t *) is_in_linklist (linklist, src_vpath, src_stat);
if (lnk != NULL)
{
int stat_result;
@ -481,7 +481,7 @@ check_hardlinks (const vfs_path_t * src_vpath, const struct stat *src_stat,
return HARDLINK_ERROR;
}
lnk = g_try_new (struct link, 1);
lnk = g_try_new (link_t, 1);
if (lnk != NULL)
{
lnk->vfs = vfs_path_get_last_path_vfs (src_vpath);
@ -1581,9 +1581,9 @@ erase_dir_after_copy (file_op_total_context_t * tctx, file_op_context_t * ctx,
while (!g_queue_is_empty (erase_list) && *status != FILE_ABORT)
{
struct link *lp;
link_t *lp;
lp = (struct link *) g_queue_pop_head (erase_list);
lp = (link_t *) g_queue_pop_head (erase_list);
if (S_ISDIR (lp->st_mode))
*status = erase_dir_iff_empty (ctx, lp->src_vpath, tctx->progress_count);
@ -2951,7 +2951,7 @@ copy_dir_dir (file_op_total_context_t * tctx, file_op_context_t * ctx, const cha
gboolean attrs_ok = ctx->preserve;
DIR *reading;
FileProgressStatus return_status = FILE_CONT;
struct link *lp;
link_t *lp;
vfs_path_t *src_vpath, *dst_vpath;
gboolean do_mkdir = TRUE;
@ -3056,7 +3056,7 @@ copy_dir_dir (file_op_total_context_t * tctx, file_op_context_t * ctx, const cha
goto ret_fast;
}
lp = g_new0 (struct link, 1);
lp = g_new0 (link_t, 1);
lp->vfs = vfs_path_get_last_path_vfs (src_vpath);
lp->ino = src_stat.st_ino;
lp->dev = src_stat.st_dev;
@ -3131,7 +3131,7 @@ copy_dir_dir (file_op_total_context_t * tctx, file_op_context_t * ctx, const cha
goto ret;
}
lp = g_new0 (struct link, 1);
lp = g_new0 (link_t, 1);
mc_stat (dst_vpath, &dst_stat);
lp->vfs = vfs_path_get_last_path_vfs (dst_vpath);
lp->ino = dst_stat.st_ino;
@ -3210,7 +3210,7 @@ copy_dir_dir (file_op_total_context_t * tctx, file_op_context_t * ctx, const cha
if (erase_list == NULL)
erase_list = g_queue_new ();
lp = g_new0 (struct link, 1);
lp = g_new0 (link_t, 1);
lp->src_vpath = tmp_vpath;
lp->st_mode = dst_stat.st_mode;
g_queue_push_tail (erase_list, lp);