| /* | |
| ** | |
| ** File Description: | |
| ** | |
| ** basic user interface header file | |
| ** | |
| ** | |
| */ | |
| #ifndef __MISLIC_UI_HDR__ | |
| #define __MISLIC_UI_HDR__ | |
| #include <stdio.h> | |
| #define ASCII_ESC 27 | |
| #define MISLIC_EOL '\n' | |
| #define MISLIC_CLS printf("%c[2J", ASCII_ESC) | |
| #define MISLIC_MAX_COL 80 | |
| #define MISLIC_PROMPT "--> " | |
| #define display_menu_prompt(X) printf("Select Menu item for chan: %u or 'q' to quit or 'r' to redisplay menu %s ", (X), MISLIC_PROMPT) | |
| #define REDISPLAY_MENU 0xFE | |
| #define QUIT_MENU 0xFF | |
| #ifdef SILABS_USE_SETVBUF | |
| #define SETUP_STDOUT_FLUSH setvbuf(stdout, NULL, _IONBF, 0); setvbuf(stderr, NULL, _IONBF, 0); | |
| #define FLUSH_STDOUT printf("\n");fflush(stdout); | |
| #else | |
| #define SETUP_STDOUT_FLUSH | |
| #define FLUSH_STDOUT | |
| #endif | |
| void print_banner(const char *banner); | |
| int display_menu(const char *menu_header, const char **menu_items); | |
| int get_menu_selection(int max_count, int current_channel); | |
| int get_int(int min_value, int max_max); | |
| int get_prompted_int(int min_value, int max_max, const char *prompt); | |
| unsigned int get_hex(unsigned int min_value, unsigned int max_value); | |
| int get_char(char *legal_chars, char *user_input); | |
| int get_char_range(char start_range, char end_range); | |
| int get_fn(char *prompt, char *buffer); | |
| int kbhit(void); | |
| #endif /* __MISLIC_UI_HDR__ */ | |