From 4a22fb06b98fedd0e95d2bb4529ac1d74c418ff4 Mon Sep 17 00:00:00 2001 From: Stefan Hoffmann Date: Sat, 10 May 2014 11:49:25 +0200 Subject: FileID: implement `FileID` struct `FileID` should encapsulate `st_dev` and `st_ino`. It is a new abstraction used to check if two files are the same. `FileID`s will be embeded inside other struts like `buf_t` or `ff_visited_T`, where a full `FileInfo` would be to big. --- src/nvim/os/fs_defs.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/nvim/os/fs_defs.h (limited to 'src/nvim/os/fs_defs.h') diff --git a/src/nvim/os/fs_defs.h b/src/nvim/os/fs_defs.h new file mode 100644 index 0000000000..ab4c05b965 --- /dev/null +++ b/src/nvim/os/fs_defs.h @@ -0,0 +1,19 @@ +#ifndef NVIM_OS_FS_DEFS_H +#define NVIM_OS_FS_DEFS_H + +#include + +/// Struct which encapsulates stat information. +typedef struct { + uv_stat_t stat; ///< @private +} FileInfo; + +/// Struct which encapsulates inode/dev_id information. +typedef struct { + uint64_t inode; ///< @private The inode of the file + uint64_t device_id; ///< @private The id of the device containing the file +} FileID; + +#define FILE_ID_EMPTY (FileID){.inode = 0, .device_id = 0} + +#endif // NVIM_OS_FS_DEFS_H -- cgit