Portability: make list of default screens per-platform

This commit is contained in:
Hisham Muhammad
2018-04-06 12:41:36 -03:00
parent 657836a2ae
commit 6fe06fb7e5
17 changed files with 123 additions and 25 deletions

View File

@ -12,5 +12,4 @@ in the source distribution for its full text.
void Battery_getData(double* level, ACPresence* isOnAC);
#endif

View File

@ -92,7 +92,15 @@ static int percentages(int cnt, int64_t *out, int64_t *new, int64_t *old, int64_
return (total_change);
}
ProcessField Platform_defaultFields[] = { PID, USER, PRIORITY, NICE, M_SIZE, M_RESIDENT, STATE, PERCENT_CPU, PERCENT_MEM, TIME, COMM, 0 };
ScreenDefaults Platform_defaultScreens[] = {
{
.name = "Default",
.columns = "PID USER PRIORITY NICE M_SIZE M_RESIDENT STATE PERCENT_CPU PERCENT_MEM TIME Command",
.sortKey = "PERCENT_CPU",
},
};
const unsigned int Platform_numberOfDefaultScreens = sizeof(Platform_defaultScreens)/sizeof(ScreenDefaults);
int Platform_numberOfFields = LAST_PROCESSFIELD;

View File

@ -32,7 +32,9 @@ extern ProcessFieldData Process_fields[];
* The routine assumes modulo arithmetic. This function is especially
* useful on BSD machines for calculating cpu state percentages.
*/
extern ProcessField Platform_defaultFields[];
extern ScreenDefaults Platform_defaultScreens[];
extern const unsigned int Platform_numberOfDefaultScreens;
extern int Platform_numberOfFields;