summaryrefslogtreecommitdiffstats
path: root/darwin/DarwinProcessList.c
diff options
context:
space:
mode:
authorDavid Hunt <dhunt@iolanthe.attlocal.net>2015-07-12 13:47:43 -0500
committerHisham Muhammad <hisham@gobolinux.org>2015-08-19 13:47:26 -0300
commit70e7c8db592408f45b958238d4bbf0048886f6fc (patch)
tree0ee699faad92f38d29d10b5c9faced3436f0c647 /darwin/DarwinProcessList.c
parentfeb7a01fd32d4a63b9cfb178c67cc95c05c9dc00 (diff)
Added darwin with working battery meter
Diffstat (limited to 'darwin/DarwinProcessList.c')
-rw-r--r--darwin/DarwinProcessList.c71
1 files changed, 71 insertions, 0 deletions
diff --git a/darwin/DarwinProcessList.c b/darwin/DarwinProcessList.c
new file mode 100644
index 00000000..3fb36365
--- /dev/null
+++ b/darwin/DarwinProcessList.c
@@ -0,0 +1,71 @@
+/*
+htop - DarwinProcessList.c
+(C) 2014 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "ProcessList.h"
+#include "DarwinProcess.h"
+#include "DarwinProcessList.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+/*{
+
+}*/
+
+ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId) {
+ ProcessList* this = calloc(1, sizeof(ProcessList));
+ ProcessList_init(this, Class(Process), usersTable, pidWhiteList, userId);
+
+ return this;
+}
+
+void ProcessList_delete(ProcessList* this) {
+ ProcessList_done(this);
+ free(this);
+}
+
+void ProcessList_goThroughEntries(ProcessList* super) {
+ bool preExisting = true;
+ Process *proc;
+
+ proc = ProcessList_getProcess(super, 1, &preExisting, DarwinProcess_new);
+
+ /* Empty values */
+ proc->time = proc->time + 10;
+ proc->pid = 1;
+ proc->ppid = 1;
+ proc->tgid = 0;
+ proc->comm = "<unsupported architecture>";
+ proc->basenameOffset = 0;
+ proc->updated = true;
+
+ proc->state = 'R';
+ proc->show = true; /* Reflected in proc->settings-> "hideXXX" really */
+ proc->pgrp = 0;
+ proc->session = 0;
+ proc->tty_nr = 0;
+ proc->tpgid = 0;
+ proc->st_uid = 0;
+ proc->flags = 0;
+ proc->processor = 0;
+
+ proc->percent_cpu = 2.5;
+ proc->percent_mem = 2.5;
+ proc->user = "nobody";
+
+ proc->priority = 0;
+ proc->nice = 0;
+ proc->nlwp = 1;
+ strncpy(proc->starttime_show, "Jun 01 ", sizeof(proc->starttime_show));
+ proc->starttime_ctime = 1433116800; // Jun 01, 2015
+
+ proc->m_size = 100;
+ proc->m_resident = 100;
+
+ proc->minflt = 20;
+ proc->majflt = 20;
+}

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