ProcessLocksScreen.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef HEADER_ProcessLocksScreen
  2. #define HEADER_ProcessLocksScreen
  3. /*
  4. htop - ProcessLocksScreen.h
  5. (C) 2020 htop dev team
  6. Released under the GNU GPLv2+, see the COPYING file
  7. in the source distribution for its full text.
  8. */
  9. #include <stdbool.h>
  10. #include <stdint.h>
  11. #include <sys/types.h>
  12. #include "InfoScreen.h"
  13. #include "Object.h"
  14. #include "Process.h"
  15. typedef struct ProcessLocksScreen_ {
  16. InfoScreen super;
  17. pid_t pid;
  18. } ProcessLocksScreen;
  19. typedef struct FileLocks_Data_ {
  20. char* locktype;
  21. char* exclusive;
  22. char* readwrite;
  23. char* filename;
  24. int fd;
  25. dev_t dev;
  26. uint64_t inode;
  27. uint64_t start;
  28. uint64_t end;
  29. } FileLocks_Data;
  30. typedef struct FileLocks_LockData_ {
  31. FileLocks_Data data;
  32. struct FileLocks_LockData_* next;
  33. } FileLocks_LockData;
  34. typedef struct FileLocks_ProcessData_ {
  35. bool error;
  36. struct FileLocks_LockData_* locks;
  37. } FileLocks_ProcessData;
  38. extern const InfoScreenClass ProcessLocksScreen_class;
  39. ProcessLocksScreen* ProcessLocksScreen_new(const Process* process);
  40. void ProcessLocksScreen_delete(Object* this);
  41. #endif