Highlight new and old processes (#74)

This commit is contained in:
Adam Saponara
2020-10-30 21:56:16 -04:00
parent bbf01054bf
commit dde71c6637
14 changed files with 155 additions and 35 deletions

View File

@ -10,17 +10,18 @@ in the source distribution for its full text.
#include <stdbool.h>
#include <sys/types.h>
#include <time.h>
#include "Object.h"
#include "RichString.h"
#ifdef __ANDROID__
#define SYS_ioprio_get __NR_ioprio_get
#define SYS_ioprio_set __NR_ioprio_set
#endif
#define PROCESS_FLAG_IO 0x0001
#define DEFAULT_HIGHLIGHT_SECS 5
typedef enum ProcessFields {
NULL_PROCESSFIELD = 0,
@ -59,6 +60,7 @@ struct Settings_;
typedef struct Process_ {
Object super;
const struct ProcessList_* processList;
const struct Settings_* settings;
unsigned long long int time;
@ -99,6 +101,9 @@ typedef struct Process_ {
int exit_signal;
time_t seenTs;
time_t tombTs;
unsigned long int minflt;
unsigned long int majflt;
} Process;
@ -172,6 +177,10 @@ void Process_init(Process* this, const struct Settings_* settings);
void Process_toggleTag(Process* this);
bool Process_isNew(const Process* this);
bool Process_isTomb(const Process* this);
bool Process_setPriority(Process* this, int priority);
bool Process_changePriorityBy(Process* this, Arg delta);