From f80394a20254938142011855f2954b3f63fe5909 Mon Sep 17 00:00:00 2001 From: Daniel Lange Date: Tue, 15 Sep 2020 08:00:00 +0200 Subject: New upstream version 3.0.2 --- openbsd/Battery.h | 2 -- openbsd/OpenBSDCRT.h | 3 --- openbsd/OpenBSDProcess.c | 20 ----------------- openbsd/OpenBSDProcess.h | 10 +-------- openbsd/OpenBSDProcessList.c | 53 ++------------------------------------------ openbsd/OpenBSDProcessList.h | 24 +------------------- openbsd/Platform.c | 8 ------- openbsd/Platform.h | 14 +----------- 8 files changed, 5 insertions(+), 129 deletions(-) (limited to 'openbsd') diff --git a/openbsd/Battery.h b/openbsd/Battery.h index 0f05af3..e858b15 100644 --- a/openbsd/Battery.h +++ b/openbsd/Battery.h @@ -1,5 +1,3 @@ -/* Do not edit this file. It was automatically generated. */ - #ifndef HEADER_Battery #define HEADER_Battery /* diff --git a/openbsd/OpenBSDCRT.h b/openbsd/OpenBSDCRT.h index c48309a..85860a9 100644 --- a/openbsd/OpenBSDCRT.h +++ b/openbsd/OpenBSDCRT.h @@ -1,5 +1,3 @@ -/* Do not edit this file. It was automatically generated. */ - #ifndef HEADER_OpenBSDCRT #define HEADER_OpenBSDCRT /* @@ -12,5 +10,4 @@ in the source distribution for its full text. void CRT_handleSIGSEGV(int sgn); - #endif diff --git a/openbsd/OpenBSDProcess.c b/openbsd/OpenBSDProcess.c index f54c911..1a80784 100644 --- a/openbsd/OpenBSDProcess.c +++ b/openbsd/OpenBSDProcess.c @@ -16,26 +16,6 @@ in the source distribution for its full text. #include #include -/*{ - -typedef enum OpenBSDProcessFields { - // Add platform-specific fields here, with ids >= 100 - LAST_PROCESSFIELD = 100, -} OpenBSDProcessField; - -typedef struct OpenBSDProcess_ { - Process super; -} OpenBSDProcess; - -#ifndef Process_isKernelThread -#define Process_isKernelThread(_process) (_process->pgrp == 0) -#endif - -#ifndef Process_isUserlandThread -#define Process_isUserlandThread(_process) (_process->pid != _process->tgid) -#endif - -}*/ ProcessClass OpenBSDProcess_class = { .super = { diff --git a/openbsd/OpenBSDProcess.h b/openbsd/OpenBSDProcess.h index ba55e5e..fede6f8 100644 --- a/openbsd/OpenBSDProcess.h +++ b/openbsd/OpenBSDProcess.h @@ -1,5 +1,3 @@ -/* Do not edit this file. It was automatically generated. */ - #ifndef HEADER_OpenBSDProcess #define HEADER_OpenBSDProcess /* @@ -10,8 +8,7 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ - -typedef enum OpenBSDProcessFields { +typedef enum OpenBSDProcessFields_ { // Add platform-specific fields here, with ids >= 100 LAST_PROCESSFIELD = 100, } OpenBSDProcessField; @@ -20,14 +17,9 @@ typedef struct OpenBSDProcess_ { Process super; } OpenBSDProcess; -#ifndef Process_isKernelThread #define Process_isKernelThread(_process) (_process->pgrp == 0) -#endif -#ifndef Process_isUserlandThread #define Process_isUserlandThread(_process) (_process->pid != _process->tgid) -#endif - extern ProcessClass OpenBSDProcess_class; diff --git a/openbsd/OpenBSDProcessList.c b/openbsd/OpenBSDProcessList.c index ea40fe1..c5d79f5 100644 --- a/openbsd/OpenBSDProcessList.c +++ b/openbsd/OpenBSDProcessList.c @@ -27,58 +27,9 @@ in the source distribution for its full text. #include #include -/*{ - -#include - -typedef struct CPUData_ { - unsigned long long int totalTime; - unsigned long long int userTime; - unsigned long long int niceTime; - unsigned long long int sysTime; - unsigned long long int sysAllTime; - unsigned long long int spinTime; - unsigned long long int intrTime; - unsigned long long int idleTime; - - unsigned long long int totalPeriod; - unsigned long long int userPeriod; - unsigned long long int nicePeriod; - unsigned long long int sysPeriod; - unsigned long long int sysAllPeriod; - unsigned long long int spinPeriod; - unsigned long long int intrPeriod; - unsigned long long int idlePeriod; -} CPUData; - -typedef struct OpenBSDProcessList_ { - ProcessList super; - kvm_t* kd; - - CPUData* cpus; - -} OpenBSDProcessList; - -}*/ - -/* - * avoid relying on or conflicting with MIN() and MAX() in sys/param.h - */ -#ifndef MINIMUM -#define MINIMUM(x, y) ((x) > (y) ? (y) : (x)) -#endif - -#ifndef MAXIMUM -#define MAXIMUM(x, y) ((x) > (y) ? (x) : (y)) -#endif - -#ifndef CLAMP -#define CLAMP(x, low, high) (((x) > (high)) ? (high) : MAXIMUM(x, low)) -#endif - static long fscale; -ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId) { +ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidMatchList, uid_t userId) { int mib[] = { CTL_HW, HW_NCPU }; int fmib[] = { CTL_KERN, KERN_FSCALE }; int i, e; @@ -90,7 +41,7 @@ ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, ui opl = xCalloc(1, sizeof(OpenBSDProcessList)); pl = (ProcessList*) opl; size = sizeof(pl->cpuCount); - ProcessList_init(pl, Class(OpenBSDProcess), usersTable, pidWhiteList, userId); + ProcessList_init(pl, Class(OpenBSDProcess), usersTable, pidMatchList, userId); e = sysctl(mib, 2, &pl->cpuCount, &size, NULL, 0); if (e == -1 || pl->cpuCount < 1) { diff --git a/openbsd/OpenBSDProcessList.h b/openbsd/OpenBSDProcessList.h index ec9fab2..0d9defb 100644 --- a/openbsd/OpenBSDProcessList.h +++ b/openbsd/OpenBSDProcessList.h @@ -1,5 +1,3 @@ -/* Do not edit this file. It was automatically generated. */ - #ifndef HEADER_OpenBSDProcessList #define HEADER_OpenBSDProcessList /* @@ -10,7 +8,6 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ - #include typedef struct CPUData_ { @@ -42,31 +39,12 @@ typedef struct OpenBSDProcessList_ { } OpenBSDProcessList; -/* - * avoid relying on or conflicting with MIN() and MAX() in sys/param.h - */ -#ifndef MINIMUM -#define MINIMUM(x, y) ((x) > (y) ? (y) : (x)) -#endif - -#ifndef MAXIMUM -#define MAXIMUM(x, y) ((x) > (y) ? (x) : (y)) -#endif - -#ifndef CLAMP -#define CLAMP(x, low, high) (((x) > (high)) ? (high) : MAXIMUM(x, low)) -#endif - -ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId); +ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidMatchList, uid_t userId); void ProcessList_delete(ProcessList* this); char *OpenBSDProcessList_readProcessName(kvm_t* kd, struct kinfo_proc* kproc, int* basenameEnd); -/* - * Taken from OpenBSD's ps(1). - */ void ProcessList_goThroughEntries(ProcessList* this); - #endif diff --git a/openbsd/Platform.c b/openbsd/Platform.c index 0f5279e..cb16207 100644 --- a/openbsd/Platform.c +++ b/openbsd/Platform.c @@ -37,14 +37,6 @@ in the source distribution for its full text. #include #include -/*{ -#include "Action.h" -#include "BatteryMeter.h" -#include "SignalsPanel.h" - -extern ProcessFieldData Process_fields[]; - -}*/ ProcessField Platform_defaultFields[] = { PID, USER, PRIORITY, NICE, M_SIZE, M_RESIDENT, STATE, PERCENT_CPU, PERCENT_MEM, TIME, COMM, 0 }; diff --git a/openbsd/Platform.h b/openbsd/Platform.h index 56e4c40..f51d6bc 100644 --- a/openbsd/Platform.h +++ b/openbsd/Platform.h @@ -1,5 +1,3 @@ -/* Do not edit this file. It was automatically generated. */ - #ifndef HEADER_Platform #define HEADER_Platform /* @@ -16,14 +14,11 @@ in the source distribution for its full text. extern ProcessFieldData Process_fields[]; - extern ProcessField Platform_defaultFields[]; extern int Platform_numberOfFields; -/* - * See /usr/include/sys/signal.h - */ +/* see /usr/include/sys/signal.h */ extern const SignalItem Platform_signals[]; extern const unsigned int Platform_numberOfSignals; @@ -32,7 +27,6 @@ void Platform_setBindings(Htop_Action* keys); extern MeterClass* Platform_meterTypes[]; -// preserved from FreeBSD port int Platform_getUptime(); void Platform_getLoadAverage(double* one, double* five, double* fifteen); @@ -43,12 +37,6 @@ double Platform_setCPUValues(Meter* this, int cpu); void Platform_setMemoryValues(Meter* this); -/* - * Copyright (c) 1994 Thorsten Lockert - * All rights reserved. - * - * Taken almost directly from OpenBSD's top(1) - */ void Platform_setSwapValues(Meter* this); void Platform_setTasksValues(Meter* this); -- cgit v1.2.3