mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-19 03:33:43 +03:00
(src_to_dest_lookup): New function.
This commit is contained in:
1 parent
bcea8e96ea
commit
83f4f1abd9
1 file changed
+15
-1
+15
-1
@@ -1,5 +1,5 @@
|
||||
/* cp-hash.c -- file copying (hash search routines)
|
||||
Copyright (C) 89, 90, 91, 1995-2003 Free Software Foundation.
|
||||
Copyright (C) 89, 90, 91, 1995-2004 Free Software Foundation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -116,6 +116,20 @@ remember_created (const char *path)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* If INO/DEV correspond to an already-copied source file, return the
|
||||
name of the corresponding destination file. Otherwise, return NULL. */
|
||||
|
||||
char *
|
||||
src_to_dest_lookup (ino_t ino, dev_t dev)
|
||||
{
|
||||
struct Src_to_dest ent;
|
||||
struct Src_to_dest const *e;
|
||||
ent.st_ino = ino;
|
||||
ent.st_dev = dev;
|
||||
e = hash_lookup (src_to_dest, &ent);
|
||||
return e ? e->name : NULL;
|
||||
}
|
||||
|
||||
/* Add path NAME, copied from inode number INO and device number DEV,
|
||||
to the list of files we have copied.
|
||||
Return NULL if inserted, otherwise non-NULL. */
|
||||
|
||||
Reference in new issue
Block a user