| Benny Baumann | 1876305 | 2020-11-11 22:15:35 +0100 | [diff] [blame] | 1 | #ifndef HEADER_ProcessLocksScreen |
| 2 | #define HEADER_ProcessLocksScreen |
| 3 | /* |
| 4 | htop - ProcessLocksScreen.h |
| 5 | (C) 2020 htop dev team |
| Daniel Lange | 94ad111 | 2021-09-22 11:33:00 +0200 | [diff] [blame] | 6 | Released under the GNU GPLv2+, see the COPYING file |
| Benny Baumann | 1876305 | 2020-11-11 22:15:35 +0100 | [diff] [blame] | 7 | in the source distribution for its full text. |
| 8 | */ |
| 9 | |
| Christian Göttsche | 7cf5277 | 2020-11-18 14:26:30 +0100 | [diff] [blame] | 10 | #include <stdbool.h> |
| 11 | #include <stdint.h> |
| 12 | #include <sys/types.h> |
| Benny Baumann | 1876305 | 2020-11-11 22:15:35 +0100 | [diff] [blame] | 13 | |
| Christian Göttsche | 7cf5277 | 2020-11-18 14:26:30 +0100 | [diff] [blame] | 14 | #include "InfoScreen.h" |
| 15 | #include "Object.h" |
| 16 | #include "Process.h" |
| Benny Baumann | 1876305 | 2020-11-11 22:15:35 +0100 | [diff] [blame] | 17 | |
| 18 | |
| 19 | typedef struct ProcessLocksScreen_ { |
| 20 | InfoScreen super; |
| 21 | pid_t pid; |
| 22 | } ProcessLocksScreen; |
| 23 | |
| 24 | typedef struct FileLocks_Data_ { |
| Benny Baumann | d431786 | 2020-11-13 21:34:21 +0100 | [diff] [blame] | 25 | char* locktype; |
| 26 | char* exclusive; |
| 27 | char* readwrite; |
| 28 | char* filename; |
| наб | 8def4d6 | 2022-11-26 00:58:14 +0100 | [diff] [blame] | 29 | int fd; |
| наб | 650cf0f | 2022-11-26 01:21:57 +0100 | [diff] [blame] | 30 | dev_t dev; |
| Benny Baumann | 1876305 | 2020-11-11 22:15:35 +0100 | [diff] [blame] | 31 | uint64_t inode; |
| 32 | uint64_t start; |
| 33 | uint64_t end; |
| 34 | } FileLocks_Data; |
| 35 | |
| 36 | typedef struct FileLocks_LockData_ { |
| 37 | FileLocks_Data data; |
| 38 | struct FileLocks_LockData_* next; |
| 39 | } FileLocks_LockData; |
| 40 | |
| 41 | typedef struct FileLocks_ProcessData_ { |
| 42 | bool error; |
| 43 | struct FileLocks_LockData_* locks; |
| 44 | } FileLocks_ProcessData; |
| 45 | |
| 46 | extern const InfoScreenClass ProcessLocksScreen_class; |
| 47 | |
| 48 | ProcessLocksScreen* ProcessLocksScreen_new(const Process* process); |
| 49 | |
| 50 | void ProcessLocksScreen_delete(Object* this); |
| 51 | |
| 52 | #endif |