Regenerated all headers.

This commit is contained in:
Hisham Muhammad 2006-06-06 20:28:42 +00:00
parent 35afc13ebf
commit f6e0b7d0c0
37 changed files with 173 additions and 135 deletions

View File

@ -1,4 +1,4 @@
/* Do not edit this file. It was automatically genarated. */ /* Do not edit this file. It was automatically generated. */
#ifndef HEADER_AvailableColumnsPanel #ifndef HEADER_AvailableColumnsPanel
#define HEADER_AvailableColumnsPanel #define HEADER_AvailableColumnsPanel
@ -6,6 +6,7 @@
#include "Settings.h" #include "Settings.h"
#include "Header.h" #include "Header.h"
#include "ScreenManager.h" #include "ScreenManager.h"
#include "ColumnsPanel.h"
#include "Panel.h" #include "Panel.h"
@ -15,10 +16,10 @@
typedef struct AvailableColumnsPanel_ { typedef struct AvailableColumnsPanel_ {
Panel super; Panel super;
Panel* columns;
Settings* settings; Settings* settings;
ScreenManager* scr; ScreenManager* scr;
Panel* columns;
} AvailableColumnsPanel; } AvailableColumnsPanel;

View File

@ -1,4 +1,4 @@
/* Do not edit this file. It was automatically genarated. */ /* Do not edit this file. It was automatically generated. */
#ifndef HEADER_AvailableMetersPanel #ifndef HEADER_AvailableMetersPanel
#define HEADER_AvailableMetersPanel #define HEADER_AvailableMetersPanel
@ -6,6 +6,7 @@
#include "Settings.h" #include "Settings.h"
#include "Header.h" #include "Header.h"
#include "ScreenManager.h" #include "ScreenManager.h"
#include "CPUMeter.h"
#include "Panel.h" #include "Panel.h"
@ -27,7 +28,6 @@ AvailableMetersPanel* AvailableMetersPanel_new(Settings* settings, Panel* leftMe
void AvailableMetersPanel_delete(Object* object); void AvailableMetersPanel_delete(Object* object);
HandlerResult AvailableMetersPanel_EventHandler(Panel* super, int ch); HandlerResult AvailableMetersPanel_EventHandler(Panel* super, int ch);
#endif #endif

View File

@ -3,7 +3,7 @@
#ifndef HEADER_CPUMeter #ifndef HEADER_CPUMeter
#define HEADER_CPUMeter #define HEADER_CPUMeter
/* /*
htop - CPUMeter.c htop - CPUMeter.h
(C) 2004-2006 Hisham H. Muhammad (C) 2004-2006 Hisham H. Muhammad
Released under the GNU GPL, see the COPYING file Released under the GNU GPL, see the COPYING file
in the source distribution for its full text. in the source distribution for its full text.
@ -21,8 +21,11 @@ in the source distribution for its full text.
#include "debug.h" #include "debug.h"
#include <assert.h> #include <assert.h>
extern int CPUMeter_attributes[];
extern MeterType CPUMeter;
extern MeterType AllCPUsMeter;
#ifndef MIN #ifndef MIN
#define MIN(a,b) ((a)<(b)?(a):(b)) #define MIN(a,b) ((a)<(b)?(a):(b))

32
CRT.h
View File

@ -1,4 +1,4 @@
/* Do not edit this file. It was automatically genarated. */ /* Do not edit this file. It was automatically generated. */
#ifndef HEADER_CRT #ifndef HEADER_CRT
#define HEADER_CRT #define HEADER_CRT
@ -19,6 +19,8 @@ in the source distribution for its full text.
#include "debug.h" #include "debug.h"
#define ColorPair(i,j) COLOR_PAIR((7-i)*8+j)
#define COLORSCHEME_DEFAULT 0 #define COLORSCHEME_DEFAULT 0
#define COLORSCHEME_MONOCHROME 1 #define COLORSCHEME_MONOCHROME 1
#define COLORSCHEME_BLACKONWHITE 2 #define COLORSCHEME_BLACKONWHITE 2
@ -26,6 +28,15 @@ in the source distribution for its full text.
#define COLORSCHEME_MIDNIGHT 4 #define COLORSCHEME_MIDNIGHT 4
#define COLORSCHEME_BLACKNIGHT 5 #define COLORSCHEME_BLACKNIGHT 5
#define Black COLOR_BLACK
#define Red COLOR_RED
#define Green COLOR_GREEN
#define Yellow COLOR_YELLOW
#define Blue COLOR_BLUE
#define Magenta COLOR_MAGENTA
#define Cyan COLOR_CYAN
#define White COLOR_WHITE
//#link curses //#link curses
bool CRT_hasColors; bool CRT_hasColors;
@ -87,26 +98,31 @@ typedef enum ColorElements_ {
LAST_COLORELEMENT LAST_COLORELEMENT
} ColorElements; } ColorElements;
extern int CRT_colors[LAST_COLORELEMENT];
extern int CRT_colorScheme; // TODO: centralize these in Settings.
extern int CRT_delay; extern int CRT_delay;
void CRT_init(); extern int CRT_colorScheme;
extern int CRT_colors[LAST_COLORELEMENT];
// TODO: pass an instance of Settings instead.
void CRT_init(int delay, int colorScheme);
void CRT_done(); void CRT_done();
int CRT_readKey(); int CRT_readKey();
void CRT_disableDelay();
void CRT_enableDelay();
void CRT_handleSIGSEGV(int signal); void CRT_handleSIGSEGV(int signal);
void CRT_handleSIGTERM(int signal); void CRT_handleSIGTERM(int signal);
void CRT_setColors(int colorScheme); void CRT_setColors(int colorScheme);
void CRT_enableDelay();
void CRT_disableDelay();
#endif #endif

View File

@ -1,4 +1,4 @@
/* Do not edit this file. It was automatically genarated. */ /* Do not edit this file. It was automatically generated. */
#ifndef HEADER_CategoriesPanel #ifndef HEADER_CategoriesPanel
#define HEADER_CategoriesPanel #define HEADER_CategoriesPanel
@ -6,6 +6,9 @@
#include "AvailableMetersPanel.h" #include "AvailableMetersPanel.h"
#include "MetersPanel.h" #include "MetersPanel.h"
#include "DisplayOptionsPanel.h" #include "DisplayOptionsPanel.h"
#include "ColumnsPanel.h"
#include "ColorsPanel.h"
#include "AvailableColumnsPanel.h"
#include "Panel.h" #include "Panel.h"
@ -21,8 +24,6 @@ typedef struct CategoriesPanel_ {
} CategoriesPanel; } CategoriesPanel;
CategoriesPanel* CategoriesPanel_new(Settings* settings, ScreenManager* scr); CategoriesPanel* CategoriesPanel_new(Settings* settings, ScreenManager* scr);
void CategoriesPanel_delete(Object* object); void CategoriesPanel_delete(Object* object);

View File

@ -1,4 +1,4 @@
/* Do not edit this file. It was automatically genarated. */ /* Do not edit this file. It was automatically generated. */
#ifndef HEADER_CheckItem #ifndef HEADER_CheckItem
#define HEADER_CheckItem #define HEADER_CheckItem
@ -21,8 +21,8 @@ typedef struct CheckItem_ {
bool* value; bool* value;
} CheckItem; } CheckItem;
extern char* CHECKITEM_CLASS;
extern char* CHECKITEM_CLASS;
CheckItem* CheckItem_new(char* text, bool* value); CheckItem* CheckItem_new(char* text, bool* value);

View File

@ -15,6 +15,9 @@ in the source distribution for its full text.
#include "debug.h" #include "debug.h"
extern int ClockMeter_attributes[];
extern MeterType ClockMeter;
void ClockMeter_setValues(Meter* this, char* buffer, int size); void ClockMeter_setValues(Meter* this, char* buffer, int size);

View File

@ -1,8 +1,9 @@
/* Do not edit this file. It was automatically genarated. */ /* Do not edit this file. It was automatically generated. */
#ifndef HEADER_ColorsPanel #ifndef HEADER_ColorsPanel
#define HEADER_ColorsPanel #define HEADER_ColorsPanel
#include "CRT.h"
#include "Panel.h" #include "Panel.h"
#include "CheckItem.h" #include "CheckItem.h"
@ -12,6 +13,12 @@
#include "debug.h" #include "debug.h"
#include <assert.h> #include <assert.h>
// TO ADD A NEW SCHEME:
// * Increment the size of bool check in ColorsPanel.h
// * Add the entry in the ColorSchemes array below in the file
// * Add a define in CRT.h that matches the order of the array
// * Add the colors in CRT_setColors
typedef struct ColorsPanel_ { typedef struct ColorsPanel_ {
Panel super; Panel super;

View File

@ -1,4 +1,4 @@
/* Do not edit this file. It was automatically genarated. */ /* Do not edit this file. It was automatically generated. */
#ifndef HEADER_ColumnsPanel #ifndef HEADER_ColumnsPanel
#define HEADER_ColumnsPanel #define HEADER_ColumnsPanel
@ -16,7 +16,6 @@ typedef struct ColumnsPanel_ {
Panel super; Panel super;
Settings* settings; Settings* settings;
Vector* columns;
ScreenManager* scr; ScreenManager* scr;
} ColumnsPanel; } ColumnsPanel;

View File

@ -1,27 +1,27 @@
/* Do not edit this file. It was automatically genarated. */ /* Do not edit this file. It was automatically generated. */
#ifndef HEADER_DebugMemory #ifndef HEADER_DebugMemory
#define HEADER_DebugMemory #define HEADER_DebugMemory
#define _GNU_SOURCE #define _GNU_SOURCE
#include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include <stdbool.h> #include <stdbool.h>
#include <assert.h> #include <assert.h>
#undef strdup #undef strdup
#undef malloc #undef malloc
#undef realloc #undef realloc
#undef calloc #undef calloc
#undef free #undef free
typedef struct DebugMemoryItem_ DebugMemoryItem; typedef struct DebugMemoryItem_ DebugMemoryItem;
struct DebugMemoryItem_ { struct DebugMemoryItem_ {
int magic;
void* data; void* data;
char* file; char* file;
int line; int line;
@ -33,17 +33,20 @@ typedef struct DebugMemory_ {
int allocations; int allocations;
int deallocations; int deallocations;
int size; int size;
bool totals;
FILE* file; FILE* file;
} DebugMemory; } DebugMemory;
#if defined(DEBUG)
void DebugMemory_new(); void DebugMemory_new();
void* DebugMemory_malloc(int size, char* file, int line); void* DebugMemory_malloc(int size, char* file, int line, char* str);
void* DebugMemory_calloc(int a, int b, char* file, int line); void* DebugMemory_calloc(int a, int b, char* file, int line);
void* DebugMemory_realloc(void* ptr, int size, char* file, int line); void* DebugMemory_realloc(void* ptr, int size, char* file, int line, char* str);
void* DebugMemory_strdup(char* str, char* file, int line); void* DebugMemory_strdup(char* str, char* file, int line);
@ -59,4 +62,10 @@ void DebugMemory_registerDeallocation(void* data, char* file, int line);
void DebugMemory_report(); void DebugMemory_report();
#elif defined(DEBUGLITE)
//#include "efence.h"
#endif
#endif #endif

View File

@ -1,4 +1,4 @@
/* Do not edit this file. It was automatically genarated. */ /* Do not edit this file. It was automatically generated. */
#ifndef HEADER_DisplayOptionsPanel #ifndef HEADER_DisplayOptionsPanel
#define HEADER_DisplayOptionsPanel #define HEADER_DisplayOptionsPanel

View File

@ -1,9 +1,9 @@
/* Do not edit this file. It was automatically genarated. */ /* Do not edit this file. It was automatically generated. */
#ifndef HEADER_FunctionBar #ifndef HEADER_FunctionBar
#define HEADER_FunctionBar #define HEADER_FunctionBar
/* /*
htop htop - FunctionBar.h
(C) 2004-2006 Hisham H. Muhammad (C) 2004-2006 Hisham H. Muhammad
Released under the GNU GPL, see the COPYING file Released under the GNU GPL, see the COPYING file
in the source distribution for its full text. in the source distribution for its full text.
@ -30,16 +30,17 @@ typedef struct FunctionBar_ {
bool staticData; bool staticData;
} FunctionBar; } FunctionBar;
extern char* FUNCTIONBAR_CLASS; extern char* FUNCTIONBAR_CLASS;
FunctionBar* FunctionBar_new(int size, char** functions, char** keys, int* events); FunctionBar* FunctionBar_new(int size, char** functions, char** keys, int* events);
void FunctionBar_delete(Object* this); void FunctionBar_delete(Object* cast);
void FunctionBar_draw(FunctionBar* this, char* buffer);
void FunctionBar_setLabel(FunctionBar* this, int event, char* text); void FunctionBar_setLabel(FunctionBar* this, int event, char* text);
void FunctionBar_draw(FunctionBar* this, char* buffer);
void FunctionBar_drawAttr(FunctionBar* this, char* buffer, int attr); void FunctionBar_drawAttr(FunctionBar* this, char* buffer, int attr);
int FunctionBar_synthesizeEvent(FunctionBar* this, int pos); int FunctionBar_synthesizeEvent(FunctionBar* this, int pos);

View File

@ -1,4 +1,4 @@
/* Do not edit this file. It was automatically genarated. */ /* Do not edit this file. It was automatically generated. */
#ifndef HEADER_Hashtable #ifndef HEADER_Hashtable
#define HEADER_Hashtable #define HEADER_Hashtable

View File

@ -3,7 +3,7 @@
#ifndef HEADER_Header #ifndef HEADER_Header
#define HEADER_Header #define HEADER_Header
/* /*
htop - Header.c htop - Header.h
(C) 2004-2006 Hisham H. Muhammad (C) 2004-2006 Hisham H. Muhammad
Released under the GNU GPL, see the COPYING file Released under the GNU GPL, see the COPYING file
in the source distribution for its full text. in the source distribution for its full text.

View File

@ -1,9 +1,9 @@
/* Do not edit this file. It was automatically genarated. */ /* Do not edit this file. It was automatically generated. */
#ifndef HEADER_ListItem #ifndef HEADER_ListItem
#define HEADER_ListItem #define HEADER_ListItem
/* /*
htop htop - ListItem.h
(C) 2004-2006 Hisham H. Muhammad (C) 2004-2006 Hisham H. Muhammad
Released under the GNU GPL, see the COPYING file Released under the GNU GPL, see the COPYING file
in the source distribution for its full text. in the source distribution for its full text.
@ -16,24 +16,27 @@ in the source distribution for its full text.
#include "debug.h" #include "debug.h"
typedef struct ListItem_ { typedef struct ListItem_ {
Object super; Object super;
char* value; char* value;
int key; int key;
} ListItem; } ListItem;
extern char* LISTITEM_CLASS; extern char* LISTITEM_CLASS;
ListItem* ListItem_new(char* value, int key); ListItem* ListItem_new(char* value, int key);
void ListItem_append(ListItem* this, char* text);
void ListItem_delete(Object* cast); void ListItem_delete(Object* cast);
void ListItem_display(Object* cast, RichString* out); void ListItem_display(Object* cast, RichString* out);
void ListItem_append(ListItem* this, char* text);
const char* ListItem_getRef(ListItem* this); const char* ListItem_getRef(ListItem* this);
int ListItem_compare(const Object*, const Object*); int ListItem_compare(const Object* cast1, const Object* cast2);
#endif #endif

View File

@ -15,10 +15,13 @@ in the source distribution for its full text.
#include "debug.h" #include "debug.h"
extern int LoadAverageMeter_attributes[];
extern MeterType LoadAverageMeter;
extern int LoadMeter_attributes[];
extern MeterType LoadMeter;
void LoadAverageMeter_setValues(Meter* this, char* buffer, int size); void LoadAverageMeter_setValues(Meter* this, char* buffer, int size);

View File

@ -22,7 +22,9 @@ in the source distribution for its full text.
#include "debug.h" #include "debug.h"
#include <assert.h> #include <assert.h>
extern int MemoryMeter_attributes[];
extern MeterType MemoryMeter;
void MemoryMeter_setValues(Meter* this, char* buffer, int size); void MemoryMeter_setValues(Meter* this, char* buffer, int size);

34
Meter.h
View File

@ -3,7 +3,7 @@
#ifndef HEADER_Meter #ifndef HEADER_Meter
#define HEADER_Meter #define HEADER_Meter
/* /*
htop - Meter.c htop - Meter.h
(C) 2004-2006 Hisham H. Muhammad (C) 2004-2006 Hisham H. Muhammad
Released under the GNU GPL, see the COPYING file Released under the GNU GPL, see the COPYING file
in the source distribution for its full text. in the source distribution for its full text.
@ -78,18 +78,6 @@ struct Meter_ {
double total; 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 { typedef enum {
CUSTOM_METERMODE = 0, CUSTOM_METERMODE = 0,
BAR_METERMODE, BAR_METERMODE,
@ -101,9 +89,13 @@ typedef enum {
LAST_METERMODE LAST_METERMODE
} MeterModeId; } 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"
#ifndef MIN #ifndef MIN
#define MIN(a,b) ((a)<(b)?(a):(b)) #define MIN(a,b) ((a)<(b)?(a):(b))
@ -112,15 +104,15 @@ extern MeterMode* Meter_modes[];
#define MAX(a,b) ((a)>(b)?(a):(b)) #define MAX(a,b) ((a)>(b)?(a):(b))
#endif #endif
extern char* METER_CLASS;
extern MeterType* Meter_types[];
#ifdef USE_FUNKY_MODES #ifdef USE_FUNKY_MODES
#endif #endif
extern MeterMode* Meter_modes[];
Meter* Meter_new(ProcessList* pl, int param, MeterType* type); Meter* Meter_new(ProcessList* pl, int param, MeterType* type);
@ -128,7 +120,6 @@ void Meter_delete(Object* cast);
void Meter_setCaption(Meter* this, char* caption); void Meter_setCaption(Meter* this, char* caption);
void Meter_setMode(Meter* this, int modeIndex); void Meter_setMode(Meter* this, int modeIndex);
ListItem* Meter_toListItem(Meter* this); ListItem* Meter_toListItem(Meter* this);
@ -139,7 +130,6 @@ void TextMeterMode_draw(Meter* this, int x, int y, int w);
/* ---------- BarMeterMode ---------- */ /* ---------- BarMeterMode ---------- */
void BarMeterMode_draw(Meter* this, int x, int y, int w); void BarMeterMode_draw(Meter* this, int x, int y, int w);
#ifdef USE_FUNKY_MODES #ifdef USE_FUNKY_MODES
@ -148,14 +138,10 @@ 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) #define DrawDot(a,y,c) do { attrset(a); mvaddch(y, x+k, c); } while(0)
void GraphMeterMode_draw(Meter* this, int x, int y, int w); void GraphMeterMode_draw(Meter* this, int x, int y, int w);
/* ---------- LEDMeterMode ---------- */ /* ---------- LEDMeterMode ---------- */
void LEDMeterMode_draw(Meter* this, int x, int y, int w); void LEDMeterMode_draw(Meter* this, int x, int y, int w);
#endif #endif

View File

@ -1,4 +1,4 @@
/* Do not edit this file. It was automatically genarated. */ /* Do not edit this file. It was automatically generated. */
#ifndef HEADER_MetersPanel #ifndef HEADER_MetersPanel
#define HEADER_MetersPanel #define HEADER_MetersPanel

View File

@ -1,4 +1,4 @@
/* Do not edit this file. It was automatically genarated. */ /* Do not edit this file. It was automatically generated. */
#ifndef HEADER_Object #ifndef HEADER_Object
#define HEADER_Object #define HEADER_Object
@ -30,7 +30,6 @@ struct Object_ {
Object_Delete delete; Object_Delete delete;
}; };
void Object_new(); void Object_new();
bool Object_instanceOf(Object* this, char* class); bool Object_instanceOf(Object* this, char* class);

23
Panel.h
View File

@ -1,9 +1,9 @@
/* Do not edit this file. It was automatically genarated. */ /* Do not edit this file. It was automatically generated. */
#ifndef HEADER_Panel #ifndef HEADER_Panel
#define HEADER_Panel #define HEADER_Panel
/* /*
htop htop - Panel.h
(C) 2004-2006 Hisham H. Muhammad (C) 2004-2006 Hisham H. Muhammad
Released under the GNU GPL, see the COPYING file Released under the GNU GPL, see the COPYING file
in the source distribution for its full text. in the source distribution for its full text.
@ -15,7 +15,6 @@ in the source distribution for its full text.
#include "RichString.h" #include "RichString.h"
#include <math.h> #include <math.h>
#include <sys/param.h>
#include <stdbool.h> #include <stdbool.h>
#include "debug.h" #include "debug.h"
@ -48,10 +47,16 @@ struct Panel_ {
Panel_EventHandler eventHandler; Panel_EventHandler eventHandler;
}; };
#ifndef MIN
#define MIN(a,b) ((a)<(b)?(a):(b))
#endif
#ifndef MAX
#define MAX(a,b) ((a)>(b)?(a):(b))
#endif
extern char* PANEL_CLASS; extern char* PANEL_CLASS;
Panel* Panel_new(int x, int y, int w, int h, char* type, bool owner); Panel* Panel_new(int x, int y, int w, int h, char* type, bool owner);
void Panel_delete(Object* cast); void Panel_delete(Object* cast);
@ -60,12 +65,12 @@ void Panel_init(Panel* this, int x, int y, int w, int h, char* type, bool owner)
void Panel_done(Panel* this); void Panel_done(Panel* this);
inline void Panel_setRichHeader(Panel* this, RichString header);
inline void Panel_setHeader(Panel* this, char* header);
void Panel_setEventHandler(Panel* this, Panel_EventHandler eh); void Panel_setEventHandler(Panel* this, Panel_EventHandler eh);
void Panel_setRichHeader(Panel* this, RichString header);
void Panel_setHeader(Panel* this, char* header);
void Panel_move(Panel* this, int x, int y); void Panel_move(Panel* this, int x, int y);
void Panel_resize(Panel* this, int w, int h); void Panel_resize(Panel* this, int w, int h);

View File

@ -1,4 +1,4 @@
/* Do not edit this file. It was automatically genarated. */ /* Do not edit this file. It was automatically generated. */
#ifndef HEADER_Process #ifndef HEADER_Process
#define HEADER_Process #define HEADER_Process
@ -106,12 +106,10 @@ typedef struct Process_ {
char user[PROCESS_USER_LEN + 1]; char user[PROCESS_USER_LEN + 1];
} Process; } Process;
extern char* PROCESS_CLASS; extern char* PROCESS_CLASS;
extern char* Process_fieldNames[]; extern char *Process_fieldNames[];
Process* Process_new(struct ProcessList_ *pl); Process* Process_new(struct ProcessList_ *pl);

View File

@ -3,7 +3,7 @@
#ifndef HEADER_ProcessList #ifndef HEADER_ProcessList
#define HEADER_ProcessList #define HEADER_ProcessList
/* /*
htop - ProcessList.c htop - ProcessList.h
(C) 2004,2005 Hisham H. Muhammad (C) 2004,2005 Hisham H. Muhammad
Released under the GNU GPL, see the COPYING file Released under the GNU GPL, see the COPYING file
in the source distribution for its full text. in the source distribution for its full text.
@ -103,15 +103,11 @@ typedef struct ProcessList_ {
} ProcessList; } ProcessList;
#ifdef DEBUG #ifdef DEBUG
#define ProcessList_read(this, buffer, format, ...) ProcessList_xread(this, (vxscanf) vsscanf, buffer, format, ## __VA_ARGS__ ) #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__ ) #define ProcessList_fread(this, file, format, ...) ProcessList_xread(this, (vxscanf) vfscanf, file, format, ## __VA_ARGS__ )
#else #else
#ifndef ProcessList_read #ifndef ProcessList_read
@ -141,10 +137,8 @@ Process* ProcessList_get(ProcessList* this, int index);
int ProcessList_size(ProcessList* this); int ProcessList_size(ProcessList* this);
void ProcessList_sort(ProcessList* this); void ProcessList_sort(ProcessList* this);
bool ProcessList_readStatusFile(ProcessList* this, Process* proc, char* dirname, char* name); bool ProcessList_readStatusFile(ProcessList* this, Process* proc, char* dirname, char* name);
void ProcessList_processEntries(ProcessList* this, char* dirname, int parent, float period); void ProcessList_processEntries(ProcessList* this, char* dirname, int parent, float period);

View File

@ -1,4 +1,4 @@
/* Do not edit this file. It was automatically genarated. */ /* Do not edit this file. It was automatically generated. */
#ifndef HEADER_RichString #ifndef HEADER_RichString
#define HEADER_RichString #define HEADER_RichString
@ -7,7 +7,6 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <curses.h> #include <curses.h>
#include <sys/param.h>
#include "debug.h" #include "debug.h"
#include <assert.h> #include <assert.h>
@ -21,6 +20,9 @@ typedef struct RichString_ {
} RichString; } RichString;
#ifndef MIN
#define MIN(a,b) ((a)<(b)?(a):(b))
#endif
RichString RichString_new(); RichString RichString_new();

View File

@ -1,4 +1,4 @@
/* Do not edit this file. It was automatically genarated. */ /* Do not edit this file. It was automatically generated. */
#ifndef HEADER_ScreenManager #ifndef HEADER_ScreenManager
#define HEADER_ScreenManager #define HEADER_ScreenManager
@ -32,9 +32,9 @@ typedef struct ScreenManager_ {
int y2; int y2;
Orientation orientation; Orientation orientation;
Vector* items; Vector* items;
Vector* fuBars;
int itemCount; int itemCount;
FunctionBar* fuBar; FunctionBar* fuBar;
Vector* fuBars;
bool owner; bool owner;
} ScreenManager; } ScreenManager;

View File

@ -3,7 +3,7 @@
#ifndef HEADER_Settings #ifndef HEADER_Settings
#define HEADER_Settings #define HEADER_Settings
/* /*
htop - Settings.c htop - Settings.h
(C) 2004-2006 Hisham H. Muhammad (C) 2004-2006 Hisham H. Muhammad
Released under the GNU GPL, see the COPYING file Released under the GNU GPL, see the COPYING file
in the source distribution for its full text. in the source distribution for its full text.
@ -32,8 +32,6 @@ Settings* Settings_new(ProcessList* pl, Header* header);
void Settings_delete(Settings* this); void Settings_delete(Settings* this);
bool Settings_read(Settings* this, char* fileName); bool Settings_read(Settings* this, char* fileName);
bool Settings_write(Settings* this); bool Settings_write(Settings* this);

View File

@ -1,9 +1,9 @@
/* Do not edit this file. It was automatically genarated. */ /* Do not edit this file. It was automatically generated. */
#ifndef HEADER_Signal #ifndef HEADER_SignalItem
#define HEADER_Signal #define HEADER_SignalItem
/* /*
htop htop - SignalItem.h
(C) 2004-2006 Hisham H. Muhammad (C) 2004-2006 Hisham H. Muhammad
Released under the GNU GPL, see the COPYING file Released under the GNU GPL, see the COPYING file
in the source distribution for its full text. in the source distribution for its full text.
@ -25,8 +25,8 @@ typedef struct Signal_ {
int number; int number;
} Signal; } Signal;
extern char* SIGNAL_CLASS;
extern char* SIGNAL_CLASS;
Signal* Signal_new(char* name, int number); Signal* Signal_new(char* name, int number);

View File

@ -1,4 +1,4 @@
/* Do not edit this file. It was automatically genarated. */ /* Do not edit this file. It was automatically generated. */
#ifndef HEADER_SignalsPanel #ifndef HEADER_SignalsPanel
#define HEADER_SignalsPanel #define HEADER_SignalsPanel

View File

@ -1,4 +1,4 @@
/* Do not edit this file. It was automatically genarated. */ /* Do not edit this file. It was automatically generated. */
#ifndef HEADER_String #ifndef HEADER_String
#define HEADER_String #define HEADER_String

View File

@ -22,7 +22,9 @@ in the source distribution for its full text.
#include "debug.h" #include "debug.h"
#include <assert.h> #include <assert.h>
extern int SwapMeter_attributes[];
extern MeterType SwapMeter;
void SwapMeter_setValues(Meter* this, char* buffer, int len); void SwapMeter_setValues(Meter* this, char* buffer, int len);

View File

@ -17,7 +17,9 @@ in the source distribution for its full text.
#include "debug.h" #include "debug.h"
extern int TasksMeter_attributes[];
extern MeterType TasksMeter;
void TasksMeter_setValues(Meter* this, char* buffer, int len); void TasksMeter_setValues(Meter* this, char* buffer, int len);

View File

@ -1,11 +1,13 @@
/* Do not edit this file. It was automatically generated. */
#ifndef HEADER_TraceScreen
#define HEADER_TraceScreen
/* /*
htop - TraceScreen.h htop - TraceScreen.h
(C) 2005 Hisham H. Muhammad (C) 2005-2006 Hisham H. Muhammad
Released under the GNU GPL, see the COPYING file Released under the GNU GPL, see the COPYING file
in the source distribution for its full text. in the source distribution for its full text.
*/ */
#ifndef HEADER_TraceScreen
#define HEADER_TraceScreen
#define _GNU_SOURCE #define _GNU_SOURCE
#include <stdio.h> #include <stdio.h>
@ -13,11 +15,16 @@ in the source distribution for its full text.
#include <stdbool.h> #include <stdbool.h>
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
#include <sys/types.h>
#include <sys/wait.h>
#include "ProcessList.h" #include "ProcessList.h"
#include "Process.h"
#include "ListItem.h"
#include "Panel.h" #include "Panel.h"
#include "FunctionBar.h" #include "FunctionBar.h"
typedef struct TraceScreen_ { typedef struct TraceScreen_ {
Process* process; Process* process;
Panel* display; Panel* display;
@ -25,6 +32,7 @@ typedef struct TraceScreen_ {
bool tracing; bool tracing;
} TraceScreen; } TraceScreen;
TraceScreen* TraceScreen_new(Process* process); TraceScreen* TraceScreen_new(Process* process);
void TraceScreen_delete(TraceScreen* this); void TraceScreen_delete(TraceScreen* this);
@ -34,4 +42,3 @@ void TraceScreen_draw(TraceScreen* this);
void TraceScreen_run(TraceScreen* this); void TraceScreen_run(TraceScreen* this);
#endif #endif

View File

@ -17,8 +17,10 @@ in the source distribution for its full text.
#include "debug.h" #include "debug.h"
extern int UptimeMeter_attributes[];
extern MeterType UptimeMeter;
void UptimeMeter_setValues(Meter* cast, char* buffer, int len); void UptimeMeter_setValues(Meter* this, char* buffer, int len);
#endif #endif

View File

@ -1,9 +1,9 @@
/* Do not edit this file. It was automatically genarated. */ /* Do not edit this file. It was automatically generated. */
#ifndef HEADER_UsersTable #ifndef HEADER_UsersTable
#define HEADER_UsersTable #define HEADER_UsersTable
/* /*
htop htop - UsersTable.h
(C) 2004-2006 Hisham H. Muhammad (C) 2004-2006 Hisham H. Muhammad
Released under the GNU GPL, see the COPYING file Released under the GNU GPL, see the COPYING file
in the source distribution for its full text. in the source distribution for its full text.
@ -20,10 +20,6 @@ in the source distribution for its full text.
#include "debug.h" #include "debug.h"
#include <assert.h> #include <assert.h>
#ifndef SYSCONFDIR
#define SYSCONFDIR "/etc"
#endif
typedef struct UsersTable_ { typedef struct UsersTable_ {
Hashtable* users; Hashtable* users;
} UsersTable; } UsersTable;
@ -36,6 +32,6 @@ char* UsersTable_getRef(UsersTable* this, int uid);
inline int UsersTable_size(UsersTable* this); inline int UsersTable_size(UsersTable* this);
void UsersTable_foreach(UsersTable*, Hashtable_PairFunction, void*); inline void UsersTable_foreach(UsersTable* this, Hashtable_PairFunction f, void* userData);
#endif #endif

View File

@ -1,4 +1,4 @@
/* Do not edit this file. It was automatically genarated. */ /* Do not edit this file. It was automatically generated. */
#ifndef HEADER_Vector #ifndef HEADER_Vector
#define HEADER_Vector #define HEADER_Vector

12
debug.h
View File

@ -3,12 +3,12 @@
/* Full debug */ /* Full debug */
#include "DebugMemory.h" #include "DebugMemory.h"
#define calloc(a, b) DebugMemory_calloc(a, b, __FILE__, __LINE__); #define calloc(a, b) DebugMemory_calloc(a, b, __FILE__, __LINE__)
#define malloc(x) DebugMemory_malloc(x, __FILE__, __LINE__, #x); #define malloc(x) DebugMemory_malloc(x, __FILE__, __LINE__, #x)
#define realloc(x,s) DebugMemory_realloc(x, s, __FILE__, __LINE__, #x); #define realloc(x,s) DebugMemory_realloc(x, s, __FILE__, __LINE__, #x)
#define strdup(x) DebugMemory_strdup(x, __FILE__, __LINE__); #define strdup(x) DebugMemory_strdup(x, __FILE__, __LINE__)
#define free(x) DebugMemory_free(x, __FILE__, __LINE__); #define free(x) DebugMemory_free(x, __FILE__, __LINE__)
#define debug_done() DebugMemory_report(); #define debug_done() DebugMemory_report()
#elif defined(DEBUGLITE) #elif defined(DEBUGLITE)

23
htop.h
View File

@ -1,4 +1,4 @@
/* Do not edit this file. It was automatically genarated. */ /* Do not edit this file. It was automatically generated. */
#ifndef HEADER_htop #ifndef HEADER_htop
#define HEADER_htop #define HEADER_htop
@ -9,6 +9,13 @@ Released under the GNU GPL, see the COPYING file
in the source distribution for its full text. in the source distribution for its full text.
*/ */
#define _GNU_SOURCE
#include <unistd.h>
#include <math.h>
#include <sys/param.h>
#include <ctype.h>
#include <stdbool.h>
#include "ProcessList.h" #include "ProcessList.h"
#include "CRT.h" #include "CRT.h"
#include "Panel.h" #include "Panel.h"
@ -21,32 +28,24 @@ in the source distribution for its full text.
#include "ListItem.h" #include "ListItem.h"
#include "CategoriesPanel.h" #include "CategoriesPanel.h"
#include "SignalsPanel.h" #include "SignalsPanel.h"
#include "TraceScreen.h"
#include "config.h" #include "config.h"
#include "debug.h" #include "debug.h"
#include <unistd.h>
#include <math.h>
#include <sys/param.h>
#include <ctype.h>
#include <stdbool.h>
int usleep(int usec);
//#link m //#link m
#define INCSEARCH_MAX 40 #define INCSEARCH_MAX 40
void printVersionFlag(); void printVersionFlag();
void printHelpFlag(); void printHelpFlag();
void showHelp(); void showHelp();
void showColumnConfig(ProcessList* pl); void addUserToList(int key, void* userCast, void* panelCast);
void Setup_run(Settings* settings, int headerHeight); void setUserOnly(const char* userName, bool* userOnly, uid_t* userId);
int main(int argc, char** argv); int main(int argc, char** argv);