aboutsummaryrefslogtreecommitdiffstats
path: root/Process.h
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2016-04-11 13:00:15 +0200
committerDaniel Lange <DLange@git.local>2016-04-11 13:00:15 +0200
commitd3c9975943df58e293359b87905d19ff1fd52061 (patch)
treee416378879f60e8d538b1b25963904f767d30ff4 /Process.h
downloaddebian_htop-d3c9975943df58e293359b87905d19ff1fd52061.tar.gz
debian_htop-d3c9975943df58e293359b87905d19ff1fd52061.tar.bz2
debian_htop-d3c9975943df58e293359b87905d19ff1fd52061.zip
Imported Upstream version 0.5upstream/0.5
Diffstat (limited to 'Process.h')
-rw-r--r--Process.h149
1 files changed, 149 insertions, 0 deletions
diff --git a/Process.h b/Process.h
new file mode 100644
index 0000000..556a093
--- /dev/null
+++ b/Process.h
@@ -0,0 +1,149 @@
+/* Do not edit this file. It was automatically genarated. */
+
+#ifndef HEADER_Process
+#define HEADER_Process
+/*
+htop
+(C) 2004 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "ProcessList.h"
+#include "Object.h"
+#include "CRT.h"
+#include "String.h"
+
+#include "debug.h"
+
+#include <stdio.h>
+#include <sys/time.h>
+#include <sys/resource.h>
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <signal.h>
+#include <string.h>
+#include <stdbool.h>
+#include <pwd.h>
+
+// TODO: wtf!?
+int kill(pid_t pid, int signal);
+
+// This works only with glibc 2.1+. On earlier versions
+// the behavior is similar to have a hardcoded page size.
+#define PAGE_SIZE ( sysconf(_SC_PAGESIZE) / 1024 )
+
+#define PROCESS_COMM_LEN 300
+#define PROCESS_USER_LEN 10
+
+
+typedef enum ProcessField_ {
+ PID, COMM, STATE, PPID, PGRP, SESSION, TTY_NR, TPGID, FLAGS, MINFLT, CMINFLT, MAJFLT, CMAJFLT, UTIME,
+ STIME, CUTIME, CSTIME, PRIORITY, NICE, ITREALVALUE, STARTTIME, VSIZE, RSS, RLIM, STARTCODE, ENDCODE,
+ STARTSTACK, KSTKESP, KSTKEIP, SIGNAL, BLOCKED, SIGIGNORE, SIGCATCH, WCHAN, NSWAP, CNSWAP, EXIT_SIGNAL,
+ PROCESSOR, M_SIZE, M_RESIDENT, M_SHARE, M_TRS, M_DRS, M_LRS, M_DT, ST_UID, PERCENT_CPU, PERCENT_MEM,
+ USER, TIME, LAST_PROCESSFIELD
+} ProcessField;
+
+struct ProcessList_;
+
+typedef struct Process_ {
+ Object super;
+
+ struct ProcessList_ *pl;
+ bool updated;
+
+ int pid;
+ char comm[PROCESS_COMM_LEN + 2];
+ int indent;
+ char state;
+ bool tag;
+ int ppid;
+ int pgrp;
+ int session;
+ int tty_nr;
+ int tpgid;
+ unsigned long int flags;
+ unsigned long int minflt;
+ unsigned long int cminflt;
+ unsigned long int majflt;
+ unsigned long int cmajflt;
+ unsigned long int utime;
+ unsigned long int stime;
+ long int cutime;
+ long int cstime;
+ long int priority;
+ long int nice;
+ long int itrealvalue;
+ unsigned long int starttime;
+ unsigned long int vsize;
+ long int rss;
+ unsigned long int rlim;
+ unsigned long int startcode;
+ unsigned long int endcode;
+ unsigned long int startstack;
+ unsigned long int kstkesp;
+ unsigned long int kstkeip;
+ unsigned long int signal;
+ unsigned long int blocked;
+ unsigned long int sigignore;
+ unsigned long int sigcatch;
+ unsigned long int wchan;
+ unsigned long int nswap;
+ unsigned long int cnswap;
+ int exit_signal;
+ int processor;
+ int m_size;
+ int m_resident;
+ int m_share;
+ int m_trs;
+ int m_drs;
+ int m_lrs;
+ int m_dt;
+ uid_t st_uid;
+ float percent_cpu;
+ float percent_mem;
+ char user[PROCESS_USER_LEN + 1];
+} Process;
+
+extern char* PROCESS_CLASS;
+
+extern char* Process_fieldNames[];
+
+
+
+
+Process* Process_new(struct ProcessList_ *pl);
+
+Process* Process_clone(Process* this);
+
+void Process_delete(Object* cast);
+
+void Process_display(Object* cast, RichString* out);
+
+void Process_toggleTag(Process* this);
+
+bool Process_equals(const Object* o1, const Object* o2);
+
+void Process_setPriority(Process* this, int priority);
+
+void Process_sendSignal(Process* this, int signal);
+
+#define ONE_K 1024
+#define ONE_M (ONE_K * ONE_K)
+#define ONE_G (ONE_M * ONE_K)
+
+
+
+
+inline void Process_writeCommand(Process* this, int attr, RichString* str);
+
+void Process_writeField(Process* this, RichString* str, ProcessField field);
+
+int Process_compare(const Object* v1, const Object* v2);
+
+char* Process_printField(ProcessField field);
+
+#endif

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