fs_defs.h (885B)
1 #pragma once 2 3 #include <uv.h> 4 5 /// Struct which encapsulates stat information. 6 typedef struct { 7 uv_stat_t stat; ///< @private 8 } FileInfo; 9 10 /// Struct which encapsulates inode/dev_id information. 11 typedef struct { 12 uint64_t inode; ///< @private The inode of the file 13 uint64_t device_id; ///< @private The id of the device containing the file 14 } FileID; 15 16 #define FILE_ID_EMPTY (FileID) { .inode = 0, .device_id = 0 } 17 18 typedef struct { 19 uv_fs_t request; ///< @private The request to uv for the directory. 20 uv_dirent_t ent; ///< @private The entry information. 21 } Directory; 22 23 // Values returned by os_nodetype() 24 #define NODE_NORMAL 0 // file or directory, check with os_isdir() 25 #define NODE_WRITABLE 1 // something we can write to (character 26 // device, fifo, socket, ..) 27 #define NODE_OTHER 2 // non-writable thing (e.g., block device)