diff options
author | Stefan Hoffmann <stefan991@gmail.com> | 2014-08-27 20:09:39 +0200 |
---|---|---|
committer | Stefan Hoffmann <stefan991@gmail.com> | 2014-08-31 15:43:40 +0200 |
commit | 4e43095ab20d2b03b206f1b019570873af35c68c (patch) | |
tree | ec0cd41f68e249ad465572c64e2f6cdf3a4d5a2c | |
parent | 8a66f4f2453be3385c65d298609c282eeab08af8 (diff) | |
download | rneovim-4e43095ab20d2b03b206f1b019570873af35c68c.tar.gz rneovim-4e43095ab20d2b03b206f1b019570873af35c68c.tar.bz2 rneovim-4e43095ab20d2b03b206f1b019570873af35c68c.zip |
fileid: rename os_get_file_id
-rw-r--r-- | src/nvim/buffer.c | 10 | ||||
-rw-r--r-- | src/nvim/ex_cmds2.c | 2 | ||||
-rw-r--r-- | src/nvim/file_search.c | 2 | ||||
-rw-r--r-- | src/nvim/os/fs.c | 2 | ||||
-rw-r--r-- | src/nvim/path.c | 6 | ||||
-rw-r--r-- | test/unit/os/fs_spec.lua | 16 |
6 files changed, 19 insertions, 19 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 77bed67d5f..1df4ed17f8 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -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 { diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c index 3809858875..3629492b9b 100644 --- a/src/nvim/ex_cmds2.c +++ b/src/nvim/ex_cmds2.c @@ -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. diff --git a/src/nvim/file_search.c b/src/nvim/file_search.c index c7e1f5cbbc..7f401d5c91 100644 --- a/src/nvim/file_search.c +++ b/src/nvim/file_search.c @@ -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; } } diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c index 63ea0ed963..2e51551b7a 100644 --- a/src/nvim/os/fs.c +++ b/src/nvim/os/fs.c @@ -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)) { diff --git a/src/nvim/path.c b/src/nvim/path.c index 4988849b59..a417f417c4 100644 --- a/src/nvim/path.c +++ b/src/nvim/path.c @@ -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); diff --git a/test/unit/os/fs_spec.lua b/test/unit/os/fs_spec.lua index f56f6f768f..240359b805 100644 --- a/test/unit/os/fs_spec.lua +++ b/test/unit/os/fs_spec.lua @@ -646,16 +646,16 @@ describe('fs function', function() end) end) - describe('os_get_file_id', function() + describe('os_fileid', function() it('returns false if given an non-existing file', function() local file_id = file_id_new() - assert.is_false((fs.os_get_file_id('/non-existent', file_id))) + assert.is_false((fs.os_fileid('/non-existent', file_id))) end) it('returns true if given an existing file and fills file_id', function() local file_id = file_id_new() local path = 'unit-test-directory/test.file' - assert.is_true((fs.os_get_file_id(path, file_id))) + assert.is_true((fs.os_fileid(path, file_id))) assert.is_true(0 < file_id[0].inode) assert.is_true(0 < file_id[0].device_id) end) @@ -665,7 +665,7 @@ describe('fs function', function() it('returns true if two FileIDs are equal', function() local file_id = file_id_new() local path = 'unit-test-directory/test.file' - assert.is_true((fs.os_get_file_id(path, file_id))) + assert.is_true((fs.os_fileid(path, file_id))) assert.is_true((fs.os_file_id_equal(file_id, file_id))) end) @@ -674,8 +674,8 @@ describe('fs function', function() local file_id_2 = file_id_new() local path_1 = 'unit-test-directory/test.file' local path_2 = 'unit-test-directory/test_2.file' - assert.is_true((fs.os_get_file_id(path_1, file_id_1))) - assert.is_true((fs.os_get_file_id(path_2, file_id_2))) + assert.is_true((fs.os_fileid(path_1, file_id_1))) + assert.is_true((fs.os_fileid(path_2, file_id_2))) assert.is_false((fs.os_file_id_equal(file_id_1, file_id_2))) end) end) @@ -685,7 +685,7 @@ describe('fs function', function() local file_id = file_id_new() local file_info = file_info_new() local path = 'unit-test-directory/test.file' - assert.is_true((fs.os_get_file_id(path, file_id))) + assert.is_true((fs.os_fileid(path, file_id))) assert.is_true((fs.os_fileinfo(path, file_info))) assert.is_true((fs.os_file_id_equal_file_info(file_id, file_info))) end) @@ -695,7 +695,7 @@ describe('fs function', function() local file_info = file_info_new() local path_1 = 'unit-test-directory/test.file' local path_2 = 'unit-test-directory/test_2.file' - assert.is_true((fs.os_get_file_id(path_1, file_id))) + assert.is_true((fs.os_fileid(path_1, file_id))) assert.is_true((fs.os_fileinfo(path_2, file_info))) assert.is_false((fs.os_file_id_equal_file_info(file_id, file_info))) end) |