diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-04-28 15:42:50 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-04-28 15:42:50 +0900 |
| commit | ae78dbbff81196f1d7bc8fabf84d05e6b9f3ca03 (patch) | |
| tree | fdc69ee3e2772aa4db7e8efe4bd30d101c7f82ac /fedora/.local/bin/htop-vim/EnvScreen.c | |
| parent | 06ad645351572c0e7188c52028998384d718df2e (diff) | |
Diffstat (limited to 'fedora/.local/bin/htop-vim/EnvScreen.c')
| -rw-r--r-- | fedora/.local/bin/htop-vim/EnvScreen.c | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/fedora/.local/bin/htop-vim/EnvScreen.c b/fedora/.local/bin/htop-vim/EnvScreen.c deleted file mode 100644 index 0fcee83..0000000 --- a/fedora/.local/bin/htop-vim/EnvScreen.c +++ /dev/null @@ -1,58 +0,0 @@ -#include "config.h" // IWYU pragma: keep - -#include "EnvScreen.h" - -#include <stdlib.h> -#include <string.h> - -#include "Macros.h" -#include "Panel.h" -#include "Platform.h" -#include "ProvideCurses.h" -#include "Vector.h" -#include "XUtils.h" - - -EnvScreen* EnvScreen_new(Process* process) { - EnvScreen* this = xMalloc(sizeof(EnvScreen)); - Object_setClass(this, Class(EnvScreen)); - return (EnvScreen*) InfoScreen_init(&this->super, process, NULL, LINES - 2, " "); -} - -void EnvScreen_delete(Object* this) { - free(InfoScreen_done((InfoScreen*)this)); -} - -static void EnvScreen_draw(InfoScreen* this) { - InfoScreen_drawTitled(this, "Environment of process %d - %s", this->process->pid, Process_getCommand(this->process)); -} - -static void EnvScreen_scan(InfoScreen* this) { - Panel* panel = this->display; - int idx = MAXIMUM(Panel_getSelectedIndex(panel), 0); - - Panel_prune(panel); - - char* env = Platform_getProcessEnv(this->process->pid); - if (env) { - for (const char* p = env; *p; p = strrchr(p, 0) + 1) - InfoScreen_addLine(this, p); - free(env); - } - else { - InfoScreen_addLine(this, "Could not read process environment."); - } - - Vector_insertionSort(this->lines); - Vector_insertionSort(panel->items); - Panel_setSelected(panel, idx); -} - -const InfoScreenClass EnvScreen_class = { - .super = { - .extends = Class(Object), - .delete = EnvScreen_delete - }, - .scan = EnvScreen_scan, - .draw = EnvScreen_draw -}; |
