2006-03-04 18:16:49 +00:00
|
|
|
/*
|
|
|
|
htop - htop.c
|
2011-05-26 16:32:50 +00:00
|
|
|
(C) 2004-2011 Hisham H. Muhammad
|
2020-10-05 07:51:32 +00:00
|
|
|
Released under the GNU GPLv2, see the COPYING file
|
2006-03-04 18:16:49 +00:00
|
|
|
in the source distribution for its full text.
|
|
|
|
*/
|
|
|
|
|
2020-09-19 11:55:23 +00:00
|
|
|
#include "config.h" // IWYU pragma: keep
|
2011-12-26 21:35:57 +00:00
|
|
|
|
2020-09-19 11:55:23 +00:00
|
|
|
#include <assert.h>
|
|
|
|
#include <getopt.h>
|
|
|
|
#include <locale.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <time.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
#include "Action.h"
|
2015-01-22 01:27:31 +00:00
|
|
|
#include "CRT.h"
|
2020-09-19 11:55:23 +00:00
|
|
|
#include "Hashtable.h"
|
|
|
|
#include "Header.h"
|
|
|
|
#include "IncSet.h"
|
2015-01-22 01:27:31 +00:00
|
|
|
#include "MainPanel.h"
|
2020-09-11 18:14:56 +00:00
|
|
|
#include "MetersPanel.h"
|
2020-09-19 11:55:23 +00:00
|
|
|
#include "Panel.h"
|
|
|
|
#include "Platform.h"
|
|
|
|
#include "Process.h"
|
2015-01-22 01:27:31 +00:00
|
|
|
#include "ProcessList.h"
|
2020-09-19 11:55:23 +00:00
|
|
|
#include "ProvideCurses.h"
|
2015-01-22 01:27:31 +00:00
|
|
|
#include "ScreenManager.h"
|
|
|
|
#include "Settings.h"
|
|
|
|
#include "UsersTable.h"
|
2020-10-14 18:21:09 +00:00
|
|
|
#include "XUtils.h"
|
2006-03-04 18:16:49 +00:00
|
|
|
|
2020-09-08 12:28:34 +00:00
|
|
|
static void printVersionFlag(void) {
|
2020-11-19 01:32:07 +00:00
|
|
|
fputs(PACKAGE " " VERSION "\n", stdout);
|
2006-03-04 18:16:49 +00:00
|
|
|
}
|
2019-10-31 16:39:12 +00:00
|
|
|
|
2020-09-08 12:28:34 +00:00
|
|
|
static void printHelpFlag(void) {
|
2020-11-19 01:32:07 +00:00
|
|
|
fputs(PACKAGE " " VERSION "\n"
|
2020-10-05 08:16:13 +00:00
|
|
|
COPYRIGHT "\n"
|
2020-10-05 07:51:32 +00:00
|
|
|
"Released under the GNU GPLv2.\n\n"
|
2020-11-18 12:59:36 +00:00
|
|
|
"-C --no-color Use a monochrome color scheme\n"
|
|
|
|
"-d --delay=DELAY Set the delay between updates, in tenths of seconds\n"
|
|
|
|
"-F --filter=FILTER Show only the commands matching the given filter\n"
|
|
|
|
"-h --help Print this help screen\n"
|
2020-11-01 00:36:53 +00:00
|
|
|
"-H --highlight-changes[=DELAY] Highlight new and old processes\n"
|
2020-11-18 12:59:36 +00:00
|
|
|
"-M --no-mouse Disable the mouse\n"
|
2020-11-01 00:36:53 +00:00
|
|
|
"-p --pid=PID[,PID,PID...] Show only the given PIDs\n"
|
2020-11-18 12:59:36 +00:00
|
|
|
"-s --sort-key=COLUMN Sort by COLUMN (try --sort-key=help for a list)\n"
|
|
|
|
"-t --tree Show the tree view by default\n"
|
|
|
|
"-u --user[=USERNAME] Show only processes for a given user (or $USER)\n"
|
|
|
|
"-U --no-unicode Do not use unicode but plain ASCII\n"
|
|
|
|
"-V --version Print version info\n"
|
2010-02-25 02:04:24 +00:00
|
|
|
"\n"
|
|
|
|
"Long options may be passed with a single dash.\n\n"
|
2020-11-19 01:32:07 +00:00
|
|
|
"Press F1 inside " PACKAGE " for online help.\n"
|
|
|
|
"See 'man " PACKAGE "' for more information.\n",
|
2010-02-25 02:04:24 +00:00
|
|
|
stdout);
|
2006-03-04 18:16:49 +00:00
|
|
|
}
|
|
|
|
|
2014-11-20 01:17:52 +00:00
|
|
|
// ----------------------------------------
|
|
|
|
|
2015-01-22 01:27:31 +00:00
|
|
|
typedef struct CommandLineSettings_ {
|
2020-09-09 09:38:15 +00:00
|
|
|
Hashtable* pidMatchList;
|
2020-10-06 20:22:58 +00:00
|
|
|
char* commFilter;
|
2015-01-22 01:27:31 +00:00
|
|
|
uid_t userId;
|
|
|
|
int sortKey;
|
|
|
|
int delay;
|
|
|
|
bool useColors;
|
2019-07-12 19:41:09 +00:00
|
|
|
bool enableMouse;
|
2018-04-05 22:45:55 +00:00
|
|
|
bool treeView;
|
2020-09-01 08:09:00 +00:00
|
|
|
bool allowUnicode;
|
2020-10-31 01:56:16 +00:00
|
|
|
bool highlightChanges;
|
|
|
|
int highlightDelaySecs;
|
2015-01-22 01:27:31 +00:00
|
|
|
} CommandLineSettings;
|
|
|
|
|
|
|
|
static CommandLineSettings parseArguments(int argc, char** argv) {
|
|
|
|
|
|
|
|
CommandLineSettings flags = {
|
2020-09-09 09:38:15 +00:00
|
|
|
.pidMatchList = NULL,
|
2020-10-06 20:22:58 +00:00
|
|
|
.commFilter = NULL,
|
2020-10-15 20:35:44 +00:00
|
|
|
.userId = (uid_t)-1, // -1 is guaranteed to be an invalid uid_t (see setreuid(2))
|
2015-01-22 01:27:31 +00:00
|
|
|
.sortKey = 0,
|
|
|
|
.delay = -1,
|
|
|
|
.useColors = true,
|
2019-07-12 19:41:09 +00:00
|
|
|
.enableMouse = true,
|
2018-04-05 22:45:55 +00:00
|
|
|
.treeView = false,
|
2020-09-01 08:09:00 +00:00
|
|
|
.allowUnicode = true,
|
2020-10-31 01:56:16 +00:00
|
|
|
.highlightChanges = false,
|
|
|
|
.highlightDelaySecs = -1,
|
2015-01-22 01:27:31 +00:00
|
|
|
};
|
2010-02-25 02:04:24 +00:00
|
|
|
|
|
|
|
static struct option long_opts[] =
|
|
|
|
{
|
2020-09-01 08:09:00 +00:00
|
|
|
{"help", no_argument, 0, 'h'},
|
2020-09-17 20:37:03 +00:00
|
|
|
{"version", no_argument, 0, 'V'},
|
2020-09-01 08:09:00 +00:00
|
|
|
{"delay", required_argument, 0, 'd'},
|
|
|
|
{"sort-key", required_argument, 0, 's'},
|
|
|
|
{"user", optional_argument, 0, 'u'},
|
|
|
|
{"no-color", no_argument, 0, 'C'},
|
|
|
|
{"no-colour", no_argument, 0, 'C'},
|
2020-09-16 01:01:36 +00:00
|
|
|
{"no-mouse", no_argument, 0, 'M'},
|
2020-09-01 08:09:00 +00:00
|
|
|
{"no-unicode", no_argument, 0, 'U'},
|
|
|
|
{"tree", no_argument, 0, 't'},
|
|
|
|
{"pid", required_argument, 0, 'p'},
|
2020-10-06 20:22:58 +00:00
|
|
|
{"filter", required_argument, 0, 'F'},
|
2020-10-31 01:56:16 +00:00
|
|
|
{"highlight-changes", optional_argument, 0, 'H'},
|
2010-02-25 02:04:24 +00:00
|
|
|
{0,0,0,0}
|
|
|
|
};
|
2008-03-09 02:33:23 +00:00
|
|
|
|
2015-01-22 01:27:31 +00:00
|
|
|
int opt, opti=0;
|
2010-02-25 02:04:24 +00:00
|
|
|
/* Parse arguments */
|
2020-10-31 01:56:16 +00:00
|
|
|
while ((opt = getopt_long(argc, argv, "hVMCs:td:u::Up:F:H::", long_opts, &opti))) {
|
2010-02-25 02:04:24 +00:00
|
|
|
if (opt == EOF) break;
|
|
|
|
switch (opt) {
|
|
|
|
case 'h':
|
|
|
|
printHelpFlag();
|
2020-09-23 11:55:01 +00:00
|
|
|
exit(0);
|
2020-09-17 20:37:03 +00:00
|
|
|
case 'V':
|
2010-02-25 02:04:24 +00:00
|
|
|
printVersionFlag();
|
2020-09-23 11:55:01 +00:00
|
|
|
exit(0);
|
2010-02-25 02:04:24 +00:00
|
|
|
case 's':
|
2020-09-21 13:06:19 +00:00
|
|
|
assert(optarg); /* please clang analyzer, cause optarg can be NULL in the 'u' case */
|
2020-10-03 19:20:43 +00:00
|
|
|
if (String_eq(optarg, "help")) {
|
2020-12-15 18:44:48 +00:00
|
|
|
for (int j = 1; j < LAST_PROCESSFIELD; j++) {
|
2015-01-22 01:27:31 +00:00
|
|
|
const char* name = Process_fields[j].name;
|
|
|
|
if (name) printf ("%s\n", name);
|
|
|
|
}
|
2010-02-25 02:04:24 +00:00
|
|
|
exit(0);
|
|
|
|
}
|
2020-11-16 15:59:01 +00:00
|
|
|
flags.sortKey = 0;
|
2020-12-15 18:44:48 +00:00
|
|
|
for (int j = 1; j < LAST_PROCESSFIELD; j++) {
|
2020-10-30 16:12:17 +00:00
|
|
|
if (Process_fields[j].name == NULL)
|
|
|
|
continue;
|
|
|
|
if (String_eq(optarg, Process_fields[j].name)) {
|
|
|
|
flags.sortKey = j;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2020-11-16 15:59:01 +00:00
|
|
|
if (flags.sortKey == 0) {
|
2015-10-05 14:27:44 +00:00
|
|
|
fprintf(stderr, "Error: invalid column \"%s\".\n", optarg);
|
2020-06-11 16:44:14 +00:00
|
|
|
exit(1);
|
2015-09-19 16:21:22 +00:00
|
|
|
}
|
2010-02-25 02:04:24 +00:00
|
|
|
break;
|
|
|
|
case 'd':
|
2015-01-22 01:27:31 +00:00
|
|
|
if (sscanf(optarg, "%16d", &(flags.delay)) == 1) {
|
|
|
|
if (flags.delay < 1) flags.delay = 1;
|
|
|
|
if (flags.delay > 100) flags.delay = 100;
|
2011-08-26 21:04:26 +00:00
|
|
|
} else {
|
2015-10-05 14:27:44 +00:00
|
|
|
fprintf(stderr, "Error: invalid delay value \"%s\".\n", optarg);
|
2020-06-11 16:44:14 +00:00
|
|
|
exit(1);
|
2011-08-26 21:04:26 +00:00
|
|
|
}
|
2010-02-25 02:04:24 +00:00
|
|
|
break;
|
|
|
|
case 'u':
|
2020-09-12 16:11:58 +00:00
|
|
|
{
|
|
|
|
const char *username = optarg;
|
|
|
|
if (!username && optind < argc && argv[optind] != NULL &&
|
2020-08-20 03:57:09 +00:00
|
|
|
(argv[optind][0] != '\0' && argv[optind][0] != '-')) {
|
2020-09-12 16:11:58 +00:00
|
|
|
username = argv[optind++];
|
2019-01-30 23:25:08 +00:00
|
|
|
}
|
|
|
|
|
2020-09-12 16:11:58 +00:00
|
|
|
if (!username) {
|
2019-01-30 23:25:08 +00:00
|
|
|
flags.userId = geteuid();
|
2020-09-12 16:11:58 +00:00
|
|
|
} else if (!Action_setUserOnly(username, &(flags.userId))) {
|
|
|
|
fprintf(stderr, "Error: invalid user \"%s\".\n", username);
|
2020-06-11 16:44:14 +00:00
|
|
|
exit(1);
|
2015-09-19 16:21:22 +00:00
|
|
|
}
|
2010-02-25 02:04:24 +00:00
|
|
|
break;
|
2020-09-12 16:11:58 +00:00
|
|
|
}
|
2010-02-25 02:04:24 +00:00
|
|
|
case 'C':
|
2015-01-22 01:27:31 +00:00
|
|
|
flags.useColors = false;
|
2012-08-10 21:54:41 +00:00
|
|
|
break;
|
2020-09-16 01:01:36 +00:00
|
|
|
case 'M':
|
2019-07-12 19:41:09 +00:00
|
|
|
flags.enableMouse = false;
|
|
|
|
break;
|
2020-09-01 08:09:00 +00:00
|
|
|
case 'U':
|
|
|
|
flags.allowUnicode = false;
|
|
|
|
break;
|
2018-04-05 22:45:55 +00:00
|
|
|
case 't':
|
|
|
|
flags.treeView = true;
|
|
|
|
break;
|
2015-01-22 01:27:31 +00:00
|
|
|
case 'p': {
|
2020-09-21 13:06:19 +00:00
|
|
|
assert(optarg); /* please clang analyzer, cause optarg can be NULL in the 'u' case */
|
2016-02-02 14:53:02 +00:00
|
|
|
char* argCopy = xStrdup(optarg);
|
2014-04-21 22:16:16 +00:00
|
|
|
char* saveptr;
|
2015-01-22 01:27:31 +00:00
|
|
|
char* pid = strtok_r(argCopy, ",", &saveptr);
|
2012-08-10 21:54:41 +00:00
|
|
|
|
2020-09-09 09:38:15 +00:00
|
|
|
if(!flags.pidMatchList) {
|
|
|
|
flags.pidMatchList = Hashtable_new(8, false);
|
2012-08-10 21:54:41 +00:00
|
|
|
}
|
|
|
|
|
2015-09-19 16:15:26 +00:00
|
|
|
while(pid) {
|
2012-08-10 21:54:41 +00:00
|
|
|
unsigned int num_pid = atoi(pid);
|
2020-09-24 18:03:33 +00:00
|
|
|
// deepcode ignore CastIntegerToAddress: we just want a non-NUll pointer here
|
2020-09-09 09:38:15 +00:00
|
|
|
Hashtable_put(flags.pidMatchList, num_pid, (void *) 1);
|
2014-04-21 22:16:16 +00:00
|
|
|
pid = strtok_r(NULL, ",", &saveptr);
|
2012-08-10 21:54:41 +00:00
|
|
|
}
|
|
|
|
free(argCopy);
|
|
|
|
|
2010-02-25 02:04:24 +00:00
|
|
|
break;
|
2014-04-21 22:16:16 +00:00
|
|
|
}
|
2020-10-06 20:22:58 +00:00
|
|
|
case 'F': {
|
|
|
|
assert(optarg);
|
|
|
|
flags.commFilter = xStrdup(optarg);
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
2020-10-31 01:56:16 +00:00
|
|
|
case 'H': {
|
|
|
|
const char *delay = optarg;
|
|
|
|
if (!delay && optind < argc && argv[optind] != NULL &&
|
|
|
|
(argv[optind][0] != '\0' && argv[optind][0] != '-')) {
|
|
|
|
delay = argv[optind++];
|
|
|
|
}
|
|
|
|
if (delay) {
|
|
|
|
if (sscanf(delay, "%16d", &(flags.highlightDelaySecs)) == 1) {
|
2020-11-01 00:36:53 +00:00
|
|
|
if (flags.highlightDelaySecs < 1)
|
|
|
|
flags.highlightDelaySecs = 1;
|
2020-10-31 01:56:16 +00:00
|
|
|
} else {
|
|
|
|
fprintf(stderr, "Error: invalid highlight delay value \"%s\".\n", delay);
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
flags.highlightChanges = true;
|
|
|
|
break;
|
|
|
|
}
|
2011-08-26 21:04:26 +00:00
|
|
|
default:
|
|
|
|
exit(1);
|
2006-03-04 18:16:49 +00:00
|
|
|
}
|
|
|
|
}
|
2015-01-22 01:27:31 +00:00
|
|
|
return flags;
|
|
|
|
}
|
2010-02-25 02:04:24 +00:00
|
|
|
|
2015-01-22 01:27:31 +00:00
|
|
|
static void millisleep(unsigned long millisec) {
|
|
|
|
struct timespec req = {
|
|
|
|
.tv_sec = 0,
|
|
|
|
.tv_nsec = millisec * 1000000L
|
|
|
|
};
|
|
|
|
while(nanosleep(&req,&req)==-1) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-06 20:22:58 +00:00
|
|
|
static void setCommFilter(State* state, char** commFilter) {
|
|
|
|
MainPanel* panel = (MainPanel*)state->panel;
|
|
|
|
ProcessList* pl = state->pl;
|
|
|
|
IncSet* inc = panel->inc;
|
|
|
|
size_t maxlen = sizeof(inc->modes[INC_FILTER].buffer) - 1;
|
|
|
|
char* buffer = inc->modes[INC_FILTER].buffer;
|
|
|
|
|
|
|
|
strncpy(buffer, *commFilter, maxlen);
|
|
|
|
buffer[maxlen] = 0;
|
|
|
|
inc->modes[INC_FILTER].index = strlen(buffer);
|
|
|
|
inc->filtering = true;
|
|
|
|
pl->incFilter = IncSet_filter(inc);
|
|
|
|
|
|
|
|
free(*commFilter);
|
|
|
|
*commFilter = NULL;
|
|
|
|
}
|
|
|
|
|
2015-01-22 01:27:31 +00:00
|
|
|
int main(int argc, char** argv) {
|
|
|
|
|
2020-12-02 17:08:53 +00:00
|
|
|
/* initialize locale */
|
|
|
|
const char* lc_ctype;
|
|
|
|
if ((lc_ctype = getenv("LC_CTYPE")) || (lc_ctype = getenv("LC_ALL")))
|
2015-01-22 01:27:31 +00:00
|
|
|
setlocale(LC_CTYPE, lc_ctype);
|
2020-11-19 01:32:07 +00:00
|
|
|
else
|
2015-01-22 01:27:31 +00:00
|
|
|
setlocale(LC_CTYPE, "");
|
|
|
|
|
2020-11-19 01:32:07 +00:00
|
|
|
CommandLineSettings flags = parseArguments(argc, argv);
|
2010-02-25 02:04:24 +00:00
|
|
|
|
2020-11-19 01:32:07 +00:00
|
|
|
Platform_init();
|
2019-10-31 16:39:12 +00:00
|
|
|
|
2014-11-27 22:10:23 +00:00
|
|
|
Process_setupColumnWidths();
|
2019-10-31 16:39:12 +00:00
|
|
|
|
2015-01-22 01:27:31 +00:00
|
|
|
UsersTable* ut = UsersTable_new();
|
2020-09-09 09:38:15 +00:00
|
|
|
ProcessList* pl = ProcessList_new(ut, flags.pidMatchList, flags.userId);
|
2019-10-31 16:39:12 +00:00
|
|
|
|
2015-01-22 01:27:31 +00:00
|
|
|
Settings* settings = Settings_new(pl->cpuCount);
|
|
|
|
pl->settings = settings;
|
|
|
|
|
2015-01-23 05:08:21 +00:00
|
|
|
Header* header = Header_new(pl, settings, 2);
|
|
|
|
|
|
|
|
Header_populateFromSettings(header);
|
|
|
|
|
2020-11-19 01:32:07 +00:00
|
|
|
if (flags.delay != -1)
|
2015-01-22 01:27:31 +00:00
|
|
|
settings->delay = flags.delay;
|
2020-11-19 01:32:07 +00:00
|
|
|
if (!flags.useColors)
|
2010-02-25 02:04:24 +00:00
|
|
|
settings->colorScheme = COLORSCHEME_MONOCHROME;
|
2020-11-19 01:32:07 +00:00
|
|
|
if (!flags.enableMouse)
|
2019-07-12 19:41:09 +00:00
|
|
|
settings->enableMouse = false;
|
2020-11-19 01:32:07 +00:00
|
|
|
if (flags.treeView)
|
2018-04-05 22:45:55 +00:00
|
|
|
settings->treeView = true;
|
2020-11-19 01:32:07 +00:00
|
|
|
if (flags.highlightChanges)
|
2020-10-31 01:56:16 +00:00
|
|
|
settings->highlightChanges = true;
|
2020-11-19 01:32:07 +00:00
|
|
|
if (flags.highlightDelaySecs != -1)
|
2020-10-31 01:56:16 +00:00
|
|
|
settings->highlightDelaySecs = flags.highlightDelaySecs;
|
2020-11-24 14:51:53 +00:00
|
|
|
if (flags.sortKey > 0) {
|
2020-12-18 14:03:31 +00:00
|
|
|
// -t -s <key> means "tree sorted by key"
|
|
|
|
// -s <key> means "list sorted by key" (previous existing behavior)
|
|
|
|
if (!flags.treeView) {
|
|
|
|
settings->treeView = false;
|
|
|
|
}
|
|
|
|
Settings_setSortKey(settings, flags.sortKey);
|
2020-11-24 14:51:53 +00:00
|
|
|
}
|
2011-11-03 22:12:12 +00:00
|
|
|
|
2020-11-21 20:40:08 +00:00
|
|
|
CRT_init(&(settings->delay), settings->colorScheme, flags.allowUnicode);
|
2019-10-31 16:39:12 +00:00
|
|
|
|
2015-03-23 18:26:56 +00:00
|
|
|
MainPanel* panel = MainPanel_new();
|
2015-01-22 01:27:31 +00:00
|
|
|
ProcessList_setPanel(pl, (Panel*) panel);
|
|
|
|
|
2015-03-23 18:26:56 +00:00
|
|
|
MainPanel_updateTreeFunctions(panel, settings->treeView);
|
2019-10-31 16:39:12 +00:00
|
|
|
|
2015-01-22 01:27:31 +00:00
|
|
|
ProcessList_printHeader(pl, Panel_getHeader((Panel*)panel));
|
2006-03-04 18:16:49 +00:00
|
|
|
|
2015-01-22 01:27:31 +00:00
|
|
|
State state = {
|
|
|
|
.settings = settings,
|
|
|
|
.ut = ut,
|
|
|
|
.pl = pl,
|
|
|
|
.panel = (Panel*) panel,
|
|
|
|
.header = header,
|
2020-10-05 13:14:54 +00:00
|
|
|
.pauseProcessUpdate = false,
|
2020-11-23 15:23:18 +00:00
|
|
|
.hideProcessSelection = false,
|
2015-01-22 01:27:31 +00:00
|
|
|
};
|
2020-10-06 20:22:58 +00:00
|
|
|
|
2015-01-22 01:27:31 +00:00
|
|
|
MainPanel_setState(panel, &state);
|
2020-11-19 01:32:07 +00:00
|
|
|
if (flags.commFilter)
|
2020-10-06 20:22:58 +00:00
|
|
|
setCommFilter(&state, &(flags.commFilter));
|
2019-10-31 16:39:12 +00:00
|
|
|
|
2020-11-26 05:15:09 +00:00
|
|
|
ScreenManager* scr = ScreenManager_new(header, settings, &state, true);
|
2015-03-23 18:26:56 +00:00
|
|
|
ScreenManager_add(scr, (Panel*) panel, -1);
|
2015-01-22 01:27:31 +00:00
|
|
|
|
2020-10-13 14:03:37 +00:00
|
|
|
ProcessList_scan(pl, false);
|
2014-04-21 22:37:57 +00:00
|
|
|
millisleep(75);
|
2020-10-13 14:03:37 +00:00
|
|
|
ProcessList_scan(pl, false);
|
2015-01-22 01:27:31 +00:00
|
|
|
|
2019-10-31 16:39:12 +00:00
|
|
|
ScreenManager_run(scr, NULL, NULL);
|
|
|
|
|
2006-03-04 18:16:49 +00:00
|
|
|
attron(CRT_colors[RESET_COLOR]);
|
|
|
|
mvhline(LINES-1, 0, ' ', COLS);
|
|
|
|
attroff(CRT_colors[RESET_COLOR]);
|
|
|
|
refresh();
|
2019-10-31 16:39:12 +00:00
|
|
|
|
2020-11-19 01:32:07 +00:00
|
|
|
Platform_done();
|
2020-09-10 17:56:33 +00:00
|
|
|
|
2006-03-04 18:16:49 +00:00
|
|
|
CRT_done();
|
|
|
|
if (settings->changed)
|
|
|
|
Settings_write(settings);
|
|
|
|
Header_delete(header);
|
|
|
|
ProcessList_delete(pl);
|
2015-01-22 01:27:31 +00:00
|
|
|
|
|
|
|
ScreenManager_delete(scr);
|
2020-09-11 18:14:56 +00:00
|
|
|
MetersPanel_cleanup();
|
2019-10-31 16:39:12 +00:00
|
|
|
|
2006-03-04 18:16:49 +00:00
|
|
|
UsersTable_delete(ut);
|
|
|
|
Settings_delete(settings);
|
2019-10-31 16:39:12 +00:00
|
|
|
|
2020-11-19 01:32:07 +00:00
|
|
|
if (flags.pidMatchList)
|
2020-09-09 09:38:15 +00:00
|
|
|
Hashtable_delete(flags.pidMatchList);
|
2020-11-19 01:32:07 +00:00
|
|
|
|
2006-03-04 18:16:49 +00:00
|
|
|
return 0;
|
|
|
|
}
|