fileid: rename os_get_file_id

This commit is contained in:
Stefan Hoffmann
2014-08-27 20:09:39 +02:00
parent 8a66f4f245
commit 4e43095ab2
6 changed files with 19 additions and 19 deletions

View File

@@ -1314,7 +1314,7 @@ buflist_new (
* for hard links. */
FileID file_id;
bool file_id_valid = (sfname != NULL &&
os_get_file_id((char *)sfname, &file_id));
os_fileid((char *)sfname, &file_id));
if (ffname != NULL && !(flags & BLN_DUMMY)
&& (buf = buflist_findname_file_id(ffname, &file_id,
file_id_valid)) != NULL) {
@@ -1671,7 +1671,7 @@ buf_T *buflist_findname_exp(char_u *fname)
buf_T *buflist_findname(char_u *ffname)
{
FileID file_id;
bool file_id_valid = os_get_file_id((char *)ffname, &file_id);
bool file_id_valid = os_fileid((char *)ffname, &file_id);
return buflist_findname_file_id(ffname, &file_id, file_id_valid);
}
@@ -2221,7 +2221,7 @@ setfname (
* - if the buffer is loaded, fail
* - if the buffer is not loaded, delete it from the list
*/
file_id_valid = os_get_file_id((char *)ffname, &file_id);
file_id_valid = os_fileid((char *)ffname, &file_id);
if (!(buf->b_flags & BF_DUMMY)) {
obuf = buflist_findname_file_id(ffname, &file_id, file_id_valid);
}
@@ -2399,7 +2399,7 @@ static int otherfile_buf(buf_T *buf, char_u *ffname,
/* If no struct stat given, get it now */
if (file_id_p == NULL) {
file_id_p = &file_id;
file_id_valid = os_get_file_id((char *)ffname, file_id_p);
file_id_valid = os_fileid((char *)ffname, file_id_p);
}
if (!file_id_valid) {
// file_id not valid, assume files are different.
@@ -2429,7 +2429,7 @@ void buf_set_file_id(buf_T *buf)
{
FileID file_id;
if (buf->b_fname != NULL
&& os_get_file_id((char *)buf->b_fname, &file_id)) {
&& os_fileid((char *)buf->b_fname, &file_id)) {
buf->file_id_valid = true;
buf->file_id = file_id;
} else {

View File

@@ -2417,7 +2417,7 @@ do_source (
*/
save_current_SID = current_SID;
FileID file_id;
bool file_id_ok = os_get_file_id((char *)fname_exp, &file_id);
bool file_id_ok = os_fileid((char *)fname_exp, &file_id);
for (current_SID = script_items.ga_len; current_SID > 0; --current_SID) {
si = &SCRIPT_ITEM(current_SID);
// Compare dev/ino when possible, it catches symbolic links.

View File

@@ -1097,7 +1097,7 @@ static int ff_check_visited(ff_visited_T **visited_list, char_u *fname, char_u *
url = true;
} else {
ff_expand_buffer[0] = NUL;
if (!os_get_file_id((char *)fname, &file_id)) {
if (!os_fileid((char *)fname, &file_id)) {
return FAIL;
}
}

View File

@@ -426,7 +426,7 @@ uint64_t os_fileinfo_blocksize(const FileInfo *file_info)
/// @param path Path to the file.
/// @param[out] file_info Pointer to a `FileID` to fill in.
/// @return `true` on sucess, `false` for failure.
bool os_get_file_id(const char *path, FileID *file_id)
bool os_fileid(const char *path, FileID *file_id)
{
uv_stat_t statbuf;
if (os_stat(path, &statbuf)) {

View File

@@ -61,10 +61,10 @@ FileComparison path_full_compare(char_u *s1, char_u *s2, int checkname)
FileID file_id_1, file_id_2;
expand_env(s1, exp1, MAXPATHL);
bool id_ok_1 = os_get_file_id((char *)exp1, &file_id_1);
bool id_ok_2 = os_get_file_id((char *)s2, &file_id_2);
bool id_ok_1 = os_fileid((char *)exp1, &file_id_1);
bool id_ok_2 = os_fileid((char *)s2, &file_id_2);
if (!id_ok_1 && !id_ok_2) {
// If os_get_file_id() doesn't work, may compare the names.
// If os_fileid() doesn't work, may compare the names.
if (checkname) {
vim_FullName(exp1, full1, MAXPATHL, FALSE);
vim_FullName(s2, full2, MAXPATHL, FALSE);