Changeset b8d6783 in mainline for uspace/app/top/screen.c
- Timestamp:
- 2012-04-15T08:21:20Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f76696f
- Parents:
- f682f5a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/top/screen.c
rf682f5a rb8d6783 44 44 #include <stats.h> 45 45 #include <inttypes.h> 46 #include <macros.h> 46 47 #include "screen.h" 47 48 #include "top.h" … … 327 328 328 329 printf("Other keys:"); 330 screen_newline(); 331 332 printf(" s .. choose column to sort by"); 333 screen_newline(); 334 335 printf(" r .. toggle reversed sorting"); 329 336 screen_newline(); 330 337 … … 440 447 } 441 448 449 static inline void print_sort(table_t *table) 450 { 451 sysarg_t cols; 452 sysarg_t rows; 453 screen_get_size(&cols, &rows); 454 455 sysarg_t col; 456 sysarg_t row; 457 screen_get_pos(&col, &row); 458 459 size_t num = min(table->num_columns, rows - row); 460 for (size_t i = 0; i < num; i++) { 461 printf("%c - %s", table->columns[i].key, table->columns[i].name); 462 screen_newline(); 463 row++; 464 } 465 466 while (row < rows) { 467 screen_newline(); 468 row++; 469 } 470 } 471 442 472 static inline void print_warning(void) 443 473 { … … 469 499 print_table(&data->table); 470 500 break; 501 case SCREEN_SORT: 502 print_sort(&data->table); 503 break; 471 504 case SCREEN_HELP: 472 505 print_help_head();
Note:
See TracChangeset
for help on using the changeset viewer.