blob: 417df7b20a17f300ee0893eea2d7479e052b97aa [file] [log] [blame]
Benny Baumann18763052020-11-11 22:15:35 +01001#ifndef HEADER_ProcessLocksScreen
2#define HEADER_ProcessLocksScreen
3/*
4htop - ProcessLocksScreen.h
5(C) 2020 htop dev team
Daniel Lange94ad1112021-09-22 11:33:00 +02006Released under the GNU GPLv2+, see the COPYING file
Benny Baumann18763052020-11-11 22:15:35 +01007in the source distribution for its full text.
8*/
9
Christian Göttsche7cf52772020-11-18 14:26:30 +010010#include <stdbool.h>
11#include <stdint.h>
12#include <sys/types.h>
Benny Baumann18763052020-11-11 22:15:35 +010013
Christian Göttsche7cf52772020-11-18 14:26:30 +010014#include "InfoScreen.h"
15#include "Object.h"
16#include "Process.h"
Benny Baumann18763052020-11-11 22:15:35 +010017
18
19typedef struct ProcessLocksScreen_ {
20 InfoScreen super;
21 pid_t pid;
22} ProcessLocksScreen;
23
24typedef struct FileLocks_Data_ {
Benny Baumannd4317862020-11-13 21:34:21 +010025 char* locktype;
26 char* exclusive;
27 char* readwrite;
28 char* filename;
наб8def4d62022-11-26 00:58:14 +010029 int fd;
наб650cf0f2022-11-26 01:21:57 +010030 dev_t dev;
Benny Baumann18763052020-11-11 22:15:35 +010031 uint64_t inode;
32 uint64_t start;
33 uint64_t end;
34} FileLocks_Data;
35
36typedef struct FileLocks_LockData_ {
37 FileLocks_Data data;
38 struct FileLocks_LockData_* next;
39} FileLocks_LockData;
40
41typedef struct FileLocks_ProcessData_ {
42 bool error;
43 struct FileLocks_LockData_* locks;
44} FileLocks_ProcessData;
45
46extern const InfoScreenClass ProcessLocksScreen_class;
47
48ProcessLocksScreen* ProcessLocksScreen_new(const Process* process);
49
50void ProcessLocksScreen_delete(Object* this);
51
52#endif