From 7ac1c709b727bd460889f2765db9e2a37535ef90 Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Tue, 18 Aug 2020 17:41:49 +1000 Subject: [PATCH] Re-generate all headers with latest scripts/MakeHeader.py Sync-up missing extern declarations for many functions. --- Action.h | 10 ++++----- Affinity.h | 14 ++++++------ AffinityPanel.h | 4 ++-- AvailableColumnsPanel.h | 2 +- AvailableMetersPanel.h | 2 +- CategoriesPanel.h | 4 ++-- CheckItem.h | 8 +++---- ColorsPanel.h | 2 +- ColumnsPanel.h | 6 +++--- DisplayOptionsPanel.h | 2 +- EnvScreen.h | 8 +++---- FunctionBar.h | 14 ++++++------ Hashtable.h | 12 +++++------ Header.h | 26 +++++++++++------------ IncSet.h | 14 ++++++------ InfoScreen.h | 12 +++++------ ListItem.h | 8 +++---- MainPanel.h | 16 +++++++------- Meter.h | 12 +++++------ MetersPanel.h | 4 ++-- Object.h | 2 +- OpenFilesScreen.h | 8 +++---- Panel.h | 46 ++++++++++++++++++++-------------------- Process.h | 30 +++++++++++++------------- ProcessList.h | 28 ++++++++++++------------ RichString.h | 16 +++++++------- ScreenManager.h | 12 +++++------ Settings.h | 8 +++---- SignalsPanel.h | 2 +- StringUtils.h | 12 +++++------ TraceScreen.h | 12 +++++------ UsersTable.h | 6 +++--- Vector.h | 26 +++++++++++------------ XAlloc.h | 10 ++++----- htop.h | 2 +- linux/Battery.h | 2 +- linux/IOPriorityPanel.h | 4 ++-- linux/LinuxCRT.h | 2 +- linux/LinuxProcessList.h | 6 +++--- linux/Platform.h | 16 +++++++------- 40 files changed, 215 insertions(+), 215 deletions(-) diff --git a/Action.h b/Action.h index 1dfdcb47..a2920b68 100644 --- a/Action.h +++ b/Action.h @@ -39,20 +39,20 @@ typedef struct State_ { } State; -Object* Action_pickFromVector(State* st, Panel* list, int x); +extern Object* Action_pickFromVector(State* st, Panel* list, int x); // ---------------------------------------- -bool Action_setUserOnly(const char* userName, uid_t* userId); +extern bool Action_setUserOnly(const char* userName, uid_t* userId); -Htop_Reaction Action_setSortKey(Settings* settings, ProcessField sortKey); +extern Htop_Reaction Action_setSortKey(Settings* settings, ProcessField sortKey); // ---------------------------------------- -Htop_Reaction Action_follow(State* st); +extern Htop_Reaction Action_follow(State* st); -void Action_setBindings(Htop_Action* keys); +extern void Action_setBindings(Htop_Action* keys); #endif diff --git a/Affinity.h b/Affinity.h index fd2c599e..818b905e 100644 --- a/Affinity.h +++ b/Affinity.h @@ -29,23 +29,23 @@ typedef struct Affinity_ { } Affinity; -Affinity* Affinity_new(ProcessList* pl); +extern Affinity* Affinity_new(ProcessList* pl); -void Affinity_delete(Affinity* this); +extern void Affinity_delete(Affinity* this); -void Affinity_add(Affinity* this, int id); +extern void Affinity_add(Affinity* this, int id); #ifdef HAVE_LIBHWLOC -Affinity* Affinity_get(Process* proc, ProcessList* pl); +extern Affinity* Affinity_get(Process* proc, ProcessList* pl); -bool Affinity_set(Process* proc, Affinity* this); +extern bool Affinity_set(Process* proc, Affinity* this); #elif HAVE_LINUX_AFFINITY -Affinity* Affinity_get(Process* proc, ProcessList* pl); +extern Affinity* Affinity_get(Process* proc, ProcessList* pl); -bool Affinity_set(Process* proc, Affinity* this); +extern bool Affinity_set(Process* proc, Affinity* this); #endif diff --git a/AffinityPanel.h b/AffinityPanel.h index 2b6059b0..3a9c7807 100644 --- a/AffinityPanel.h +++ b/AffinityPanel.h @@ -16,8 +16,8 @@ in the source distribution for its full text. extern PanelClass AffinityPanel_class; -Panel* AffinityPanel_new(ProcessList* pl, Affinity* affinity); +extern Panel* AffinityPanel_new(ProcessList* pl, Affinity* affinity); -Affinity* AffinityPanel_getAffinity(Panel* this, ProcessList* pl); +extern Affinity* AffinityPanel_getAffinity(Panel* this, ProcessList* pl); #endif diff --git a/AvailableColumnsPanel.h b/AvailableColumnsPanel.h index 5a8371dd..2d6daf4b 100644 --- a/AvailableColumnsPanel.h +++ b/AvailableColumnsPanel.h @@ -19,6 +19,6 @@ typedef struct AvailableColumnsPanel_ { extern PanelClass AvailableColumnsPanel_class; -AvailableColumnsPanel* AvailableColumnsPanel_new(Panel* columns); +extern AvailableColumnsPanel* AvailableColumnsPanel_new(Panel* columns); #endif diff --git a/AvailableMetersPanel.h b/AvailableMetersPanel.h index e9b949b0..00e0f596 100644 --- a/AvailableMetersPanel.h +++ b/AvailableMetersPanel.h @@ -27,6 +27,6 @@ typedef struct AvailableMetersPanel_ { extern PanelClass AvailableMetersPanel_class; -AvailableMetersPanel* AvailableMetersPanel_new(Settings* settings, Header* header, Panel* leftMeters, Panel* rightMeters, ScreenManager* scr, ProcessList* pl); +extern AvailableMetersPanel* AvailableMetersPanel_new(Settings* settings, Header* header, Panel* leftMeters, Panel* rightMeters, ScreenManager* scr, ProcessList* pl); #endif diff --git a/CategoriesPanel.h b/CategoriesPanel.h index ccef0fae..44c6842a 100644 --- a/CategoriesPanel.h +++ b/CategoriesPanel.h @@ -24,10 +24,10 @@ typedef struct CategoriesPanel_ { } CategoriesPanel; -void CategoriesPanel_makeMetersPage(CategoriesPanel* this); +extern void CategoriesPanel_makeMetersPage(CategoriesPanel* this); extern PanelClass CategoriesPanel_class; -CategoriesPanel* CategoriesPanel_new(ScreenManager* scr, Settings* settings, Header* header, ProcessList* pl); +extern CategoriesPanel* CategoriesPanel_new(ScreenManager* scr, Settings* settings, Header* header, ProcessList* pl); #endif diff --git a/CheckItem.h b/CheckItem.h index 5847d4b2..dbd1a039 100644 --- a/CheckItem.h +++ b/CheckItem.h @@ -21,12 +21,12 @@ typedef struct CheckItem_ { extern ObjectClass CheckItem_class; -CheckItem* CheckItem_newByRef(char* text, bool* ref); +extern CheckItem* CheckItem_newByRef(char* text, bool* ref); -CheckItem* CheckItem_newByVal(char* text, bool value); +extern CheckItem* CheckItem_newByVal(char* text, bool value); -void CheckItem_set(CheckItem* this, bool value); +extern void CheckItem_set(CheckItem* this, bool value); -bool CheckItem_get(CheckItem* this); +extern bool CheckItem_get(CheckItem* this); #endif diff --git a/ColorsPanel.h b/ColorsPanel.h index ee3111e0..82b782b8 100644 --- a/ColorsPanel.h +++ b/ColorsPanel.h @@ -29,6 +29,6 @@ typedef struct ColorsPanel_ { extern PanelClass ColorsPanel_class; -ColorsPanel* ColorsPanel_new(Settings* settings, ScreenManager* scr); +extern ColorsPanel* ColorsPanel_new(Settings* settings, ScreenManager* scr); #endif diff --git a/ColumnsPanel.h b/ColumnsPanel.h index 0da674a8..46d20bbb 100644 --- a/ColumnsPanel.h +++ b/ColumnsPanel.h @@ -22,11 +22,11 @@ typedef struct ColumnsPanel_ { extern PanelClass ColumnsPanel_class; -ColumnsPanel* ColumnsPanel_new(Settings* settings); +extern ColumnsPanel* ColumnsPanel_new(Settings* settings); -int ColumnsPanel_fieldNameToIndex(const char* name); +extern int ColumnsPanel_fieldNameToIndex(const char* name); -void ColumnsPanel_update(Panel* super); +extern void ColumnsPanel_update(Panel* super); #endif diff --git a/DisplayOptionsPanel.h b/DisplayOptionsPanel.h index 2a7509ae..d9de4005 100644 --- a/DisplayOptionsPanel.h +++ b/DisplayOptionsPanel.h @@ -23,6 +23,6 @@ typedef struct DisplayOptionsPanel_ { extern PanelClass DisplayOptionsPanel_class; -DisplayOptionsPanel* DisplayOptionsPanel_new(Settings* settings, ScreenManager* scr); +extern DisplayOptionsPanel* DisplayOptionsPanel_new(Settings* settings, ScreenManager* scr); #endif diff --git a/EnvScreen.h b/EnvScreen.h index 7cdbb865..025cb8d3 100644 --- a/EnvScreen.h +++ b/EnvScreen.h @@ -11,12 +11,12 @@ typedef struct EnvScreen_ { extern InfoScreenClass EnvScreen_class; -EnvScreen* EnvScreen_new(Process* process); +extern EnvScreen* EnvScreen_new(Process* process); -void EnvScreen_delete(Object* this); +extern void EnvScreen_delete(Object* this); -void EnvScreen_draw(InfoScreen* this); +extern void EnvScreen_draw(InfoScreen* this); -void EnvScreen_scan(InfoScreen* this); +extern void EnvScreen_scan(InfoScreen* this); #endif diff --git a/FunctionBar.h b/FunctionBar.h index b60f6582..ee5b9347 100644 --- a/FunctionBar.h +++ b/FunctionBar.h @@ -22,18 +22,18 @@ typedef struct FunctionBar_ { -FunctionBar* FunctionBar_newEnterEsc(const char* enter, const char* esc); +extern FunctionBar* FunctionBar_newEnterEsc(const char* enter, const char* esc); -FunctionBar* FunctionBar_new(const char* const* functions, const char* const* keys, const int* events); +extern FunctionBar* FunctionBar_new(const char* const* functions, const char* const* keys, const int* events); -void FunctionBar_delete(FunctionBar* this); +extern void FunctionBar_delete(FunctionBar* this); -void FunctionBar_setLabel(FunctionBar* this, int event, const char* text); +extern void FunctionBar_setLabel(FunctionBar* this, int event, const char* text); -void FunctionBar_draw(const FunctionBar* this, char* buffer); +extern void FunctionBar_draw(const FunctionBar* this, char* buffer); -void FunctionBar_drawAttr(const FunctionBar* this, char* buffer, int attr); +extern void FunctionBar_drawAttr(const FunctionBar* this, char* buffer, int attr); -int FunctionBar_synthesizeEvent(const FunctionBar* this, int pos); +extern int FunctionBar_synthesizeEvent(const FunctionBar* this, int pos); #endif diff --git a/Hashtable.h b/Hashtable.h index 25608961..32b02188 100644 --- a/Hashtable.h +++ b/Hashtable.h @@ -30,20 +30,20 @@ struct Hashtable_ { #ifdef DEBUG -int Hashtable_count(Hashtable* this); +extern int Hashtable_count(Hashtable* this); #endif -Hashtable* Hashtable_new(int size, bool owner); +extern Hashtable* Hashtable_new(int size, bool owner); -void Hashtable_delete(Hashtable* this); +extern void Hashtable_delete(Hashtable* this); -void Hashtable_put(Hashtable* this, unsigned int key, void* value); +extern void Hashtable_put(Hashtable* this, unsigned int key, void* value); -void* Hashtable_remove(Hashtable* this, unsigned int key); +extern void* Hashtable_remove(Hashtable* this, unsigned int key); extern void* Hashtable_get(Hashtable* this, unsigned int key); -void Hashtable_foreach(Hashtable* this, Hashtable_PairFunction f, void* userData); +extern void Hashtable_foreach(Hashtable* this, Hashtable_PairFunction f, void* userData); #endif diff --git a/Header.h b/Header.h index 700ad354..f5182454 100644 --- a/Header.h +++ b/Header.h @@ -31,30 +31,30 @@ typedef struct Header_ { #define Header_forEachColumn(this_, i_) for (int (i_)=0; (i_) < (this_)->nrColumns; ++(i_)) #endif -Header* Header_new(struct ProcessList_* pl, Settings* settings, int nrColumns); +extern Header* Header_new(struct ProcessList_* pl, Settings* settings, int nrColumns); -void Header_delete(Header* this); +extern void Header_delete(Header* this); -void Header_populateFromSettings(Header* this); +extern void Header_populateFromSettings(Header* this); -void Header_writeBackToSettings(const Header* this); +extern void Header_writeBackToSettings(const Header* this); -MeterModeId Header_addMeterByName(Header* this, char* name, int column); +extern MeterModeId Header_addMeterByName(Header* this, char* name, int column); -void Header_setMode(Header* this, int i, MeterModeId mode, int column); +extern void Header_setMode(Header* this, int i, MeterModeId mode, int column); -Meter* Header_addMeterByClass(Header* this, MeterClass* type, int param, int column); +extern Meter* Header_addMeterByClass(Header* this, MeterClass* type, int param, int column); -int Header_size(Header* this, int column); +extern int Header_size(Header* this, int column); -char* Header_readMeterName(Header* this, int i, int column); +extern char* Header_readMeterName(Header* this, int i, int column); -MeterModeId Header_readMeterMode(Header* this, int i, int column); +extern MeterModeId Header_readMeterMode(Header* this, int i, int column); -void Header_reinit(Header* this); +extern void Header_reinit(Header* this); -void Header_draw(const Header* this); +extern void Header_draw(const Header* this); -int Header_calculateHeight(Header* this); +extern int Header_calculateHeight(Header* this); #endif diff --git a/IncSet.h b/IncSet.h index 27538f4b..d873bb81 100644 --- a/IncSet.h +++ b/IncSet.h @@ -41,18 +41,18 @@ typedef struct IncSet_ { typedef const char* (*IncMode_GetPanelValue)(Panel*, int); -IncSet* IncSet_new(FunctionBar* bar); +extern IncSet* IncSet_new(FunctionBar* bar); -void IncSet_delete(IncSet* this); +extern void IncSet_delete(IncSet* this); -bool IncSet_handleKey(IncSet* this, int ch, Panel* panel, IncMode_GetPanelValue getPanelValue, Vector* lines); +extern bool IncSet_handleKey(IncSet* this, int ch, Panel* panel, IncMode_GetPanelValue getPanelValue, Vector* lines); -const char* IncSet_getListItemValue(Panel* panel, int i); +extern const char* IncSet_getListItemValue(Panel* panel, int i); -void IncSet_activate(IncSet* this, IncType type, Panel* panel); +extern void IncSet_activate(IncSet* this, IncType type, Panel* panel); -void IncSet_drawBar(IncSet* this); +extern void IncSet_drawBar(IncSet* this); -int IncSet_synthesizeEvent(IncSet* this, int x); +extern int IncSet_synthesizeEvent(IncSet* this, int x); #endif diff --git a/InfoScreen.h b/InfoScreen.h index 2e1599f9..b9387cda 100644 --- a/InfoScreen.h +++ b/InfoScreen.h @@ -38,16 +38,16 @@ struct InfoScreen_ { Vector* lines; }; -InfoScreen* InfoScreen_init(InfoScreen* this, Process* process, FunctionBar* bar, int height, char* panelHeader); +extern InfoScreen* InfoScreen_init(InfoScreen* this, Process* process, FunctionBar* bar, int height, char* panelHeader); -InfoScreen* InfoScreen_done(InfoScreen* this); +extern InfoScreen* InfoScreen_done(InfoScreen* this); -void InfoScreen_drawTitled(InfoScreen* this, char* fmt, ...); +extern void InfoScreen_drawTitled(InfoScreen* this, char* fmt, ...); -void InfoScreen_addLine(InfoScreen* this, const char* line); +extern void InfoScreen_addLine(InfoScreen* this, const char* line); -void InfoScreen_appendLine(InfoScreen* this, const char* line); +extern void InfoScreen_appendLine(InfoScreen* this, const char* line); -void InfoScreen_run(InfoScreen* this); +extern void InfoScreen_run(InfoScreen* this); #endif diff --git a/ListItem.h b/ListItem.h index b48f0acd..7fed9237 100644 --- a/ListItem.h +++ b/ListItem.h @@ -21,13 +21,13 @@ typedef struct ListItem_ { extern ObjectClass ListItem_class; -ListItem* ListItem_new(const char* value, int key); +extern ListItem* ListItem_new(const char* value, int key); -void ListItem_append(ListItem* this, const char* text); +extern void ListItem_append(ListItem* this, const char* text); -const char* ListItem_getRef(ListItem* this); +extern const char* ListItem_getRef(ListItem* this); -long ListItem_compare(const void* cast1, const void* cast2); +extern long ListItem_compare(const void* cast1, const void* cast2); #endif diff --git a/MainPanel.h b/MainPanel.h index 88496597..8d753306 100644 --- a/MainPanel.h +++ b/MainPanel.h @@ -31,22 +31,22 @@ typedef bool(*MainPanel_ForeachProcessFn)(Process*, Arg); #define MainPanel_getFunctionBar(this_) (((Panel*)(this_))->defaultBar) -void MainPanel_updateTreeFunctions(MainPanel* this, bool mode); +extern void MainPanel_updateTreeFunctions(MainPanel* this, bool mode); -void MainPanel_pidSearch(MainPanel* this, int ch); +extern void MainPanel_pidSearch(MainPanel* this, int ch); -int MainPanel_selectedPid(MainPanel* this); +extern int MainPanel_selectedPid(MainPanel* this); -const char* MainPanel_getValue(MainPanel* this, int i); +extern const char* MainPanel_getValue(MainPanel* this, int i); -bool MainPanel_foreachProcess(MainPanel* this, MainPanel_ForeachProcessFn fn, Arg arg, bool* wasAnyTagged); +extern bool MainPanel_foreachProcess(MainPanel* this, MainPanel_ForeachProcessFn fn, Arg arg, bool* wasAnyTagged); extern PanelClass MainPanel_class; -MainPanel* MainPanel_new(); +extern MainPanel* MainPanel_new(); -void MainPanel_setState(MainPanel* this, State* state); +extern void MainPanel_setState(MainPanel* this, State* state); -void MainPanel_delete(Object* object); +extern void MainPanel_delete(Object* object); #endif diff --git a/Meter.h b/Meter.h index d98c910e..36e0e815 100644 --- a/Meter.h +++ b/Meter.h @@ -109,17 +109,17 @@ typedef struct GraphData_ { extern MeterClass Meter_class; -Meter* Meter_new(struct ProcessList_* pl, int param, MeterClass* type); +extern Meter* Meter_new(struct ProcessList_* pl, int param, MeterClass* type); -int Meter_humanUnit(char* buffer, unsigned long int value, int size); +extern int Meter_humanUnit(char* buffer, unsigned long int value, int size); -void Meter_delete(Object* cast); +extern void Meter_delete(Object* cast); -void Meter_setCaption(Meter* this, const char* caption); +extern void Meter_setCaption(Meter* this, const char* caption); -void Meter_setMode(Meter* this, int modeIndex); +extern void Meter_setMode(Meter* this, int modeIndex); -ListItem* Meter_toListItem(Meter* this, bool moving); +extern ListItem* Meter_toListItem(Meter* this, bool moving); /* ---------- TextMeterMode ---------- */ diff --git a/MetersPanel.h b/MetersPanel.h index e00169c8..12eabbe6 100644 --- a/MetersPanel.h +++ b/MetersPanel.h @@ -34,10 +34,10 @@ struct MetersPanel_ { // In , arrows (U+2019..U+2199) are // considered "Ambiguous characters". -void MetersPanel_setMoving(MetersPanel* this, bool moving); +extern void MetersPanel_setMoving(MetersPanel* this, bool moving); extern PanelClass MetersPanel_class; -MetersPanel* MetersPanel_new(Settings* settings, const char* header, Vector* meters, ScreenManager* scr); +extern MetersPanel* MetersPanel_new(Settings* settings, const char* header, Vector* meters, ScreenManager* scr); #endif diff --git a/Object.h b/Object.h index 19a667c8..bcf2c481 100644 --- a/Object.h +++ b/Object.h @@ -46,7 +46,7 @@ extern ObjectClass Object_class; #ifdef DEBUG -bool Object_isA(Object* o, const ObjectClass* klass); +extern bool Object_isA(Object* o, const ObjectClass* klass); #endif diff --git a/OpenFilesScreen.h b/OpenFilesScreen.h index 8160cfe2..39c71d5b 100644 --- a/OpenFilesScreen.h +++ b/OpenFilesScreen.h @@ -34,12 +34,12 @@ typedef struct OpenFilesScreen_ { extern InfoScreenClass OpenFilesScreen_class; -OpenFilesScreen* OpenFilesScreen_new(Process* process); +extern OpenFilesScreen* OpenFilesScreen_new(Process* process); -void OpenFilesScreen_delete(Object* this); +extern void OpenFilesScreen_delete(Object* this); -void OpenFilesScreen_draw(InfoScreen* this); +extern void OpenFilesScreen_draw(InfoScreen* this); -void OpenFilesScreen_scan(InfoScreen* this); +extern void OpenFilesScreen_scan(InfoScreen* this); #endif diff --git a/Panel.h b/Panel.h index 5253fc2e..b7480c6b 100644 --- a/Panel.h +++ b/Panel.h @@ -75,52 +75,52 @@ struct Panel_ { extern PanelClass Panel_class; -Panel* Panel_new(int x, int y, int w, int h, bool owner, ObjectClass* type, FunctionBar* fuBar); +extern Panel* Panel_new(int x, int y, int w, int h, bool owner, ObjectClass* type, FunctionBar* fuBar); -void Panel_delete(Object* cast); +extern void Panel_delete(Object* cast); -void Panel_init(Panel* this, int x, int y, int w, int h, ObjectClass* type, bool owner, FunctionBar* fuBar); +extern void Panel_init(Panel* this, int x, int y, int w, int h, ObjectClass* type, bool owner, FunctionBar* fuBar); -void Panel_done(Panel* this); +extern void Panel_done(Panel* this); -void Panel_setSelectionColor(Panel* this, int color); +extern void Panel_setSelectionColor(Panel* this, int color); -RichString* Panel_getHeader(Panel* this); +extern RichString* Panel_getHeader(Panel* this); extern void Panel_setHeader(Panel* this, const char* header); -void Panel_move(Panel* this, int x, int y); +extern void Panel_move(Panel* this, int x, int y); -void Panel_resize(Panel* this, int w, int h); +extern void Panel_resize(Panel* this, int w, int h); -void Panel_prune(Panel* this); +extern void Panel_prune(Panel* this); -void Panel_add(Panel* this, Object* o); +extern void Panel_add(Panel* this, Object* o); -void Panel_insert(Panel* this, int i, Object* o); +extern void Panel_insert(Panel* this, int i, Object* o); -void Panel_set(Panel* this, int i, Object* o); +extern void Panel_set(Panel* this, int i, Object* o); -Object* Panel_get(Panel* this, int i); +extern Object* Panel_get(Panel* this, int i); -Object* Panel_remove(Panel* this, int i); +extern Object* Panel_remove(Panel* this, int i); -Object* Panel_getSelected(Panel* this); +extern Object* Panel_getSelected(Panel* this); -void Panel_moveSelectedUp(Panel* this); +extern void Panel_moveSelectedUp(Panel* this); -void Panel_moveSelectedDown(Panel* this); +extern void Panel_moveSelectedDown(Panel* this); -int Panel_getSelectedIndex(Panel* this); +extern int Panel_getSelectedIndex(Panel* this); -int Panel_size(Panel* this); +extern int Panel_size(Panel* this); -void Panel_setSelected(Panel* this, int selected); +extern void Panel_setSelected(Panel* this, int selected); -void Panel_draw(Panel* this, bool focus); +extern void Panel_draw(Panel* this, bool focus); -bool Panel_onKey(Panel* this, int key); +extern bool Panel_onKey(Panel* this, int key); -HandlerResult Panel_selectByTyping(Panel* this, int ch); +extern HandlerResult Panel_selectByTyping(Panel* this, int ch); #endif diff --git a/Process.h b/Process.h index f702ca00..7ecd81c5 100644 --- a/Process.h +++ b/Process.h @@ -173,36 +173,36 @@ typedef struct ProcessClass_ { extern char Process_pidFormat[20]; -void Process_setupColumnWidths(); +extern void Process_setupColumnWidths(); -void Process_humanNumber(RichString* str, unsigned long number, bool coloring); +extern void Process_humanNumber(RichString* str, unsigned long number, bool coloring); -void Process_colorNumber(RichString* str, unsigned long long number, bool coloring); +extern void Process_colorNumber(RichString* str, unsigned long long number, bool coloring); -void Process_printTime(RichString* str, unsigned long long totalHundredths); +extern void Process_printTime(RichString* str, unsigned long long totalHundredths); -void Process_outputRate(RichString* str, char* buffer, int n, double rate, int coloring); +extern void Process_outputRate(RichString* str, char* buffer, int n, double rate, int coloring); -void Process_writeField(Process* this, RichString* str, ProcessField field); +extern void Process_writeField(Process* this, RichString* str, ProcessField field); -void Process_display(Object* cast, RichString* out); +extern void Process_display(Object* cast, RichString* out); -void Process_done(Process* this); +extern void Process_done(Process* this); extern ProcessClass Process_class; -void Process_init(Process* this, struct Settings_* settings); +extern void Process_init(Process* this, struct Settings_* settings); -void Process_toggleTag(Process* this); +extern void Process_toggleTag(Process* this); -bool Process_setPriority(Process* this, int priority); +extern bool Process_setPriority(Process* this, int priority); -bool Process_changePriorityBy(Process* this, int delta); +extern bool Process_changePriorityBy(Process* this, int delta); -void Process_sendSignal(Process* this, int sgn); +extern void Process_sendSignal(Process* this, int sgn); -long Process_pidCompare(const void* v1, const void* v2); +extern long Process_pidCompare(const void* v1, const void* v2); -long Process_compare(const void* v1, const void* v2); +extern long Process_compare(const void* v1, const void* v2); #endif diff --git a/ProcessList.h b/ProcessList.h index 572d4843..ddc6f3fa 100644 --- a/ProcessList.h +++ b/ProcessList.h @@ -71,32 +71,32 @@ void ProcessList_delete(ProcessList* pl); void ProcessList_goThroughEntries(ProcessList* pl); -ProcessList* ProcessList_init(ProcessList* this, ObjectClass* klass, UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId); +extern ProcessList* ProcessList_init(ProcessList* this, ObjectClass* klass, UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId); -void ProcessList_done(ProcessList* this); +extern void ProcessList_done(ProcessList* this); -void ProcessList_setPanel(ProcessList* this, Panel* panel); +extern void ProcessList_setPanel(ProcessList* this, Panel* panel); -void ProcessList_printHeader(ProcessList* this, RichString* header); +extern void ProcessList_printHeader(ProcessList* this, RichString* header); -void ProcessList_add(ProcessList* this, Process* p); +extern void ProcessList_add(ProcessList* this, Process* p); -void ProcessList_remove(ProcessList* this, Process* p); +extern void ProcessList_remove(ProcessList* this, Process* p); -Process* ProcessList_get(ProcessList* this, int idx); +extern Process* ProcessList_get(ProcessList* this, int idx); -int ProcessList_size(ProcessList* this); +extern int ProcessList_size(ProcessList* this); -void ProcessList_sort(ProcessList* this); +extern void ProcessList_sort(ProcessList* this); -ProcessField ProcessList_keyAt(ProcessList* this, int at); +extern ProcessField ProcessList_keyAt(ProcessList* this, int at); -void ProcessList_expandTree(ProcessList* this); +extern void ProcessList_expandTree(ProcessList* this); -void ProcessList_rebuildPanel(ProcessList* this); +extern void ProcessList_rebuildPanel(ProcessList* this); -Process* ProcessList_getProcess(ProcessList* this, pid_t pid, bool* preExisting, Process_New constructor); +extern Process* ProcessList_getProcess(ProcessList* this, pid_t pid, bool* preExisting, Process_New constructor); -void ProcessList_scan(ProcessList* this); +extern void ProcessList_scan(ProcessList* this); #endif diff --git a/RichString.h b/RichString.h index f5b5cba1..a294a550 100644 --- a/RichString.h +++ b/RichString.h @@ -71,24 +71,24 @@ typedef struct RichString_ { extern void RichString_setAttrn(RichString* this, int attrs, int start, int finish); -int RichString_findChar(RichString* this, char c, int start); +extern int RichString_findChar(RichString* this, char c, int start); #else -void RichString_setAttrn(RichString* this, int attrs, int start, int finish); +extern void RichString_setAttrn(RichString* this, int attrs, int start, int finish); -int RichString_findChar(RichString* this, char c, int start); +extern int RichString_findChar(RichString* this, char c, int start); #endif -void RichString_prune(RichString* this); +extern void RichString_prune(RichString* this); -void RichString_setAttr(RichString* this, int attrs); +extern void RichString_setAttr(RichString* this, int attrs); -void RichString_append(RichString* this, int attrs, const char* data); +extern void RichString_append(RichString* this, int attrs, const char* data); -void RichString_appendn(RichString* this, int attrs, const char* data, int len); +extern void RichString_appendn(RichString* this, int attrs, const char* data, int len); -void RichString_write(RichString* this, int attrs, const char* data); +extern void RichString_write(RichString* this, int attrs, const char* data); #endif diff --git a/ScreenManager.h b/ScreenManager.h index 3d02a883..b7b5617b 100644 --- a/ScreenManager.h +++ b/ScreenManager.h @@ -35,18 +35,18 @@ typedef struct ScreenManager_ { } ScreenManager; -ScreenManager* ScreenManager_new(int x1, int y1, int x2, int y2, Orientation orientation, const Header* header, const Settings* settings, bool owner); +extern ScreenManager* ScreenManager_new(int x1, int y1, int x2, int y2, Orientation orientation, const Header* header, const Settings* settings, bool owner); -void ScreenManager_delete(ScreenManager* this); +extern void ScreenManager_delete(ScreenManager* this); extern int ScreenManager_size(ScreenManager* this); -void ScreenManager_add(ScreenManager* this, Panel* item, int size); +extern void ScreenManager_add(ScreenManager* this, Panel* item, int size); -Panel* ScreenManager_remove(ScreenManager* this, int idx); +extern Panel* ScreenManager_remove(ScreenManager* this, int idx); -void ScreenManager_resize(ScreenManager* this, int x1, int y1, int x2, int y2); +extern void ScreenManager_resize(ScreenManager* this, int x1, int y1, int x2, int y2); -void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey); +extern void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey); #endif diff --git a/Settings.h b/Settings.h index d9dc0683..4f8722b3 100644 --- a/Settings.h +++ b/Settings.h @@ -58,12 +58,12 @@ typedef struct Settings_ { #endif -void Settings_delete(Settings* this); +extern void Settings_delete(Settings* this); -bool Settings_write(Settings* this); +extern bool Settings_write(Settings* this); -Settings* Settings_new(int cpuCount); +extern Settings* Settings_new(int cpuCount); -void Settings_invertSortOrder(Settings* this); +extern void Settings_invertSortOrder(Settings* this); #endif diff --git a/SignalsPanel.h b/SignalsPanel.h index da753546..8720376a 100644 --- a/SignalsPanel.h +++ b/SignalsPanel.h @@ -16,6 +16,6 @@ typedef struct SignalItem_ { } SignalItem; -Panel* SignalsPanel_new(); +extern Panel* SignalsPanel_new(); #endif diff --git a/StringUtils.h b/StringUtils.h index d3378b38..c1070d4f 100644 --- a/StringUtils.h +++ b/StringUtils.h @@ -19,18 +19,18 @@ in the source distribution for its full text. * at compile time (e.g. when they are immutable string literals). :) */ -char* String_cat(const char* s1, const char* s2); +extern char* String_cat(const char* s1, const char* s2); -char* String_trim(const char* in); +extern char* String_trim(const char* in); extern int String_eq(const char* s1, const char* s2); -char** String_split(const char* s, char sep, int* n); +extern char** String_split(const char* s, char sep, int* n); -void String_freeArray(char** s); +extern void String_freeArray(char** s); -char* String_getToken(const char* line, const unsigned short int numMatch); +extern char* String_getToken(const char* line, const unsigned short int numMatch); -char* String_readLine(FILE* fd); +extern char* String_readLine(FILE* fd); #endif diff --git a/TraceScreen.h b/TraceScreen.h index 8845c51a..d43281d9 100644 --- a/TraceScreen.h +++ b/TraceScreen.h @@ -25,16 +25,16 @@ typedef struct TraceScreen_ { extern InfoScreenClass TraceScreen_class; -TraceScreen* TraceScreen_new(Process* process); +extern TraceScreen* TraceScreen_new(Process* process); -void TraceScreen_delete(Object* cast); +extern void TraceScreen_delete(Object* cast); -void TraceScreen_draw(InfoScreen* this); +extern void TraceScreen_draw(InfoScreen* this); -bool TraceScreen_forkTracer(TraceScreen* this); +extern bool TraceScreen_forkTracer(TraceScreen* this); -void TraceScreen_updateTrace(InfoScreen* super); +extern void TraceScreen_updateTrace(InfoScreen* super); -bool TraceScreen_onKey(InfoScreen* super, int ch); +extern bool TraceScreen_onKey(InfoScreen* super, int ch); #endif diff --git a/UsersTable.h b/UsersTable.h index 93ece0dc..9eba59ad 100644 --- a/UsersTable.h +++ b/UsersTable.h @@ -15,11 +15,11 @@ typedef struct UsersTable_ { Hashtable* users; } UsersTable; -UsersTable* UsersTable_new(); +extern UsersTable* UsersTable_new(); -void UsersTable_delete(UsersTable* this); +extern void UsersTable_delete(UsersTable* this); -char* UsersTable_getRef(UsersTable* this, unsigned int uid); +extern char* UsersTable_getRef(UsersTable* this, unsigned int uid); extern void UsersTable_foreach(UsersTable* this, Hashtable_PairFunction f, void* userData); diff --git a/Vector.h b/Vector.h index 85939bf1..b48c8363 100644 --- a/Vector.h +++ b/Vector.h @@ -27,38 +27,38 @@ typedef struct Vector_ { } Vector; -Vector* Vector_new(ObjectClass* type, bool owner, int size); +extern Vector* Vector_new(ObjectClass* type, bool owner, int size); -void Vector_delete(Vector* this); +extern void Vector_delete(Vector* this); #ifdef DEBUG -int Vector_count(Vector* this); +extern int Vector_count(Vector* this); #endif -void Vector_prune(Vector* this); +extern void Vector_prune(Vector* this); // If I were to use only one sorting algorithm for both cases, it would probably be this one: /* */ -void Vector_quickSort(Vector* this); +extern void Vector_quickSort(Vector* this); -void Vector_insertionSort(Vector* this); +extern void Vector_insertionSort(Vector* this); -void Vector_insert(Vector* this, int idx, void* data_); +extern void Vector_insert(Vector* this, int idx, void* data_); -Object* Vector_take(Vector* this, int idx); +extern Object* Vector_take(Vector* this, int idx); -Object* Vector_remove(Vector* this, int idx); +extern Object* Vector_remove(Vector* this, int idx); -void Vector_moveUp(Vector* this, int idx); +extern void Vector_moveUp(Vector* this, int idx); -void Vector_moveDown(Vector* this, int idx); +extern void Vector_moveDown(Vector* this, int idx); -void Vector_set(Vector* this, int idx, void* data_); +extern void Vector_set(Vector* this, int idx, void* data_); #ifdef DEBUG @@ -84,7 +84,7 @@ extern int Vector_size(Vector* this); */ -void Vector_add(Vector* this, void* data_); +extern void Vector_add(Vector* this, void* data_); extern int Vector_indexOf(Vector* this, void* search_, Object_Compare compare); diff --git a/XAlloc.h b/XAlloc.h index 2ebee1a8..97a1c0d0 100644 --- a/XAlloc.h +++ b/XAlloc.h @@ -11,11 +11,11 @@ #include #include -void* xMalloc(size_t size); +extern void* xMalloc(size_t size); -void* xCalloc(size_t nmemb, size_t size); +extern void* xCalloc(size_t nmemb, size_t size); -void* xRealloc(void* ptr, size_t size); +extern void* xRealloc(void* ptr, size_t size); #define xSnprintf(fmt, len, ...) do { int _l=len; int _n=snprintf(fmt, _l, __VA_ARGS__); if (!(_n > -1 && _n < _l)) { curs_set(1); endwin(); err(1, NULL); } } while(0) @@ -32,9 +32,9 @@ void* xRealloc(void* ptr, size_t size); #endif #if (__has_attribute(nonnull) || \ ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3))) -char* xStrdup_(const char* str) __attribute__((nonnull)); +extern char* xStrdup_(const char* str) __attribute__((nonnull)); #endif // __has_attribute(nonnull) || GNU C 3.3 or later -char* xStrdup_(const char* str); +extern char* xStrdup_(const char* str); #endif diff --git a/htop.h b/htop.h index 7faa6c64..26c19180 100644 --- a/htop.h +++ b/htop.h @@ -14,6 +14,6 @@ in the source distribution for its full text. // ---------------------------------------- -int main(int argc, char** argv); +extern int main(int argc, char** argv); #endif diff --git a/linux/Battery.h b/linux/Battery.h index cfb6c324..261cff05 100644 --- a/linux/Battery.h +++ b/linux/Battery.h @@ -29,6 +29,6 @@ Linux battery readings written by Ian P. Hands (iphands@gmail.com, ihands@redhat // READ FROM /sys // ---------------------------------------- -void Battery_getData(double* level, ACPresence* isOnAC); +extern void Battery_getData(double* level, ACPresence* isOnAC); #endif diff --git a/linux/IOPriorityPanel.h b/linux/IOPriorityPanel.h index 9f77a4d9..0bf74f50 100644 --- a/linux/IOPriorityPanel.h +++ b/linux/IOPriorityPanel.h @@ -13,9 +13,9 @@ in the source distribution for its full text. #include "IOPriority.h" #include "ListItem.h" -Panel* IOPriorityPanel_new(IOPriority currPrio); +extern Panel* IOPriorityPanel_new(IOPriority currPrio); -IOPriority IOPriorityPanel_getIOPriority(Panel* this); +extern IOPriority IOPriorityPanel_getIOPriority(Panel* this); #endif diff --git a/linux/LinuxCRT.h b/linux/LinuxCRT.h index f8c43e4d..966dfecf 100644 --- a/linux/LinuxCRT.h +++ b/linux/LinuxCRT.h @@ -12,6 +12,6 @@ in the source distribution for its full text. #ifdef HAVE_EXECINFO_H #endif -void CRT_handleSIGSEGV(int sgn); +extern void CRT_handleSIGSEGV(int sgn); #endif diff --git a/linux/LinuxProcessList.h b/linux/LinuxProcessList.h index f30b487d..cf369e38 100644 --- a/linux/LinuxProcessList.h +++ b/linux/LinuxProcessList.h @@ -98,9 +98,9 @@ typedef struct LinuxProcessList_ { #endif -ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId); +extern ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId); -void ProcessList_delete(ProcessList* pl); +extern void ProcessList_delete(ProcessList* pl); #ifdef HAVE_TASKSTATS @@ -123,6 +123,6 @@ void ProcessList_delete(ProcessList* pl); #endif -void ProcessList_goThroughEntries(ProcessList* super); +extern void ProcessList_goThroughEntries(ProcessList* super); #endif diff --git a/linux/Platform.h b/linux/Platform.h index b0456e5b..89b0a301 100644 --- a/linux/Platform.h +++ b/linux/Platform.h @@ -27,22 +27,22 @@ extern const SignalItem Platform_signals[]; extern const unsigned int Platform_numberOfSignals; -void Platform_setBindings(Htop_Action* keys); +extern void Platform_setBindings(Htop_Action* keys); extern MeterClass* Platform_meterTypes[]; -int Platform_getUptime(); +extern int Platform_getUptime(); -void Platform_getLoadAverage(double* one, double* five, double* fifteen); +extern void Platform_getLoadAverage(double* one, double* five, double* fifteen); -int Platform_getMaxPid(); +extern int Platform_getMaxPid(); -double Platform_setCPUValues(Meter* this, int cpu); +extern double Platform_setCPUValues(Meter* this, int cpu); -void Platform_setMemoryValues(Meter* this); +extern void Platform_setMemoryValues(Meter* this); -void Platform_setSwapValues(Meter* this); +extern void Platform_setSwapValues(Meter* this); -char* Platform_getProcessEnv(pid_t pid); +extern char* Platform_getProcessEnv(pid_t pid); #endif