Remove superfluous 'extern's from function declarations.

Applied via:

  $ find * -name '*.h' -exec sed -i -r 's/^extern (.+\()/\1/;' {} +

Suggested-by: Bert Wesarg <bert.wesarg@googlemail.com>
This commit is contained in:
Zev Weiss 2020-09-02 02:38:44 -05:00
parent a1a027b9bd
commit 7b7822b896
44 changed files with 257 additions and 257 deletions

View File

@ -37,19 +37,19 @@ typedef struct State_ {
} State; } State;
extern Object* Action_pickFromVector(State* st, Panel* list, int x, bool followProcess); Object* Action_pickFromVector(State* st, Panel* list, int x, bool followProcess);
// ---------------------------------------- // ----------------------------------------
extern bool Action_setUserOnly(const char* userName, uid_t* userId); bool Action_setUserOnly(const char* userName, uid_t* userId);
extern Htop_Reaction Action_setSortKey(Settings* settings, ProcessField sortKey); Htop_Reaction Action_setSortKey(Settings* settings, ProcessField sortKey);
// ---------------------------------------- // ----------------------------------------
extern Htop_Reaction Action_follow(State* st); Htop_Reaction Action_follow(State* st);
extern void Action_setBindings(Htop_Action* keys); void Action_setBindings(Htop_Action* keys);
#endif #endif

View File

@ -28,23 +28,23 @@ typedef struct Affinity_ {
} Affinity; } Affinity;
extern Affinity* Affinity_new(ProcessList* pl); Affinity* Affinity_new(ProcessList* pl);
extern void Affinity_delete(Affinity* this); void Affinity_delete(Affinity* this);
extern void Affinity_add(Affinity* this, int id); void Affinity_add(Affinity* this, int id);
#ifdef HAVE_LIBHWLOC #ifdef HAVE_LIBHWLOC
extern Affinity* Affinity_get(Process* proc, ProcessList* pl); Affinity* Affinity_get(Process* proc, ProcessList* pl);
extern bool Affinity_set(Process* proc, Arg arg); bool Affinity_set(Process* proc, Arg arg);
#elif HAVE_LINUX_AFFINITY #elif HAVE_LINUX_AFFINITY
extern Affinity* Affinity_get(Process* proc, ProcessList* pl); Affinity* Affinity_get(Process* proc, ProcessList* pl);
extern bool Affinity_set(Process* proc, Arg arg); bool Affinity_set(Process* proc, Arg arg);
#endif #endif

View File

@ -31,8 +31,8 @@ in the source distribution for its full text.
extern PanelClass AffinityPanel_class; extern PanelClass AffinityPanel_class;
extern Panel* AffinityPanel_new(ProcessList* pl, Affinity* affinity, int* width); Panel* AffinityPanel_new(ProcessList* pl, Affinity* affinity, int* width);
extern Affinity* AffinityPanel_getAffinity(Panel* super, ProcessList* pl); Affinity* AffinityPanel_getAffinity(Panel* super, ProcessList* pl);
#endif #endif

View File

@ -17,6 +17,6 @@ typedef struct AvailableColumnsPanel_ {
extern PanelClass AvailableColumnsPanel_class; extern PanelClass AvailableColumnsPanel_class;
extern AvailableColumnsPanel* AvailableColumnsPanel_new(Panel* columns); AvailableColumnsPanel* AvailableColumnsPanel_new(Panel* columns);
#endif #endif

View File

@ -25,6 +25,6 @@ typedef struct AvailableMetersPanel_ {
extern PanelClass AvailableMetersPanel_class; extern PanelClass AvailableMetersPanel_class;
extern AvailableMetersPanel* AvailableMetersPanel_new(Settings* settings, Header* header, Panel* leftMeters, Panel* rightMeters, ScreenManager* scr, ProcessList* pl); AvailableMetersPanel* AvailableMetersPanel_new(Settings* settings, Header* header, Panel* leftMeters, Panel* rightMeters, ScreenManager* scr, ProcessList* pl);
#endif #endif

22
CRT.h
View File

@ -127,9 +127,9 @@ typedef enum ColorElements_ {
LAST_COLORELEMENT LAST_COLORELEMENT
} ColorElements; } ColorElements;
extern void CRT_fatalError(const char* note) __attribute__ ((noreturn)); void CRT_fatalError(const char* note) __attribute__ ((noreturn));
extern void CRT_handleSIGSEGV(int sgn); void CRT_handleSIGSEGV(int sgn);
#define KEY_ALT(x) (KEY_F(64 - 26) + (x - 'A')) #define KEY_ALT(x) (KEY_F(64 - 26) + (x - 'A'))
@ -170,9 +170,9 @@ extern void *backtraceArray[128];
#define DIE(msg) do { CRT_done(); fprintf(stderr, msg); exit(1); } while(0) #define DIE(msg) do { CRT_done(); fprintf(stderr, msg); exit(1); } while(0)
extern void CRT_dropPrivileges(); void CRT_dropPrivileges();
extern void CRT_restorePrivileges(); void CRT_restorePrivileges();
#else #else
@ -187,18 +187,18 @@ extern void CRT_restorePrivileges();
// TODO: pass an instance of Settings instead. // TODO: pass an instance of Settings instead.
extern void CRT_init(int delay, int colorScheme, bool allowUnicode); void CRT_init(int delay, int colorScheme, bool allowUnicode);
extern void CRT_done(); void CRT_done();
extern void CRT_fatalError(const char* note); void CRT_fatalError(const char* note);
extern int CRT_readKey(); int CRT_readKey();
extern void CRT_disableDelay(); void CRT_disableDelay();
extern void CRT_enableDelay(); void CRT_enableDelay();
extern void CRT_setColors(int colorScheme); void CRT_setColors(int colorScheme);
#endif #endif

View File

@ -22,10 +22,10 @@ typedef struct CategoriesPanel_ {
} CategoriesPanel; } CategoriesPanel;
extern void CategoriesPanel_makeMetersPage(CategoriesPanel* this); void CategoriesPanel_makeMetersPage(CategoriesPanel* this);
extern PanelClass CategoriesPanel_class; extern PanelClass CategoriesPanel_class;
extern CategoriesPanel* CategoriesPanel_new(ScreenManager* scr, Settings* settings, Header* header, ProcessList* pl); CategoriesPanel* CategoriesPanel_new(ScreenManager* scr, Settings* settings, Header* header, ProcessList* pl);
#endif #endif

View File

@ -19,12 +19,12 @@ typedef struct CheckItem_ {
extern ObjectClass CheckItem_class; extern ObjectClass CheckItem_class;
extern CheckItem* CheckItem_newByRef(char* text, bool* ref); CheckItem* CheckItem_newByRef(char* text, bool* ref);
extern CheckItem* CheckItem_newByVal(char* text, bool value); CheckItem* CheckItem_newByVal(char* text, bool value);
extern void CheckItem_set(CheckItem* this, bool value); void CheckItem_set(CheckItem* this, bool value);
extern bool CheckItem_get(CheckItem* this); bool CheckItem_get(CheckItem* this);
#endif #endif

View File

@ -27,6 +27,6 @@ typedef struct ColorsPanel_ {
extern PanelClass ColorsPanel_class; extern PanelClass ColorsPanel_class;
extern ColorsPanel* ColorsPanel_new(Settings* settings, ScreenManager* scr); ColorsPanel* ColorsPanel_new(Settings* settings, ScreenManager* scr);
#endif #endif

View File

@ -20,10 +20,10 @@ typedef struct ColumnsPanel_ {
extern PanelClass ColumnsPanel_class; extern PanelClass ColumnsPanel_class;
extern ColumnsPanel* ColumnsPanel_new(Settings* settings); ColumnsPanel* ColumnsPanel_new(Settings* settings);
extern int ColumnsPanel_fieldNameToIndex(const char* name); int ColumnsPanel_fieldNameToIndex(const char* name);
extern void ColumnsPanel_update(Panel* super); void ColumnsPanel_update(Panel* super);
#endif #endif

View File

@ -21,6 +21,6 @@ typedef struct DisplayOptionsPanel_ {
extern PanelClass DisplayOptionsPanel_class; extern PanelClass DisplayOptionsPanel_class;
extern DisplayOptionsPanel* DisplayOptionsPanel_new(Settings* settings, ScreenManager* scr); DisplayOptionsPanel* DisplayOptionsPanel_new(Settings* settings, ScreenManager* scr);
#endif #endif

View File

@ -9,12 +9,12 @@ typedef struct EnvScreen_ {
extern InfoScreenClass EnvScreen_class; extern InfoScreenClass EnvScreen_class;
extern EnvScreen* EnvScreen_new(Process* process); EnvScreen* EnvScreen_new(Process* process);
extern void EnvScreen_delete(Object* this); void EnvScreen_delete(Object* this);
extern void EnvScreen_draw(InfoScreen* this); void EnvScreen_draw(InfoScreen* this);
extern void EnvScreen_scan(InfoScreen* this); void EnvScreen_scan(InfoScreen* this);
#endif #endif

View File

@ -20,18 +20,18 @@ typedef struct FunctionBar_ {
extern FunctionBar* FunctionBar_newEnterEsc(const char* enter, const char* esc); FunctionBar* FunctionBar_newEnterEsc(const char* enter, const char* esc);
extern FunctionBar* FunctionBar_new(const char* const* functions, const char* const* keys, const int* events); FunctionBar* FunctionBar_new(const char* const* functions, const char* const* keys, const int* events);
extern void FunctionBar_delete(FunctionBar* this); void FunctionBar_delete(FunctionBar* this);
extern void FunctionBar_setLabel(FunctionBar* this, int event, const char* text); void FunctionBar_setLabel(FunctionBar* this, int event, const char* text);
extern void FunctionBar_draw(const FunctionBar* this, char* buffer); void FunctionBar_draw(const FunctionBar* this, char* buffer);
extern void FunctionBar_drawAttr(const FunctionBar* this, char* buffer, int attr); void FunctionBar_drawAttr(const FunctionBar* this, char* buffer, int attr);
extern int FunctionBar_synthesizeEvent(const FunctionBar* this, int pos); int FunctionBar_synthesizeEvent(const FunctionBar* this, int pos);
#endif #endif

View File

@ -28,20 +28,20 @@ struct Hashtable_ {
#ifdef DEBUG #ifdef DEBUG
extern int Hashtable_count(Hashtable* this); int Hashtable_count(Hashtable* this);
#endif #endif
extern Hashtable* Hashtable_new(int size, bool owner); Hashtable* Hashtable_new(int size, bool owner);
extern void Hashtable_delete(Hashtable* this); void Hashtable_delete(Hashtable* this);
extern void Hashtable_put(Hashtable* this, unsigned int key, void* value); void Hashtable_put(Hashtable* this, unsigned int key, void* value);
extern void* Hashtable_remove(Hashtable* this, unsigned int key); void* Hashtable_remove(Hashtable* this, unsigned int key);
extern void* Hashtable_get(Hashtable* this, unsigned int key); void* Hashtable_get(Hashtable* this, unsigned int key);
extern void Hashtable_foreach(Hashtable* this, Hashtable_PairFunction f, void* userData); void Hashtable_foreach(Hashtable* this, Hashtable_PairFunction f, void* userData);
#endif #endif

View File

@ -29,30 +29,30 @@ typedef struct Header_ {
#define Header_forEachColumn(this_, i_) for (int (i_)=0; (i_) < (this_)->nrColumns; ++(i_)) #define Header_forEachColumn(this_, i_) for (int (i_)=0; (i_) < (this_)->nrColumns; ++(i_))
#endif #endif
extern Header* Header_new(struct ProcessList_* pl, Settings* settings, int nrColumns); Header* Header_new(struct ProcessList_* pl, Settings* settings, int nrColumns);
extern void Header_delete(Header* this); void Header_delete(Header* this);
extern void Header_populateFromSettings(Header* this); void Header_populateFromSettings(Header* this);
extern void Header_writeBackToSettings(const Header* this); void Header_writeBackToSettings(const Header* this);
extern MeterModeId Header_addMeterByName(Header* this, char* name, int column); MeterModeId Header_addMeterByName(Header* this, char* name, int column);
extern void Header_setMode(Header* this, int i, MeterModeId mode, int column); void Header_setMode(Header* this, int i, MeterModeId mode, int column);
extern Meter* Header_addMeterByClass(Header* this, MeterClass* type, int param, int column); Meter* Header_addMeterByClass(Header* this, MeterClass* type, int param, int column);
extern int Header_size(Header* this, int column); int Header_size(Header* this, int column);
extern char* Header_readMeterName(Header* this, int i, int column); char* Header_readMeterName(Header* this, int i, int column);
extern MeterModeId Header_readMeterMode(Header* this, int i, int column); MeterModeId Header_readMeterMode(Header* this, int i, int column);
extern void Header_reinit(Header* this); void Header_reinit(Header* this);
extern void Header_draw(const Header* this); void Header_draw(const Header* this);
extern int Header_calculateHeight(Header* this); int Header_calculateHeight(Header* this);
#endif #endif

View File

@ -39,24 +39,24 @@ typedef struct IncSet_ {
typedef const char* (*IncMode_GetPanelValue)(Panel*, int); typedef const char* (*IncMode_GetPanelValue)(Panel*, int);
extern void IncSet_reset(IncSet* this, IncType type); void IncSet_reset(IncSet* this, IncType type);
extern IncSet* IncSet_new(FunctionBar* bar); IncSet* IncSet_new(FunctionBar* bar);
extern void IncSet_delete(IncSet* this); void IncSet_delete(IncSet* this);
extern bool IncSet_next(IncSet* this, IncType type, Panel* panel, IncMode_GetPanelValue getPanelValue); bool IncSet_next(IncSet* this, IncType type, Panel* panel, IncMode_GetPanelValue getPanelValue);
extern bool IncSet_prev(IncSet* this, IncType type, Panel* panel, IncMode_GetPanelValue getPanelValue); bool IncSet_prev(IncSet* this, IncType type, Panel* panel, IncMode_GetPanelValue getPanelValue);
extern bool IncSet_handleKey(IncSet* this, int ch, Panel* panel, IncMode_GetPanelValue getPanelValue, Vector* lines); bool IncSet_handleKey(IncSet* this, int ch, Panel* panel, IncMode_GetPanelValue getPanelValue, Vector* lines);
extern const char* IncSet_getListItemValue(Panel* panel, int i); const char* IncSet_getListItemValue(Panel* panel, int i);
extern void IncSet_activate(IncSet* this, IncType type, Panel* panel); void IncSet_activate(IncSet* this, IncType type, Panel* panel);
extern void IncSet_drawBar(IncSet* this); void IncSet_drawBar(IncSet* this);
extern int IncSet_synthesizeEvent(IncSet* this, int x); int IncSet_synthesizeEvent(IncSet* this, int x);
#endif #endif

View File

@ -36,16 +36,16 @@ struct InfoScreen_ {
Vector* lines; Vector* lines;
}; };
extern InfoScreen* InfoScreen_init(InfoScreen* this, Process* process, FunctionBar* bar, int height, const char* panelHeader); InfoScreen* InfoScreen_init(InfoScreen* this, Process* process, FunctionBar* bar, int height, const char* panelHeader);
extern InfoScreen* InfoScreen_done(InfoScreen* this); InfoScreen* InfoScreen_done(InfoScreen* this);
extern void InfoScreen_drawTitled(InfoScreen* this, const char* fmt, ...); void InfoScreen_drawTitled(InfoScreen* this, const char* fmt, ...);
extern void InfoScreen_addLine(InfoScreen* this, const char* line); void InfoScreen_addLine(InfoScreen* this, const char* line);
extern void InfoScreen_appendLine(InfoScreen* this, const char* line); void InfoScreen_appendLine(InfoScreen* this, const char* line);
extern void InfoScreen_run(InfoScreen* this); void InfoScreen_run(InfoScreen* this);
#endif #endif

View File

@ -19,12 +19,12 @@ typedef struct ListItem_ {
extern ObjectClass ListItem_class; extern ObjectClass ListItem_class;
extern ListItem* ListItem_new(const char* value, int key); ListItem* ListItem_new(const char* value, int key);
extern void ListItem_append(ListItem* this, const char* text); void ListItem_append(ListItem* this, const char* text);
extern const char* ListItem_getRef(ListItem* this); const char* ListItem_getRef(ListItem* this);
extern long ListItem_compare(const void* cast1, const void* cast2); long ListItem_compare(const void* cast1, const void* cast2);
#endif #endif

View File

@ -25,22 +25,22 @@ typedef bool(*MainPanel_ForeachProcessFn)(Process*, Arg);
#define MainPanel_getFunctionBar(this_) (((Panel*)(this_))->defaultBar) #define MainPanel_getFunctionBar(this_) (((Panel*)(this_))->defaultBar)
extern void MainPanel_updateTreeFunctions(MainPanel* this, bool mode); void MainPanel_updateTreeFunctions(MainPanel* this, bool mode);
extern void MainPanel_pidSearch(MainPanel* this, int ch); void MainPanel_pidSearch(MainPanel* this, int ch);
extern int MainPanel_selectedPid(MainPanel* this); int MainPanel_selectedPid(MainPanel* this);
extern const char* MainPanel_getValue(MainPanel* this, int i); const char* MainPanel_getValue(MainPanel* this, int i);
extern bool MainPanel_foreachProcess(MainPanel* this, MainPanel_ForeachProcessFn fn, Arg arg, bool* wasAnyTagged); bool MainPanel_foreachProcess(MainPanel* this, MainPanel_ForeachProcessFn fn, Arg arg, bool* wasAnyTagged);
extern PanelClass MainPanel_class; extern PanelClass MainPanel_class;
extern MainPanel* MainPanel_new(); MainPanel* MainPanel_new();
extern void MainPanel_setState(MainPanel* this, State* state); void MainPanel_setState(MainPanel* this, State* state);
extern void MainPanel_delete(Object* object); void MainPanel_delete(Object* object);
#endif #endif

12
Meter.h
View File

@ -107,17 +107,17 @@ typedef struct GraphData_ {
extern MeterClass Meter_class; extern MeterClass Meter_class;
extern Meter* Meter_new(struct ProcessList_* pl, int param, MeterClass* type); Meter* Meter_new(struct ProcessList_* pl, int param, MeterClass* type);
extern int Meter_humanUnit(char* buffer, unsigned long int value, int size); int Meter_humanUnit(char* buffer, unsigned long int value, int size);
extern void Meter_delete(Object* cast); void Meter_delete(Object* cast);
extern void Meter_setCaption(Meter* this, const char* caption); void Meter_setCaption(Meter* this, const char* caption);
extern void Meter_setMode(Meter* this, int modeIndex); void Meter_setMode(Meter* this, int modeIndex);
extern ListItem* Meter_toListItem(Meter* this, bool moving); ListItem* Meter_toListItem(Meter* this, bool moving);
/* ---------- TextMeterMode ---------- */ /* ---------- TextMeterMode ---------- */

View File

@ -32,10 +32,10 @@ struct MetersPanel_ {
// In <http://unicode.org/reports/tr11/>, arrows (U+2019..U+2199) are // In <http://unicode.org/reports/tr11/>, arrows (U+2019..U+2199) are
// considered "Ambiguous characters". // considered "Ambiguous characters".
extern void MetersPanel_setMoving(MetersPanel* this, bool moving); void MetersPanel_setMoving(MetersPanel* this, bool moving);
extern PanelClass MetersPanel_class; extern PanelClass MetersPanel_class;
extern MetersPanel* MetersPanel_new(Settings* settings, const char* header, Vector* meters, ScreenManager* scr); MetersPanel* MetersPanel_new(Settings* settings, const char* header, Vector* meters, ScreenManager* scr);
#endif #endif

View File

@ -50,7 +50,7 @@ extern ObjectClass Object_class;
#ifdef DEBUG #ifdef DEBUG
extern bool Object_isA(Object* o, const ObjectClass* klass); bool Object_isA(Object* o, const ObjectClass* klass);
#endif #endif

View File

@ -32,12 +32,12 @@ typedef struct OpenFilesScreen_ {
extern InfoScreenClass OpenFilesScreen_class; extern InfoScreenClass OpenFilesScreen_class;
extern OpenFilesScreen* OpenFilesScreen_new(Process* process); OpenFilesScreen* OpenFilesScreen_new(Process* process);
extern void OpenFilesScreen_delete(Object* this); void OpenFilesScreen_delete(Object* this);
extern void OpenFilesScreen_draw(InfoScreen* this); void OpenFilesScreen_draw(InfoScreen* this);
extern void OpenFilesScreen_scan(InfoScreen* this); void OpenFilesScreen_scan(InfoScreen* this);
#endif #endif

50
Panel.h
View File

@ -73,54 +73,54 @@ struct Panel_ {
extern PanelClass Panel_class; extern PanelClass Panel_class;
extern Panel* Panel_new(int x, int y, int w, int h, bool owner, ObjectClass* type, FunctionBar* fuBar); Panel* Panel_new(int x, int y, int w, int h, bool owner, ObjectClass* type, FunctionBar* fuBar);
extern void Panel_delete(Object* cast); void Panel_delete(Object* cast);
extern void Panel_init(Panel* this, int x, int y, int w, int h, ObjectClass* type, bool owner, FunctionBar* fuBar); void Panel_init(Panel* this, int x, int y, int w, int h, ObjectClass* type, bool owner, FunctionBar* fuBar);
extern void Panel_done(Panel* this); void Panel_done(Panel* this);
extern void Panel_setSelectionColor(Panel* this, int color); void Panel_setSelectionColor(Panel* this, int color);
extern RichString* Panel_getHeader(Panel* this); RichString* Panel_getHeader(Panel* this);
extern void Panel_setHeader(Panel* this, const char* header); void Panel_setHeader(Panel* this, const char* header);
extern void Panel_move(Panel* this, int x, int y); void Panel_move(Panel* this, int x, int y);
extern void Panel_resize(Panel* this, int w, int h); void Panel_resize(Panel* this, int w, int h);
extern void Panel_prune(Panel* this); void Panel_prune(Panel* this);
extern void Panel_add(Panel* this, Object* o); void Panel_add(Panel* this, Object* o);
extern void Panel_insert(Panel* this, int i, Object* o); void Panel_insert(Panel* this, int i, Object* o);
extern void Panel_set(Panel* this, int i, Object* o); void Panel_set(Panel* this, int i, Object* o);
extern Object* Panel_get(Panel* this, int i); Object* Panel_get(Panel* this, int i);
extern Object* Panel_remove(Panel* this, int i); Object* Panel_remove(Panel* this, int i);
extern Object* Panel_getSelected(Panel* this); Object* Panel_getSelected(Panel* this);
extern void Panel_moveSelectedUp(Panel* this); void Panel_moveSelectedUp(Panel* this);
extern void Panel_moveSelectedDown(Panel* this); void Panel_moveSelectedDown(Panel* this);
extern int Panel_getSelectedIndex(Panel* this); int Panel_getSelectedIndex(Panel* this);
extern int Panel_size(Panel* this); int Panel_size(Panel* this);
extern void Panel_setSelected(Panel* this, int selected); void Panel_setSelected(Panel* this, int selected);
extern void Panel_draw(Panel* this, bool focus); void Panel_draw(Panel* this, bool focus);
extern void Panel_splice(Panel *this, Vector* from); void Panel_splice(Panel *this, Vector* from);
extern bool Panel_onKey(Panel* this, int key); bool Panel_onKey(Panel* this, int key);
extern HandlerResult Panel_selectByTyping(Panel* this, int ch); HandlerResult Panel_selectByTyping(Panel* this, int ch);
#endif #endif

View File

@ -173,36 +173,36 @@ typedef struct ProcessClass_ {
extern char Process_pidFormat[20]; extern char Process_pidFormat[20];
extern void Process_setupColumnWidths(); void Process_setupColumnWidths();
extern void Process_humanNumber(RichString* str, unsigned long number, bool coloring); void Process_humanNumber(RichString* str, unsigned long number, bool coloring);
extern void Process_colorNumber(RichString* str, unsigned long long number, bool coloring); void Process_colorNumber(RichString* str, unsigned long long number, bool coloring);
extern void Process_printTime(RichString* str, unsigned long long totalHundredths); void Process_printTime(RichString* str, unsigned long long totalHundredths);
extern void Process_outputRate(RichString* str, char* buffer, int n, double rate, int coloring); void Process_outputRate(RichString* str, char* buffer, int n, double rate, int coloring);
extern void Process_writeField(Process* this, RichString* str, ProcessField field); void Process_writeField(Process* this, RichString* str, ProcessField field);
extern void Process_display(Object* cast, RichString* out); void Process_display(Object* cast, RichString* out);
extern void Process_done(Process* this); void Process_done(Process* this);
extern ProcessClass Process_class; extern ProcessClass Process_class;
extern void Process_init(Process* this, struct Settings_* settings); void Process_init(Process* this, struct Settings_* settings);
extern void Process_toggleTag(Process* this); void Process_toggleTag(Process* this);
extern bool Process_setPriority(Process* this, int priority); bool Process_setPriority(Process* this, int priority);
extern bool Process_changePriorityBy(Process* this, Arg delta); bool Process_changePriorityBy(Process* this, Arg delta);
extern bool Process_sendSignal(Process* this, Arg sgn); bool Process_sendSignal(Process* this, Arg sgn);
extern long Process_pidCompare(const void* v1, const void* v2); long Process_pidCompare(const void* v1, const void* v2);
extern long Process_compare(const void* v1, const void* v2); long Process_compare(const void* v1, const void* v2);
#endif #endif

View File

@ -69,32 +69,32 @@ void ProcessList_delete(ProcessList* pl);
void ProcessList_goThroughEntries(ProcessList* pl); void ProcessList_goThroughEntries(ProcessList* pl);
extern ProcessList* ProcessList_init(ProcessList* this, ObjectClass* klass, UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId); ProcessList* ProcessList_init(ProcessList* this, ObjectClass* klass, UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId);
extern void ProcessList_done(ProcessList* this); void ProcessList_done(ProcessList* this);
extern void ProcessList_setPanel(ProcessList* this, Panel* panel); void ProcessList_setPanel(ProcessList* this, Panel* panel);
extern void ProcessList_printHeader(ProcessList* this, RichString* header); void ProcessList_printHeader(ProcessList* this, RichString* header);
extern void ProcessList_add(ProcessList* this, Process* p); void ProcessList_add(ProcessList* this, Process* p);
extern void ProcessList_remove(ProcessList* this, Process* p); void ProcessList_remove(ProcessList* this, Process* p);
extern Process* ProcessList_get(ProcessList* this, int idx); Process* ProcessList_get(ProcessList* this, int idx);
extern int ProcessList_size(ProcessList* this); int ProcessList_size(ProcessList* this);
extern void ProcessList_sort(ProcessList* this); void ProcessList_sort(ProcessList* this);
extern ProcessField ProcessList_keyAt(ProcessList* this, int at); ProcessField ProcessList_keyAt(ProcessList* this, int at);
extern void ProcessList_expandTree(ProcessList* this); void ProcessList_expandTree(ProcessList* this);
extern void ProcessList_rebuildPanel(ProcessList* this); void ProcessList_rebuildPanel(ProcessList* this);
extern Process* ProcessList_getProcess(ProcessList* this, pid_t pid, bool* preExisting, Process_New constructor); Process* ProcessList_getProcess(ProcessList* this, pid_t pid, bool* preExisting, Process_New constructor);
extern void ProcessList_scan(ProcessList* this); void ProcessList_scan(ProcessList* this);
#endif #endif

View File

@ -67,26 +67,26 @@ typedef struct RichString_ {
#ifdef HAVE_LIBNCURSESW #ifdef HAVE_LIBNCURSESW
extern void RichString_setAttrn(RichString* this, int attrs, int start, int finish); void RichString_setAttrn(RichString* this, int attrs, int start, int finish);
extern int RichString_findChar(RichString* this, char c, int start); int RichString_findChar(RichString* this, char c, int start);
#else #else
extern void RichString_setAttrn(RichString* this, int attrs, int start, int finish); void RichString_setAttrn(RichString* this, int attrs, int start, int finish);
extern int RichString_findChar(RichString* this, char c, int start); int RichString_findChar(RichString* this, char c, int start);
#endif #endif
extern void RichString_prune(RichString* this); void RichString_prune(RichString* this);
extern void RichString_setAttr(RichString* this, int attrs); void RichString_setAttr(RichString* this, int attrs);
extern void RichString_append(RichString* this, int attrs, const char* data); void RichString_append(RichString* this, int attrs, const char* data);
extern void RichString_appendn(RichString* this, int attrs, const char* data, int len); void RichString_appendn(RichString* this, int attrs, const char* data, int len);
extern void RichString_write(RichString* this, int attrs, const char* data); void RichString_write(RichString* this, int attrs, const char* data);
#endif #endif

View File

@ -33,18 +33,18 @@ typedef struct ScreenManager_ {
} ScreenManager; } ScreenManager;
extern ScreenManager* ScreenManager_new(int x1, int y1, int x2, int y2, Orientation orientation, const Header* header, const Settings* settings, bool owner); ScreenManager* ScreenManager_new(int x1, int y1, int x2, int y2, Orientation orientation, const Header* header, const Settings* settings, bool owner);
extern void ScreenManager_delete(ScreenManager* this); void ScreenManager_delete(ScreenManager* this);
extern int ScreenManager_size(ScreenManager* this); int ScreenManager_size(ScreenManager* this);
extern void ScreenManager_add(ScreenManager* this, Panel* item, int size); void ScreenManager_add(ScreenManager* this, Panel* item, int size);
extern Panel* ScreenManager_remove(ScreenManager* this, int idx); Panel* ScreenManager_remove(ScreenManager* this, int idx);
extern void ScreenManager_resize(ScreenManager* this, int x1, int y1, int x2, int y2); void ScreenManager_resize(ScreenManager* this, int x1, int y1, int x2, int y2);
extern void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey); void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey);
#endif #endif

View File

@ -63,12 +63,12 @@ typedef struct Settings_ {
#endif #endif
extern void Settings_delete(Settings* this); void Settings_delete(Settings* this);
extern bool Settings_write(Settings* this); bool Settings_write(Settings* this);
extern Settings* Settings_new(int cpuCount); Settings* Settings_new(int cpuCount);
extern void Settings_invertSortOrder(Settings* this); void Settings_invertSortOrder(Settings* this);
#endif #endif

View File

@ -14,6 +14,6 @@ typedef struct SignalItem_ {
} SignalItem; } SignalItem;
extern Panel* SignalsPanel_new(); Panel* SignalsPanel_new();
#endif #endif

View File

@ -17,18 +17,18 @@ in the source distribution for its full text.
* at compile time (e.g. when they are immutable string literals). :) * at compile time (e.g. when they are immutable string literals). :)
*/ */
extern char* String_cat(const char* s1, const char* s2); char* String_cat(const char* s1, const char* s2);
extern char* String_trim(const char* in); char* String_trim(const char* in);
extern int String_eq(const char* s1, const char* s2); int String_eq(const char* s1, const char* s2);
extern char** String_split(const char* s, char sep, int* n); char** String_split(const char* s, char sep, int* n);
extern void String_freeArray(char** s); void String_freeArray(char** s);
extern char* String_getToken(const char* line, const unsigned short int numMatch); char* String_getToken(const char* line, const unsigned short int numMatch);
extern char* String_readLine(FILE* fd); char* String_readLine(FILE* fd);
#endif #endif

View File

@ -23,16 +23,16 @@ typedef struct TraceScreen_ {
extern InfoScreenClass TraceScreen_class; extern InfoScreenClass TraceScreen_class;
extern TraceScreen* TraceScreen_new(Process* process); TraceScreen* TraceScreen_new(Process* process);
extern void TraceScreen_delete(Object* cast); void TraceScreen_delete(Object* cast);
extern void TraceScreen_draw(InfoScreen* this); void TraceScreen_draw(InfoScreen* this);
extern bool TraceScreen_forkTracer(TraceScreen* this); bool TraceScreen_forkTracer(TraceScreen* this);
extern void TraceScreen_updateTrace(InfoScreen* super); void TraceScreen_updateTrace(InfoScreen* super);
extern bool TraceScreen_onKey(InfoScreen* super, int ch); bool TraceScreen_onKey(InfoScreen* super, int ch);
#endif #endif

View File

@ -13,12 +13,12 @@ typedef struct UsersTable_ {
Hashtable* users; Hashtable* users;
} UsersTable; } UsersTable;
extern UsersTable* UsersTable_new(); UsersTable* UsersTable_new();
extern void UsersTable_delete(UsersTable* this); void UsersTable_delete(UsersTable* this);
extern char* UsersTable_getRef(UsersTable* this, unsigned int uid); char* UsersTable_getRef(UsersTable* this, unsigned int uid);
extern void UsersTable_foreach(UsersTable* this, Hashtable_PairFunction f, void* userData); void UsersTable_foreach(UsersTable* this, Hashtable_PairFunction f, void* userData);
#endif #endif

View File

@ -25,42 +25,42 @@ typedef struct Vector_ {
} Vector; } Vector;
extern Vector* Vector_new(ObjectClass* type, bool owner, int size); Vector* Vector_new(ObjectClass* type, bool owner, int size);
extern void Vector_delete(Vector* this); void Vector_delete(Vector* this);
#ifdef DEBUG #ifdef DEBUG
extern int Vector_count(Vector* this); int Vector_count(Vector* this);
#endif #endif
extern void Vector_prune(Vector* this); void Vector_prune(Vector* this);
// If I were to use only one sorting algorithm for both cases, it would probably be this one: // If I were to use only one sorting algorithm for both cases, it would probably be this one:
/* /*
*/ */
extern void Vector_quickSort(Vector* this); void Vector_quickSort(Vector* this);
extern void Vector_insertionSort(Vector* this); void Vector_insertionSort(Vector* this);
extern void Vector_insert(Vector* this, int idx, void* data_); void Vector_insert(Vector* this, int idx, void* data_);
extern Object* Vector_take(Vector* this, int idx); Object* Vector_take(Vector* this, int idx);
extern Object* Vector_remove(Vector* this, int idx); Object* Vector_remove(Vector* this, int idx);
extern void Vector_moveUp(Vector* this, int idx); void Vector_moveUp(Vector* this, int idx);
extern void Vector_moveDown(Vector* this, int idx); void Vector_moveDown(Vector* this, int idx);
extern void Vector_set(Vector* this, int idx, void* data_); void Vector_set(Vector* this, int idx, void* data_);
#ifdef DEBUG #ifdef DEBUG
extern Object* Vector_get(Vector* this, int idx); Object* Vector_get(Vector* this, int idx);
#else #else
@ -70,7 +70,7 @@ extern Object* Vector_get(Vector* this, int idx);
#ifdef DEBUG #ifdef DEBUG
extern int Vector_size(Vector* this); int Vector_size(Vector* this);
#else #else
@ -82,9 +82,9 @@ extern int Vector_size(Vector* this);
*/ */
extern void Vector_add(Vector* this, void* data_); void Vector_add(Vector* this, void* data_);
extern int Vector_indexOf(Vector* this, void* search_, Object_Compare compare); int Vector_indexOf(Vector* this, void* search_, Object_Compare compare);
void Vector_splice(Vector* this, Vector* from); void Vector_splice(Vector* this, Vector* from);

View File

@ -9,13 +9,13 @@
#include <assert.h> #include <assert.h>
#include <stdlib.h> #include <stdlib.h>
extern void fail(void); void fail(void);
extern void* xMalloc(size_t size); void* xMalloc(size_t size);
extern void* xCalloc(size_t nmemb, size_t size); void* xCalloc(size_t nmemb, size_t size);
extern void* xRealloc(void* ptr, size_t size); void* xRealloc(void* ptr, size_t size);
#undef xAsprintf #undef xAsprintf
@ -36,9 +36,9 @@ extern void* xRealloc(void* ptr, size_t size);
#endif #endif
#if (__has_attribute(nonnull) || \ #if (__has_attribute(nonnull) || \
((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3))) ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)))
extern char* xStrdup_(const char* str) __attribute__((nonnull)); char* xStrdup_(const char* str) __attribute__((nonnull));
#endif // __has_attribute(nonnull) || GNU C 3.3 or later #endif // __has_attribute(nonnull) || GNU C 3.3 or later
extern char* xStrdup_(const char* str); char* xStrdup_(const char* str);
#endif #endif

View File

@ -55,14 +55,14 @@ typedef struct FreeBSDProcessList_ {
extern char jail_errmsg[JAIL_ERRMSGLEN]; extern char jail_errmsg[JAIL_ERRMSGLEN];
extern ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId); ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId);
extern void ProcessList_delete(ProcessList* this); void ProcessList_delete(ProcessList* this);
extern char* FreeBSDProcessList_readProcessName(kvm_t* kd, struct kinfo_proc* kproc, int* basenameEnd); char* FreeBSDProcessList_readProcessName(kvm_t* kd, struct kinfo_proc* kproc, int* basenameEnd);
extern char* FreeBSDProcessList_readJailName(struct kinfo_proc* kproc); char* FreeBSDProcessList_readJailName(struct kinfo_proc* kproc);
extern void ProcessList_goThroughEntries(ProcessList* this); void ProcessList_goThroughEntries(ProcessList* this);
#endif #endif

2
htop.h
View File

@ -12,6 +12,6 @@ in the source distribution for its full text.
// ---------------------------------------- // ----------------------------------------
extern int main(int argc, char** argv); int main(int argc, char** argv);
#endif #endif

View File

@ -27,6 +27,6 @@ Linux battery readings written by Ian P. Hands (iphands@gmail.com, ihands@redhat
// READ FROM /sys // READ FROM /sys
// ---------------------------------------- // ----------------------------------------
extern void Battery_getData(double* level, ACPresence* isOnAC); void Battery_getData(double* level, ACPresence* isOnAC);
#endif #endif

View File

@ -11,8 +11,8 @@ in the source distribution for its full text.
#include "IOPriority.h" #include "IOPriority.h"
#include "ListItem.h" #include "ListItem.h"
extern Panel* IOPriorityPanel_new(IOPriority currPrio); Panel* IOPriorityPanel_new(IOPriority currPrio);
extern IOPriority IOPriorityPanel_getIOPriority(Panel* this); IOPriority IOPriorityPanel_getIOPriority(Panel* this);
#endif #endif

View File

@ -10,6 +10,6 @@ in the source distribution for its full text.
#ifdef HAVE_EXECINFO_H #ifdef HAVE_EXECINFO_H
#endif #endif
extern void CRT_handleSIGSEGV(int sgn); void CRT_handleSIGSEGV(int sgn);
#endif #endif

View File

@ -159,9 +159,9 @@ extern ProcessPidColumn Process_pidColumns[];
extern ProcessClass LinuxProcess_class; extern ProcessClass LinuxProcess_class;
extern LinuxProcess* LinuxProcess_new(Settings* settings); LinuxProcess* LinuxProcess_new(Settings* settings);
extern void Process_delete(Object* cast); void Process_delete(Object* cast);
/* /*
[1] Note that before kernel 2.6.26 a process that has not asked for [1] Note that before kernel 2.6.26 a process that has not asked for
@ -173,18 +173,18 @@ extern io_priority;
*/ */
#define LinuxProcess_effectiveIOPriority(p_) (IOPriority_class(p_->ioPriority) == IOPRIO_CLASS_NONE ? IOPriority_tuple(IOPRIO_CLASS_BE, (p_->super.nice + 20) / 5) : p_->ioPriority) #define LinuxProcess_effectiveIOPriority(p_) (IOPriority_class(p_->ioPriority) == IOPRIO_CLASS_NONE ? IOPriority_tuple(IOPRIO_CLASS_BE, (p_->super.nice + 20) / 5) : p_->ioPriority)
extern IOPriority LinuxProcess_updateIOPriority(LinuxProcess* this); IOPriority LinuxProcess_updateIOPriority(LinuxProcess* this);
extern bool LinuxProcess_setIOPriority(LinuxProcess* this, Arg ioprio); bool LinuxProcess_setIOPriority(LinuxProcess* this, Arg ioprio);
#ifdef HAVE_DELAYACCT #ifdef HAVE_DELAYACCT
extern void LinuxProcess_printDelay(float delay_percent, char* buffer, int n); void LinuxProcess_printDelay(float delay_percent, char* buffer, int n);
#endif #endif
extern void LinuxProcess_writeField(Process* this, RichString* str, ProcessField field); void LinuxProcess_writeField(Process* this, RichString* str, ProcessField field);
extern long LinuxProcess_compare(const void* v1, const void* v2); long LinuxProcess_compare(const void* v1, const void* v2);
extern bool Process_isThread(Process* this); bool Process_isThread(Process* this);
#endif #endif

View File

@ -109,9 +109,9 @@ typedef struct LinuxProcessList_ {
#endif #endif
extern ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId); ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId);
extern void ProcessList_delete(ProcessList* pl); void ProcessList_delete(ProcessList* pl);
#ifdef HAVE_TASKSTATS #ifdef HAVE_TASKSTATS
@ -134,6 +134,6 @@ extern void ProcessList_delete(ProcessList* pl);
#endif #endif
extern void ProcessList_goThroughEntries(ProcessList* super); void ProcessList_goThroughEntries(ProcessList* super);
#endif #endif

View File

@ -25,27 +25,27 @@ extern const SignalItem Platform_signals[];
extern const unsigned int Platform_numberOfSignals; extern const unsigned int Platform_numberOfSignals;
extern void Platform_setBindings(Htop_Action* keys); void Platform_setBindings(Htop_Action* keys);
extern MeterClass* Platform_meterTypes[]; extern MeterClass* Platform_meterTypes[];
extern int Platform_getUptime(); int Platform_getUptime();
extern void Platform_getLoadAverage(double* one, double* five, double* fifteen); void Platform_getLoadAverage(double* one, double* five, double* fifteen);
extern int Platform_getMaxPid(); int Platform_getMaxPid();
extern double Platform_setCPUValues(Meter* this, int cpu); double Platform_setCPUValues(Meter* this, int cpu);
extern void Platform_setMemoryValues(Meter* this); void Platform_setMemoryValues(Meter* this);
extern void Platform_setSwapValues(Meter* this); void Platform_setSwapValues(Meter* this);
extern void Platform_setZfsArcValues(Meter* this); void Platform_setZfsArcValues(Meter* this);
extern void Platform_setZfsCompressedArcValues(Meter* this); void Platform_setZfsCompressedArcValues(Meter* this);
extern char* Platform_getProcessEnv(pid_t pid); char* Platform_getProcessEnv(pid_t pid);
extern void Platform_getPressureStall(const char *file, bool some, double* ten, double* sixty, double* threehundred); void Platform_getPressureStall(const char *file, bool some, double* ten, double* sixty, double* threehundred);
#endif #endif

View File

@ -15,7 +15,7 @@ in the source distribution for its full text.
extern int ZfsArcMeter_attributes[]; extern int ZfsArcMeter_attributes[];
extern void ZfsArcMeter_readStats(Meter* this, ZfsArcStats* stats); void ZfsArcMeter_readStats(Meter* this, ZfsArcStats* stats);
extern MeterClass ZfsArcMeter_class; extern MeterClass ZfsArcMeter_class;