Changeset View
Changeset View
Standalone View
Standalone View
head/usr.bin/top/display.c
Show First 20 Lines • Show All 669 Lines • ▼ Show 20 Lines | |||||
static char *swap_buffer = NULL; | static char *swap_buffer = NULL; | ||||
void | void | ||||
i_swap(int *stats) | i_swap(int *stats) | ||||
{ | { | ||||
swap_buffer = setup_buffer(swap_buffer, 0); | swap_buffer = setup_buffer(swap_buffer, 0); | ||||
if (swap_names == NULL) | |||||
return; | |||||
fputs("\nSwap: ", stdout); | fputs("\nSwap: ", stdout); | ||||
lastline++; | lastline++; | ||||
/* format and print the swap summary */ | /* format and print the swap summary */ | ||||
summary_format(swap_buffer, stats, swap_names); | summary_format(swap_buffer, stats, swap_names); | ||||
fputs(swap_buffer, stdout); | fputs(swap_buffer, stdout); | ||||
} | } | ||||
void | void | ||||
u_swap(int *stats) | u_swap(int *stats) | ||||
{ | { | ||||
static char *new = NULL; | static char *new = NULL; | ||||
new = setup_buffer(new, 0); | new = setup_buffer(new, 0); | ||||
if (swap_names == NULL) | |||||
return; | |||||
/* format the new line */ | /* format the new line */ | ||||
summary_format(new, stats, swap_names); | summary_format(new, stats, swap_names); | ||||
line_update(swap_buffer, new, x_swap, y_swap); | line_update(swap_buffer, new, x_swap, y_swap); | ||||
} | } | ||||
/* | /* | ||||
* *_message() - print the next pending message line, or erase the one | * *_message() - print the next pending message line, or erase the one | ||||
▲ Show 20 Lines • Show All 674 Lines • Show Last 20 Lines |