aboutsummaryrefslogtreecommitdiffstats
path: root/ProcessTable.h
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2024-01-10 11:17:08 +0100
committerDaniel Lange <DLange@git.local>2024-01-10 11:17:08 +0100
commite7372d18a1a661d8c3dba9f51e1f17b5f94171a7 (patch)
treee8270dd60ec096bee8157dbadf029e15ed584592 /ProcessTable.h
parent937052b231259a47d881d539ad5748245ef55b99 (diff)
downloaddebian_htop-e7372d18a1a661d8c3dba9f51e1f17b5f94171a7.tar.gz
debian_htop-e7372d18a1a661d8c3dba9f51e1f17b5f94171a7.tar.bz2
debian_htop-e7372d18a1a661d8c3dba9f51e1f17b5f94171a7.zip
New upstream version 3.3.0
Diffstat (limited to 'ProcessTable.h')
-rw-r--r--ProcessTable.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/ProcessTable.h b/ProcessTable.h
new file mode 100644
index 0000000..96a517a
--- /dev/null
+++ b/ProcessTable.h
@@ -0,0 +1,52 @@
+#ifndef HEADER_ProcessTable
+#define HEADER_ProcessTable
+/*
+htop - ProcessTable.h
+(C) 2004,2005 Hisham H. Muhammad
+Released under the GNU GPLv2+, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include <stdbool.h>
+#include <sys/types.h>
+
+#include "Hashtable.h"
+#include "Machine.h"
+#include "Object.h"
+#include "Process.h"
+#include "Table.h"
+
+
+typedef struct ProcessTable_ {
+ Table super;
+
+ Hashtable* pidMatchList;
+
+ unsigned int totalTasks;
+ unsigned int runningTasks;
+ unsigned int userlandThreads;
+ unsigned int kernelThreads;
+} ProcessTable;
+
+/* Implemented by platforms */
+ProcessTable* ProcessTable_new(Machine* host, Hashtable* pidMatchList);
+void ProcessTable_delete(Object* cast);
+void ProcessTable_goThroughEntries(ProcessTable* this);
+
+void ProcessTable_init(ProcessTable* this, const ObjectClass* klass, Machine* host, Hashtable* pidMatchList);
+
+void ProcessTable_done(ProcessTable* this);
+
+extern const TableClass ProcessTable_class;
+
+static inline void ProcessTable_add(ProcessTable* this, Process* process) {
+ Table_add(&this->super, &process->super);
+}
+
+Process* ProcessTable_getProcess(ProcessTable* this, pid_t pid, bool* preExisting, Process_New constructor);
+
+static inline Process* ProcessTable_findProcess(ProcessTable* this, pid_t pid) {
+ return (Process*) Table_findRow(&this->super, pid);
+}
+
+#endif

© 2014-2024 Faster IT GmbH | imprint | privacy policy