mirror of https://github.com/xzeldon/htop.git
Add ProcessList_delete to the variable interface.
This commit is contained in:
parent
ff4d1b466f
commit
cda6bdd56b
|
@ -129,6 +129,7 @@ typedef struct ProcessList_ {
|
||||||
} ProcessList;
|
} ProcessList;
|
||||||
|
|
||||||
ProcessList* ProcessList_new(UsersTable* ut, Hashtable* pidWhiteList);
|
ProcessList* ProcessList_new(UsersTable* ut, Hashtable* pidWhiteList);
|
||||||
|
void ProcessList_delete(ProcessList* pl);
|
||||||
void ProcessList_scan(ProcessList* pl);
|
void ProcessList_scan(ProcessList* pl);
|
||||||
|
|
||||||
}*/
|
}*/
|
||||||
|
@ -211,13 +212,12 @@ ProcessList* ProcessList_init(ProcessList* this, UsersTable* usersTable, Hashtab
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProcessList_delete(ProcessList* this) {
|
void ProcessList_done(ProcessList* this) {
|
||||||
Hashtable_delete(this->processTable);
|
Hashtable_delete(this->processTable);
|
||||||
Vector_delete(this->processes);
|
Vector_delete(this->processes);
|
||||||
Vector_delete(this->processes2);
|
Vector_delete(this->processes2);
|
||||||
free(this->cpus);
|
free(this->cpus);
|
||||||
free(this->fields);
|
free(this->fields);
|
||||||
free(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProcessList_setPanel(ProcessList* this, Panel* panel) {
|
void ProcessList_setPanel(ProcessList* this, Panel* panel) {
|
||||||
|
|
|
@ -124,6 +124,7 @@ typedef struct ProcessList_ {
|
||||||
} ProcessList;
|
} ProcessList;
|
||||||
|
|
||||||
ProcessList* ProcessList_new(UsersTable* ut, Hashtable* pidWhiteList);
|
ProcessList* ProcessList_new(UsersTable* ut, Hashtable* pidWhiteList);
|
||||||
|
void ProcessList_delete(ProcessList* pl);
|
||||||
void ProcessList_scan(ProcessList* pl);
|
void ProcessList_scan(ProcessList* pl);
|
||||||
|
|
||||||
|
|
||||||
|
@ -133,7 +134,7 @@ extern const char *ProcessList_treeStrUtf8[TREE_STR_COUNT];
|
||||||
|
|
||||||
ProcessList* ProcessList_init(ProcessList* this, UsersTable* usersTable, Hashtable* pidWhiteList);
|
ProcessList* ProcessList_init(ProcessList* this, UsersTable* usersTable, Hashtable* pidWhiteList);
|
||||||
|
|
||||||
void ProcessList_delete(ProcessList* this);
|
void ProcessList_done(ProcessList* this);
|
||||||
|
|
||||||
void ProcessList_setPanel(ProcessList* this, Panel* panel);
|
void ProcessList_setPanel(ProcessList* this, Panel* panel);
|
||||||
|
|
||||||
|
|
|
@ -77,6 +77,11 @@ ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList) {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ProcessList_delete(ProcessList* this) {
|
||||||
|
ProcessList_done(this);
|
||||||
|
free(this);
|
||||||
|
}
|
||||||
|
|
||||||
static ssize_t xread(int fd, void *buf, size_t count) {
|
static ssize_t xread(int fd, void *buf, size_t count) {
|
||||||
// Read some bytes. Retry on EINTR and when we don't get as many bytes as we requested.
|
// Read some bytes. Retry on EINTR and when we don't get as many bytes as we requested.
|
||||||
size_t alreadyRead = 0;
|
size_t alreadyRead = 0;
|
||||||
|
|
|
@ -26,6 +26,11 @@ ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList) {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ProcessList_delete(ProcessList* this) {
|
||||||
|
ProcessList_done(this);
|
||||||
|
free(this);
|
||||||
|
}
|
||||||
|
|
||||||
void ProcessList_scan(ProcessList* this) {
|
void ProcessList_scan(ProcessList* this) {
|
||||||
(void) this;
|
(void) this;
|
||||||
// stub!
|
// stub!
|
||||||
|
|
|
@ -13,6 +13,8 @@ in the source distribution for its full text.
|
||||||
|
|
||||||
ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList);
|
ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList);
|
||||||
|
|
||||||
|
void ProcessList_delete(ProcessList* this);
|
||||||
|
|
||||||
void ProcessList_scan(ProcessList* this);
|
void ProcessList_scan(ProcessList* this);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue