mirror of https://github.com/xzeldon/htop.git
Updates for new version of the MakeHeader.py script.
This commit is contained in:
parent
b95993fa22
commit
2f1f82ee87
|
@ -3,6 +3,7 @@
|
|||
#include "Settings.h"
|
||||
#include "Header.h"
|
||||
#include "ScreenManager.h"
|
||||
#include "CPUMeter.h"
|
||||
|
||||
#include "Panel.h"
|
||||
|
||||
|
@ -63,8 +64,7 @@ void AvailableMetersPanel_delete(Object* object) {
|
|||
free(this);
|
||||
}
|
||||
|
||||
/* private */
|
||||
inline void AvailableMetersPanel_addHeader(Header* header, Panel* panel, MeterType* type, int param, HeaderSide side) {
|
||||
static inline void AvailableMetersPanel_addHeader(Header* header, Panel* panel, MeterType* type, int param, HeaderSide side) {
|
||||
Meter* meter = (Meter*) Header_addMeter(header, type, param, side);
|
||||
Panel_add(panel, (Object*) Meter_toListItem(meter));
|
||||
}
|
||||
|
|
|
@ -18,10 +18,10 @@ in the source distribution for its full text.
|
|||
#include "debug.h"
|
||||
#include <assert.h>
|
||||
|
||||
/* private property */
|
||||
static int CPUMeter_attributes[] = { CPU_NICE, CPU_NORMAL, CPU_KERNEL };
|
||||
int CPUMeter_attributes[] = {
|
||||
CPU_NICE, CPU_NORMAL, CPU_KERNEL
|
||||
};
|
||||
|
||||
/* private */
|
||||
MeterType CPUMeter = {
|
||||
.setValues = CPUMeter_setValues,
|
||||
.display = CPUMeter_display,
|
||||
|
@ -35,7 +35,6 @@ MeterType CPUMeter = {
|
|||
.init = CPUMeter_init
|
||||
};
|
||||
|
||||
/* private */
|
||||
MeterType AllCPUsMeter = {
|
||||
.mode = 0,
|
||||
.items = 1,
|
||||
|
|
15
CRT.c
15
CRT.c
|
@ -96,24 +96,15 @@ typedef enum ColorElements_ {
|
|||
LAST_COLORELEMENT
|
||||
} ColorElements;
|
||||
|
||||
extern int CRT_delay;
|
||||
|
||||
extern int CRT_colors[LAST_COLORELEMENT];
|
||||
|
||||
extern int CRT_colorScheme;
|
||||
|
||||
}*/
|
||||
|
||||
// TODO: centralize these in Settings.
|
||||
|
||||
/* private property */
|
||||
int CRT_delay;
|
||||
int CRT_delay = 0;
|
||||
|
||||
/* private property */
|
||||
int CRT_colorScheme;
|
||||
int CRT_colorScheme = 0;
|
||||
|
||||
/* private property */
|
||||
int CRT_colors[LAST_COLORELEMENT];
|
||||
int CRT_colors[LAST_COLORELEMENT] = { 0 };
|
||||
|
||||
// TODO: pass an instance of Settings instead.
|
||||
|
||||
|
|
|
@ -23,23 +23,17 @@ typedef struct CategoriesPanel_ {
|
|||
|
||||
}*/
|
||||
|
||||
/* private property */
|
||||
char* MetersFunctions[10] = {" ", " ", " ", "Type ", " ", " ", "MoveUp", "MoveDn", "Remove", "Done "};
|
||||
static char* MetersFunctions[10] = {" ", " ", " ", "Type ", " ", " ", "MoveUp", "MoveDn", "Remove", "Done "};
|
||||
|
||||
/* private property */
|
||||
char* AvailableMetersFunctions[10] = {" ", " ", " ", " ", "Add L ", "Add R ", " ", " ", " ", "Done "};
|
||||
static char* AvailableMetersFunctions[10] = {" ", " ", " ", " ", "Add L ", "Add R ", " ", " ", " ", "Done "};
|
||||
|
||||
/* private property */
|
||||
char* DisplayOptionsFunctions[10] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", "Done "};
|
||||
static char* DisplayOptionsFunctions[10] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", "Done "};
|
||||
|
||||
/* private property */
|
||||
char* ColumnsFunctions[10] = {" ", " ", " ", " ", " ", " ", "MoveUp", "MoveDn", "Remove", "Done "};
|
||||
static char* ColumnsFunctions[10] = {" ", " ", " ", " ", " ", " ", "MoveUp", "MoveDn", "Remove", "Done "};
|
||||
|
||||
/* private property */
|
||||
char* ColorsFunctions[10] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", "Done "};
|
||||
static char* ColorsFunctions[10] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", "Done "};
|
||||
|
||||
/* private property */
|
||||
char* AvailableColumnsFunctions[10] = {" ", " ", " ", " ", "Add ", " ", " ", " ", " ", "Done "};
|
||||
static char* AvailableColumnsFunctions[10] = {" ", " ", " ", " ", "Add ", " ", " ", " ", " ", "Done "};
|
||||
|
||||
CategoriesPanel* CategoriesPanel_new(Settings* settings, ScreenManager* scr) {
|
||||
CategoriesPanel* this = (CategoriesPanel*) malloc(sizeof(CategoriesPanel));
|
||||
|
|
|
@ -19,10 +19,8 @@ typedef struct CheckItem_ {
|
|||
bool* value;
|
||||
} CheckItem;
|
||||
|
||||
extern char* CHECKITEM_CLASS;
|
||||
}*/
|
||||
|
||||
/* private property */
|
||||
char* CHECKITEM_CLASS = "CheckItem";
|
||||
|
||||
CheckItem* CheckItem_new(char* text, bool* value) {
|
||||
|
|
|
@ -12,10 +12,10 @@ in the source distribution for its full text.
|
|||
|
||||
#include "debug.h"
|
||||
|
||||
/* private */
|
||||
static int ClockMeter_attributes[] = { CLOCK };
|
||||
int ClockMeter_attributes[] = {
|
||||
CLOCK
|
||||
};
|
||||
|
||||
/* private */
|
||||
MeterType ClockMeter = {
|
||||
.setValues = ClockMeter_setValues,
|
||||
.display = NULL,
|
||||
|
|
|
@ -28,7 +28,6 @@ typedef struct ColorsPanel_ {
|
|||
|
||||
}*/
|
||||
|
||||
/* private */
|
||||
static char* ColorSchemes[] = {
|
||||
"Default",
|
||||
"Monochromatic",
|
||||
|
|
|
@ -28,20 +28,14 @@ typedef struct FunctionBar_ {
|
|||
bool staticData;
|
||||
} FunctionBar;
|
||||
|
||||
extern char* FUNCTIONBAR_CLASS;
|
||||
|
||||
}*/
|
||||
|
||||
/* private property */
|
||||
char* FUNCTIONBAR_CLASS = "FunctionBar";
|
||||
|
||||
/* private property */
|
||||
static char* FunctionBar_FKeys[10] = {"F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10"};
|
||||
|
||||
/* private property */
|
||||
static char* FunctionBar_FLabels[10] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", " "};
|
||||
|
||||
/* private property */
|
||||
static int FunctionBar_FEvents[10] = {KEY_F(1), KEY_F(2), KEY_F(3), KEY_F(4), KEY_F(5), KEY_F(6), KEY_F(7), KEY_F(8), KEY_F(9), KEY_F(10)};
|
||||
|
||||
FunctionBar* FunctionBar_new(int size, char** functions, char** keys, int* events) {
|
||||
|
|
|
@ -21,10 +21,8 @@ typedef struct ListItem_ {
|
|||
int key;
|
||||
} ListItem;
|
||||
|
||||
extern char* LISTITEM_CLASS;
|
||||
}*/
|
||||
|
||||
/* private property */
|
||||
char* LISTITEM_CLASS = "ListItem";
|
||||
|
||||
ListItem* ListItem_new(char* value, int key) {
|
||||
|
|
|
@ -12,10 +12,10 @@ in the source distribution for its full text.
|
|||
|
||||
#include "debug.h"
|
||||
|
||||
/* private property */
|
||||
int LoadAverageMeter_attributes[] = { LOAD_AVERAGE_FIFTEEN, LOAD_AVERAGE_FIVE, LOAD_AVERAGE_ONE };
|
||||
int LoadAverageMeter_attributes[] = {
|
||||
LOAD_AVERAGE_FIFTEEN, LOAD_AVERAGE_FIVE, LOAD_AVERAGE_ONE
|
||||
};
|
||||
|
||||
/* private */
|
||||
MeterType LoadAverageMeter = {
|
||||
.setValues = LoadAverageMeter_setValues,
|
||||
.display = LoadAverageMeter_display,
|
||||
|
@ -28,10 +28,8 @@ MeterType LoadAverageMeter = {
|
|||
.caption = "Load average: "
|
||||
};
|
||||
|
||||
/* private property */
|
||||
int LoadMeter_attributes[] = { LOAD };
|
||||
|
||||
/* private */
|
||||
MeterType LoadMeter = {
|
||||
.setValues = LoadMeter_setValues,
|
||||
.display = LoadMeter_display,
|
||||
|
@ -44,8 +42,7 @@ MeterType LoadMeter = {
|
|||
.caption = "Load: "
|
||||
};
|
||||
|
||||
/* private */
|
||||
inline static void LoadAverageMeter_scan(double* one, double* five, double* fifteen) {
|
||||
static inline void LoadAverageMeter_scan(double* one, double* five, double* fifteen) {
|
||||
int activeProcs, totalProcs, lastProc;
|
||||
FILE *fd = fopen(PROCDIR "/loadavg", "r");
|
||||
int read = fscanf(fd, "%lf %lf %lf %d/%d %d", one, five, fifteen,
|
||||
|
|
|
@ -19,10 +19,10 @@ in the source distribution for its full text.
|
|||
#include "debug.h"
|
||||
#include <assert.h>
|
||||
|
||||
/* private property */
|
||||
static int MemoryMeter_attributes[] = { MEMORY_USED, MEMORY_BUFFERS, MEMORY_CACHE };
|
||||
int MemoryMeter_attributes[] = {
|
||||
MEMORY_USED, MEMORY_BUFFERS, MEMORY_CACHE
|
||||
};
|
||||
|
||||
/* private */
|
||||
MeterType MemoryMeter = {
|
||||
.setValues = MemoryMeter_setValues,
|
||||
.display = MemoryMeter_display,
|
||||
|
|
55
Meter.c
55
Meter.c
|
@ -76,18 +76,6 @@ struct Meter_ {
|
|||
double total;
|
||||
};
|
||||
|
||||
extern char* METER_CLASS;
|
||||
|
||||
extern MeterType CPUMeter;
|
||||
extern MeterType ClockMeter;
|
||||
extern MeterType LoadAverageMeter;
|
||||
extern MeterType LoadMeter;
|
||||
extern MeterType MemoryMeter;
|
||||
extern MeterType SwapMeter;
|
||||
extern MeterType TasksMeter;
|
||||
extern MeterType UptimeMeter;
|
||||
extern MeterType AllCPUsMeter;
|
||||
|
||||
typedef enum {
|
||||
CUSTOM_METERMODE = 0,
|
||||
BAR_METERMODE,
|
||||
|
@ -99,11 +87,16 @@ typedef enum {
|
|||
LAST_METERMODE
|
||||
} MeterModeId;
|
||||
|
||||
extern MeterType* Meter_types[];
|
||||
extern MeterMode* Meter_modes[];
|
||||
|
||||
}*/
|
||||
|
||||
#include "CPUMeter.h"
|
||||
#include "MemoryMeter.h"
|
||||
#include "SwapMeter.h"
|
||||
#include "TasksMeter.h"
|
||||
#include "LoadAverageMeter.h"
|
||||
#include "UptimeMeter.h"
|
||||
#include "ClockMeter.h"
|
||||
|
||||
#ifndef MIN
|
||||
#define MIN(a,b) ((a)<(b)?(a):(b))
|
||||
#endif
|
||||
|
@ -111,10 +104,8 @@ extern MeterMode* Meter_modes[];
|
|||
#define MAX(a,b) ((a)>(b)?(a):(b))
|
||||
#endif
|
||||
|
||||
/* private property */
|
||||
char* METER_CLASS = "Meter";
|
||||
|
||||
/* private */
|
||||
MeterType* Meter_types[] = {
|
||||
&CPUMeter,
|
||||
&ClockMeter,
|
||||
|
@ -128,14 +119,12 @@ MeterType* Meter_types[] = {
|
|||
NULL
|
||||
};
|
||||
|
||||
/* private */
|
||||
static MeterMode BarMeterMode = {
|
||||
.uiName = "Bar",
|
||||
.h = 1,
|
||||
.draw = BarMeterMode_draw,
|
||||
};
|
||||
|
||||
/* private */
|
||||
static MeterMode TextMeterMode = {
|
||||
.uiName = "Text",
|
||||
.h = 1,
|
||||
|
@ -143,22 +132,21 @@ static MeterMode TextMeterMode = {
|
|||
};
|
||||
|
||||
#ifdef USE_FUNKY_MODES
|
||||
/* private */
|
||||
|
||||
static MeterMode GraphMeterMode = {
|
||||
.uiName = "Graph",
|
||||
.h = 3,
|
||||
.draw = GraphMeterMode_draw,
|
||||
};
|
||||
|
||||
/* private */
|
||||
static MeterMode LEDMeterMode = {
|
||||
.uiName = "LED",
|
||||
.h = 3,
|
||||
.draw = LEDMeterMode_draw,
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
/* private */
|
||||
MeterMode* Meter_modes[] = {
|
||||
NULL,
|
||||
&BarMeterMode,
|
||||
|
@ -170,7 +158,6 @@ MeterMode* Meter_modes[] = {
|
|||
NULL
|
||||
};
|
||||
|
||||
/* private property */
|
||||
static RichString Meter_stringBuffer;
|
||||
|
||||
Meter* Meter_new(ProcessList* pl, int param, MeterType* type) {
|
||||
|
@ -209,8 +196,7 @@ void Meter_setCaption(Meter* this, char* caption) {
|
|||
this->caption = strdup(caption);
|
||||
}
|
||||
|
||||
/* private */
|
||||
inline static void Meter_displayToStringBuffer(Meter* this, char* buffer) {
|
||||
static inline void Meter_displayToStringBuffer(Meter* this, char* buffer) {
|
||||
MeterType* type = this->type;
|
||||
Object_Display display = ((Object*)this)->display;
|
||||
if (display) {
|
||||
|
@ -281,8 +267,7 @@ void TextMeterMode_draw(Meter* this, int x, int y, int w) {
|
|||
|
||||
/* ---------- BarMeterMode ---------- */
|
||||
|
||||
/* private property */
|
||||
char BarMeterMode_characters[] = "|#*@$%&";
|
||||
static char BarMeterMode_characters[] = "|#*@$%&";
|
||||
|
||||
void BarMeterMode_draw(Meter* this, int x, int y, int w) {
|
||||
MeterType* type = this->type;
|
||||
|
@ -360,14 +345,16 @@ void BarMeterMode_draw(Meter* this, int x, int y, int w) {
|
|||
|
||||
#define DrawDot(a,y,c) do { attrset(a); mvaddch(y, x+k, c); } while(0)
|
||||
|
||||
/* private */
|
||||
static int GraphMeterMode_colors[21] = {GRAPH_1, GRAPH_1, GRAPH_1,
|
||||
GRAPH_2, GRAPH_2, GRAPH_2, GRAPH_3, GRAPH_3, GRAPH_3,
|
||||
GRAPH_4, GRAPH_4, GRAPH_4, GRAPH_5, GRAPH_5, GRAPH_6,
|
||||
GRAPH_7, GRAPH_7, GRAPH_7, GRAPH_8, GRAPH_8, GRAPH_9
|
||||
static int GraphMeterMode_colors[21] = {
|
||||
GRAPH_1, GRAPH_1, GRAPH_1,
|
||||
GRAPH_2, GRAPH_2, GRAPH_2,
|
||||
GRAPH_3, GRAPH_3, GRAPH_3,
|
||||
GRAPH_4, GRAPH_4, GRAPH_4,
|
||||
GRAPH_5, GRAPH_5, GRAPH_6,
|
||||
GRAPH_7, GRAPH_7, GRAPH_7,
|
||||
GRAPH_8, GRAPH_8, GRAPH_9
|
||||
};
|
||||
|
||||
/* private property */
|
||||
static char* GraphMeterMode_characters = "^`'-.,_~'`-.,_~'`-.,_";
|
||||
|
||||
void GraphMeterMode_draw(Meter* this, int x, int y, int w) {
|
||||
|
@ -405,14 +392,12 @@ void GraphMeterMode_draw(Meter* this, int x, int y, int w) {
|
|||
|
||||
/* ---------- LEDMeterMode ---------- */
|
||||
|
||||
/* private */
|
||||
static char* LEDMeterMode_digits[3][10] = {
|
||||
{ " __ "," "," __ "," __ "," "," __ "," __ "," __ "," __ "," __ "},
|
||||
{ "| |"," |"," __|"," __|","|__|","|__ ","|__ "," |","|__|","|__|"},
|
||||
{ "|__|"," |","|__ "," __|"," |"," __|","|__|"," |","|__|"," __|"},
|
||||
};
|
||||
|
||||
/* private */
|
||||
static void LEDMeterMode_drawDigit(int x, int y, int n) {
|
||||
for (int i = 0; i < 3; i++)
|
||||
mvaddstr(y+i, x, LEDMeterMode_digits[i][n]);
|
||||
|
|
3
Object.c
3
Object.c
|
@ -29,8 +29,7 @@ struct Object_ {
|
|||
};
|
||||
}*/
|
||||
|
||||
/* private property */
|
||||
char* OBJECT_CLASS = "Object";
|
||||
static char* OBJECT_CLASS = "Object";
|
||||
|
||||
void Object_new() {
|
||||
Object* this;
|
||||
|
|
3
Panel.c
3
Panel.c
|
@ -45,8 +45,6 @@ struct Panel_ {
|
|||
Panel_EventHandler eventHandler;
|
||||
};
|
||||
|
||||
extern char* PANEL_CLASS;
|
||||
|
||||
}*/
|
||||
|
||||
#ifndef MIN
|
||||
|
@ -56,7 +54,6 @@ extern char* PANEL_CLASS;
|
|||
#define MAX(a,b) ((a)>(b)?(a):(b))
|
||||
#endif
|
||||
|
||||
/* private property */
|
||||
char* PANEL_CLASS = "Panel";
|
||||
|
||||
Panel* Panel_new(int x, int y, int w, int h, char* type, bool owner) {
|
||||
|
|
20
Process.c
20
Process.c
|
@ -104,17 +104,13 @@ typedef struct Process_ {
|
|||
char user[PROCESS_USER_LEN + 1];
|
||||
} Process;
|
||||
|
||||
extern char* PROCESS_CLASS;
|
||||
|
||||
extern char* Process_fieldNames[];
|
||||
|
||||
}*/
|
||||
|
||||
/* private property */
|
||||
char* PROCESS_CLASS = "Process";
|
||||
|
||||
/* private property */
|
||||
char *Process_fieldNames[] = { "", "PID", "Command", "STATE", "PPID", "PGRP", "SESSION", "TTY_NR", "TPGID", "FLAGS", "MINFLT", "CMINFLT", "MAJFLT", "CMAJFLT", "UTIME", "STIME", "CUTIME", "CSTIME", "PRIORITY", "NICE", "ITREALVALUE", "STARTTIME", "VSIZE", "RSS", "RLIM", "STARTCODE", "ENDCODE", "STARTSTACK", "KSTKESP", "KSTKEIP", "SIGNAL", "BLOCKED", "SIGIGNORE", "SIGCATCH", "WCHAN", "NSWAP", "CNSWAP", "EXIT_SIGNAL", "PROCESSOR", "M_SIZE", "M_RESIDENT", "M_SHARE", "M_TRS", "M_DRS", "M_LRS", "M_DT", "ST_UID", "PERCENT_CPU", "PERCENT_MEM", "USER", "TIME", "*** report bug! ***"};
|
||||
char *Process_fieldNames[] = {
|
||||
"", "PID", "Command", "STATE", "PPID", "PGRP", "SESSION", "TTY_NR", "TPGID", "FLAGS", "MINFLT", "CMINFLT", "MAJFLT", "CMAJFLT", "UTIME", "STIME", "CUTIME", "CSTIME", "PRIORITY", "NICE", "ITREALVALUE", "STARTTIME", "VSIZE", "RSS", "RLIM", "STARTCODE", "ENDCODE", "STARTSTACK", "KSTKESP", "KSTKEIP", "SIGNAL", "BLOCKED", "SIGIGNORE", "SIGCATCH", "WCHAN", "NSWAP", "CNSWAP", "EXIT_SIGNAL", "PROCESSOR", "M_SIZE", "M_RESIDENT", "M_SHARE", "M_TRS", "M_DRS", "M_LRS", "M_DT", "ST_UID", "PERCENT_CPU", "PERCENT_MEM", "USER", "TIME", "*** report bug! ***"
|
||||
};
|
||||
|
||||
Process* Process_new(struct ProcessList_ *pl) {
|
||||
Process* this = malloc(sizeof(Process));
|
||||
|
@ -177,8 +173,7 @@ void Process_sendSignal(Process* this, int signal) {
|
|||
#define ONE_M (ONE_K * ONE_K)
|
||||
#define ONE_G (ONE_M * ONE_K)
|
||||
|
||||
/* private */
|
||||
void Process_printLargeNumber(Process* this, RichString *str, unsigned int number) {
|
||||
static void Process_printLargeNumber(Process* this, RichString *str, unsigned int number) {
|
||||
char buffer[11];
|
||||
int len;
|
||||
if(number >= (1000 * ONE_M)) {
|
||||
|
@ -202,10 +197,8 @@ void Process_printLargeNumber(Process* this, RichString *str, unsigned int numbe
|
|||
}
|
||||
}
|
||||
|
||||
/* private property */
|
||||
double jiffy = 0.0;
|
||||
static double jiffy = 0.0;
|
||||
|
||||
/* private */
|
||||
static void Process_printTime(RichString* str, unsigned long t) {
|
||||
if(jiffy == 0.0) jiffy = sysconf(_SC_CLK_TCK);
|
||||
double jiffytime = 1.0 / jiffy;
|
||||
|
@ -228,8 +221,7 @@ static void Process_printTime(RichString* str, unsigned long t) {
|
|||
RichString_append(str, CRT_colors[DEFAULT_COLOR], buffer);
|
||||
}
|
||||
|
||||
/* private */
|
||||
inline static void Process_writeCommand(Process* this, int attr, RichString* str) {
|
||||
static inline void Process_writeCommand(Process* this, int attr, RichString* str) {
|
||||
if (this->pl->highlightBaseName) {
|
||||
char* firstSpace = strchr(this->comm, ' ');
|
||||
if (firstSpace) {
|
||||
|
|
|
@ -104,24 +104,20 @@ typedef struct ProcessList_ {
|
|||
} ProcessList;
|
||||
}*/
|
||||
|
||||
/* private property */
|
||||
ProcessField defaultHeaders[] = { PID, USER, PRIORITY, NICE, M_SIZE, M_RESIDENT, M_SHARE, STATE, PERCENT_CPU, PERCENT_MEM, TIME, COMM, 0 };
|
||||
static ProcessField defaultHeaders[] = { PID, USER, PRIORITY, NICE, M_SIZE, M_RESIDENT, M_SHARE, STATE, PERCENT_CPU, PERCENT_MEM, TIME, COMM, 0 };
|
||||
|
||||
#ifdef DEBUG
|
||||
|
||||
/* private property */
|
||||
typedef int(*vxscanf)(void*, const char*, va_list);
|
||||
|
||||
#define ProcessList_read(this, buffer, format, ...) ProcessList_xread(this, (vxscanf) vsscanf, buffer, format, ## __VA_ARGS__ )
|
||||
#define ProcessList_fread(this, file, format, ...) ProcessList_xread(this, (vxscanf) vfscanf, file, format, ## __VA_ARGS__ )
|
||||
|
||||
/* private */
|
||||
FILE* ProcessList_fopen(ProcessList* this, const char* path, const char* mode) {
|
||||
static FILE* ProcessList_fopen(ProcessList* this, const char* path, const char* mode) {
|
||||
fprintf(this->traceFile, "[%s]\n", path);
|
||||
return fopen(path, mode);
|
||||
}
|
||||
|
||||
/* private */
|
||||
static inline int ProcessList_xread(ProcessList* this, vxscanf fn, void* buffer, char* format, ...) {
|
||||
va_list ap;
|
||||
va_start(ap, format);
|
||||
|
@ -305,8 +301,7 @@ int ProcessList_size(ProcessList* this) {
|
|||
return (Vector_size(this->processes));
|
||||
}
|
||||
|
||||
/* private */
|
||||
void ProcessList_buildTree(ProcessList* this, int pid, int level, int indent, int direction) {
|
||||
static void ProcessList_buildTree(ProcessList* this, int pid, int level, int indent, int direction) {
|
||||
Vector* children = Vector_new(PROCESS_CLASS, false, DEFAULT_SIZE);
|
||||
|
||||
for (int i = 0; i < Vector_size(this->processes); i++) {
|
||||
|
@ -355,8 +350,7 @@ void ProcessList_sort(ProcessList* this) {
|
|||
}
|
||||
}
|
||||
|
||||
/* private */
|
||||
int ProcessList_readStatFile(ProcessList* this, Process *proc, FILE *f, char *command) {
|
||||
static int ProcessList_readStatFile(ProcessList* this, Process *proc, FILE *f, char *command) {
|
||||
static char buf[MAX_READ];
|
||||
long int zero;
|
||||
|
||||
|
|
|
@ -23,8 +23,7 @@ typedef struct RichString_ {
|
|||
#define MIN(a,b) ((a)<(b)?(a):(b))
|
||||
#endif
|
||||
|
||||
/* private property */
|
||||
WINDOW* workArea = NULL;
|
||||
static WINDOW* workArea = NULL;
|
||||
|
||||
RichString RichString_new() {
|
||||
RichString this;
|
||||
|
|
|
@ -65,8 +65,7 @@ void Settings_delete(Settings* this) {
|
|||
free(this);
|
||||
}
|
||||
|
||||
/* private */
|
||||
void Settings_readMeters(Settings* this, char* line, HeaderSide side) {
|
||||
static void Settings_readMeters(Settings* this, char* line, HeaderSide side) {
|
||||
char* trim = String_trim(line);
|
||||
char** ids = String_split(trim, ' ');
|
||||
free(trim);
|
||||
|
@ -77,8 +76,7 @@ void Settings_readMeters(Settings* this, char* line, HeaderSide side) {
|
|||
String_freeArray(ids);
|
||||
}
|
||||
|
||||
/* private */
|
||||
void Settings_readMeterModes(Settings* this, char* line, HeaderSide side) {
|
||||
static void Settings_readMeterModes(Settings* this, char* line, HeaderSide side) {
|
||||
char* trim = String_trim(line);
|
||||
char** ids = String_split(trim, ' ');
|
||||
free(trim);
|
||||
|
|
|
@ -23,10 +23,8 @@ typedef struct Signal_ {
|
|||
int number;
|
||||
} Signal;
|
||||
|
||||
extern char* SIGNAL_CLASS;
|
||||
}*/
|
||||
|
||||
/* private property */
|
||||
char* SIGNAL_CLASS = "Signal";
|
||||
|
||||
Signal* Signal_new(char* name, int number) {
|
||||
|
|
|
@ -19,10 +19,10 @@ in the source distribution for its full text.
|
|||
#include "debug.h"
|
||||
#include <assert.h>
|
||||
|
||||
/* private property */
|
||||
static int SwapMeter_attributes[] = { SWAP };
|
||||
int SwapMeter_attributes[] = {
|
||||
SWAP
|
||||
};
|
||||
|
||||
/* private */
|
||||
MeterType SwapMeter = {
|
||||
.setValues = SwapMeter_setValues,
|
||||
.display = SwapMeter_display,
|
||||
|
|
|
@ -14,10 +14,10 @@ in the source distribution for its full text.
|
|||
|
||||
#include "debug.h"
|
||||
|
||||
/* private property */
|
||||
int TasksMeter_attributes[] = { TASKS_RUNNING };
|
||||
int TasksMeter_attributes[] = {
|
||||
TASKS_RUNNING
|
||||
};
|
||||
|
||||
/* private */
|
||||
MeterType TasksMeter = {
|
||||
.setValues = TasksMeter_setValues,
|
||||
.display = TasksMeter_display,
|
||||
|
|
|
@ -32,13 +32,10 @@ typedef struct TraceScreen_ {
|
|||
|
||||
}*/
|
||||
|
||||
/* private property */
|
||||
static char* tbFunctions[3] = {"AutoScroll ", "Stop Tracing ", "Done "};
|
||||
|
||||
/* private property */
|
||||
static char* tbKeys[3] = {"F4", "F5", "Esc"};
|
||||
|
||||
/* private property */
|
||||
static int tbEvents[3] = {KEY_F(4), KEY_F(5), 27};
|
||||
|
||||
TraceScreen* TraceScreen_new(Process* process) {
|
||||
|
|
|
@ -14,10 +14,10 @@ in the source distribution for its full text.
|
|||
|
||||
#include "debug.h"
|
||||
|
||||
/* private property */
|
||||
static int UptimeMeter_attributes[] = { UPTIME };
|
||||
int UptimeMeter_attributes[] = {
|
||||
UPTIME
|
||||
};
|
||||
|
||||
/* private */
|
||||
MeterType UptimeMeter = {
|
||||
.setValues = UptimeMeter_setValues,
|
||||
.display = NULL,
|
||||
|
|
6
Vector.c
6
Vector.c
|
@ -58,8 +58,7 @@ void Vector_delete(Vector* this) {
|
|||
free(this);
|
||||
}
|
||||
|
||||
/* private */
|
||||
bool Vector_isConsistent(Vector* this) {
|
||||
static inline bool Vector_isConsistent(Vector* this) {
|
||||
if (this->owner) {
|
||||
for (int i = 0; i < this->items; i++)
|
||||
if (this->array[i] && this->array[i]->class != this->vectorType)
|
||||
|
@ -107,8 +106,7 @@ void Vector_sort(Vector* this) {
|
|||
*/
|
||||
}
|
||||
|
||||
/* private */
|
||||
void Vector_checkArraySize(Vector* this) {
|
||||
static void Vector_checkArraySize(Vector* this) {
|
||||
assert(Vector_isConsistent(this));
|
||||
if (this->items >= this->arraySize) {
|
||||
int i;
|
||||
|
|
Loading…
Reference in New Issue