ProcessList.h 2.28 KB
Newer Older
Hisham Muhammad's avatar
Hisham Muhammad committed
1
/* Do not edit this file. It was automatically generated. */
Hisham Muhammad's avatar
Hisham Muhammad committed
2
3
4
5

#ifndef HEADER_ProcessList
#define HEADER_ProcessList
/*
Hisham Muhammad's avatar
Hisham Muhammad committed
6
htop - ProcessList.h
Hisham Muhammad's avatar
Hisham Muhammad committed
7
(C) 2004,2005 Hisham H. Muhammad
Hisham Muhammad's avatar
Hisham Muhammad committed
8
9
10
11
Released under the GNU GPL, see the COPYING file
in the source distribution for its full text.
*/

12
#include "Vector.h"
Hisham Muhammad's avatar
Hisham Muhammad committed
13
#include "Hashtable.h"
Hisham Muhammad's avatar
Hisham Muhammad committed
14
#include "UsersTable.h"
15
#include "Panel.h"
Hisham Muhammad's avatar
Hisham Muhammad committed
16
#include "Process.h"
Hisham Muhammad's avatar
Hisham Muhammad committed
17
#include "Settings.h"
18

Hisham Muhammad's avatar
Hisham Muhammad committed
19
20
21
22
#ifndef MAX_NAME
#define MAX_NAME 128
#endif

Hisham Muhammad's avatar
Hisham Muhammad committed
23
#ifndef MAX_READ
24
#define MAX_READ 2048
Hisham Muhammad's avatar
Hisham Muhammad committed
25
26
#endif

Hisham Muhammad's avatar
Hisham Muhammad committed
27
typedef struct ProcessList_ {
Hisham Muhammad's avatar
Hisham Muhammad committed
28
29
   Settings* settings;

30
31
   Vector* processes;
   Vector* processes2;
Hisham Muhammad's avatar
Hisham Muhammad committed
32
33
34
   Hashtable* processTable;
   UsersTable* usersTable;

35
   Panel* panel;
36
   int following;
37
38
   uid_t userId;
   const char* incFilter;
39
   Hashtable* pidWhiteList;
40

41
   #ifdef HAVE_LIBHWLOC
42
43
44
   hwloc_topology_t topology;
   bool topologyOk;
   #endif
Hisham Muhammad's avatar
Hisham Muhammad committed
45

46
47
48
49
50
   int totalTasks;
   int runningTasks;
   int userlandThreads;
   int kernelThreads;

51
52
53
54
55
56
57
58
59
60
   unsigned long long int totalMem;
   unsigned long long int usedMem;
   unsigned long long int freeMem;
   unsigned long long int sharedMem;
   unsigned long long int buffersMem;
   unsigned long long int cachedMem;
   unsigned long long int totalSwap;
   unsigned long long int usedSwap;
   unsigned long long int freeSwap;

Hisham Muhammad's avatar
Hisham Muhammad committed
61
   int cpuCount;
Hisham Muhammad's avatar
Hisham Muhammad committed
62
63
64

} ProcessList;

Hisham Muhammad's avatar
Hisham Muhammad committed
65
ProcessList* ProcessList_new(UsersTable* ut, Hashtable* pidWhiteList, uid_t userId);
66
void ProcessList_delete(ProcessList* pl);
67
void ProcessList_goThroughEntries(ProcessList* pl);
68

69

Hisham Muhammad's avatar
Hisham Muhammad committed
70
ProcessList* ProcessList_init(ProcessList* this, UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId);
Hisham Muhammad's avatar
Hisham Muhammad committed
71

72
void ProcessList_done(ProcessList* this);
Hisham Muhammad's avatar
Hisham Muhammad committed
73

74
75
void ProcessList_setPanel(ProcessList* this, Panel* panel);

76
void ProcessList_printHeader(ProcessList* this, RichString* header);
Hisham Muhammad's avatar
Hisham Muhammad committed
77

78
79
80
81
void ProcessList_add(ProcessList* this, Process* p);

void ProcessList_remove(ProcessList* this, Process* p);

Hisham Muhammad's avatar
Hisham Muhammad committed
82
Process* ProcessList_get(ProcessList* this, int idx);
Hisham Muhammad's avatar
Hisham Muhammad committed
83
84
85
86
87

int ProcessList_size(ProcessList* this);

void ProcessList_sort(ProcessList* this);

88
89
ProcessField ProcessList_keyAt(ProcessList* this, int at);

90
91
void ProcessList_expandTree(ProcessList* this);

Hisham Muhammad's avatar
Hisham Muhammad committed
92
void ProcessList_rebuildPanel(ProcessList* this);
93

94
95
96
Process* ProcessList_getProcess(ProcessList* this, pid_t pid, bool* preExisting, Process_new_fn constructor);

void ProcessList_scan(ProcessList* this);
97

Hisham Muhammad's avatar
Hisham Muhammad committed
98
#endif