Changeset f682f5a in mainline for uspace/app/top/top.h


Ignore:
Timestamp:
2012-04-15T07:42:52Z (12 years ago)
Author:
Sean Bartell <wingedtachikoma@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b8d6783
Parents:
94f6df7
Message:

top: use generic handling for tables

  • each table has a name, columns, and fields
  • each column has a name, width, and shortcut key
  • each field has a type and value
  • this will help make top more configurable in the future
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/top/top.h

    r94f6df7 rf682f5a  
    5151
    5252typedef enum {
    53         OP_TASKS,
    54         OP_IPC,
    55         OP_EXCS,
    56         OP_HELP
    57 } op_mode_t;
     53        SCREEN_TABLE,
     54        SCREEN_HELP,
     55} screen_mode_t;
    5856
    5957typedef enum {
     
    6159} sort_mode_t;
    6260
    63 extern op_mode_t op_mode;
     61extern screen_mode_t screen_mode;
    6462extern sort_mode_t sort_mode;
    65 extern bool excs_all;
    6663
    6764typedef struct {
     
    8683        fixed_float count;
    8784} perc_exc_t;
     85
     86typedef enum {
     87        FIELD_EMPTY, FIELD_UINT, FIELD_UINT_SUFFIX_BIN, FIELD_UINT_SUFFIX_DEC,
     88        FIELD_PERCENT, FIELD_STRING
     89} field_type_t;
     90
     91typedef struct {
     92        field_type_t type;
     93        union {
     94                fixed_float fixed;
     95                uint64_t uint;
     96                const char *string;
     97        };
     98} field_t;
     99
     100typedef struct {
     101        const char *name;
     102        char key;
     103        int width;
     104} column_t;
     105
     106typedef struct {
     107        const char *name;
     108        size_t num_columns;
     109        const column_t *columns;
     110        size_t num_fields;
     111        field_t *fields;
     112} table_t;
    88113
    89114typedef struct {
     
    122147        uint64_t *ecycles_diff;
    123148        uint64_t *ecount_diff;
     149
     150        table_t table;
    124151} data_t;
    125152
Note: See TracChangeset for help on using the changeset viewer.