50 #define SETTINGS_LIST_ROW 3U 51 #define SETTINGS_LIST_COL 1U 52 #define SETTINGS_LIST_ROWS ( LINES - 6U - SETTINGS_LIST_ROW ) 53 #define INFO_ROW ( LINES - 5U ) 54 #define ALERT_ROW ( LINES - 2U ) 55 #define INSTRUCTION_ROW ( LINES - 2U ) 56 #define INSTRUCTION_PAD " " 59 #define SETTING_ROW_TEXT( cols ) struct { \ 64 char name[ cols - 1 - 1 - 1 - 1 - 1 ]; \ 66 } __attribute__ (( packed )) settings; \ 70 char value[ cols - 1 - 15 - 1 - 1 - 1 - 1 ]; \ 71 } __attribute__ (( packed )) setting; \ 75 } __attribute__ (( packed )) 122 unsigned int index ) {
127 unsigned int count = 0;
172 sizeof ( text->u.setting.value ), 0, &ui->
row.
buf );
202 unsigned int curs_offset;
206 memset ( &text,
' ',
sizeof ( text ) );
216 sizeof ( text.u.settings.name ) );
217 text.u.settings.name[curs_offset] =
'/';
223 memset ( text.u.setting.name,
'.',
224 sizeof ( text.u.setting.name ) );
226 sizeof ( text.u.setting.name ) );
231 value =
"<not specified>";
233 sizeof ( text.u.setting.value ) );
323 "Ctrl-C - discard changes" );
326 "%sCtrl-X - exit configuration utility",
381 unsigned int previous;
389 memset ( &ui, 0,
sizeof ( ui ) );
int getkey(unsigned long timeout)
Get single keypress.
int editing
Editing in progress flag.
struct arbelprm_rc_send_wqe rc
Editable text box widget.
#define PRODUCT_SHORT_NAME
void msg(unsigned int row, const char *fmt,...)
Print message centred on specified row.
int erase(void)
Completely clear the screen.
int settings_ui(struct settings *settings)
static void draw_setting_row(struct settings_ui *ui)
Draw setting row.
int fetchf_setting_copy(struct settings *settings, const struct setting *setting, struct settings **origin, struct setting *fetched, char **value)
Fetch copy of formatted value of setting.
struct settings * parent
Parent settings block.
static int attroff(int attrs)
#define CPAIR_EDIT
Editable text.
A settings user interface.
static int main_loop(struct settings *settings)
struct settings_ui_row row
Current row.
void clearmsg(unsigned int row)
Clear message on specified row.
static int delete_setting(struct settings *settings, const struct setting *setting)
Delete setting.
int endwin(void)
Finalise console environment.
A settings user interface row.
#define mvprintw(y, x, fmt,...)
const char * settings_name(struct settings *settings)
Return settings block name.
#define SETTINGS_LIST_ROW
void alert(unsigned int row, const char *fmt,...)
Show alert message.
static void draw_instruction_row(struct settings_ui *ui)
Draw instruction row.
#define offsetof(type, field)
Get offset of a field within a structure.
const char * description
Description.
static unsigned int select_setting_row(struct settings_ui *ui, unsigned int index)
Select a setting.
#define CPAIR_NORMAL
Normal text.
struct settings * origin
Configuration setting origin.
#define SETTINGS
Configuration setting table.
static int save_setting(struct settings_ui *ui)
Save setting ui value back to configuration settings.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
struct settings * settings_target(struct settings *settings)
Redirect to target settings block.
static void draw_setting_rows(struct settings_ui *ui)
Draw the current block of setting rows.
WINDOW * initscr(void)
Initialise console environment.
static void draw_info_row(struct settings_ui *ui)
Draw information row.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
#define PRODUCT_SETTING_URI
#define list_for_each_entry(pos, head, member)
Iterate over entries in a list.
pseudo_bit_t value[0x00020]
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
uint16_t count
Number of entries.
#define CPAIR_URL
URL text.
struct settings * settings
Target configuration settings block.
An editable text box widget.
int storef_setting(struct settings *settings, const struct setting *setting, const char *value)
Store formatted value of setting.
struct settings * settings
Settings block.
Option configuration console.
char * strerror(int errno)
Retrieve string representation of error number.
static void(* free)(struct refcnt *refcnt))
static void select_settings(struct settings_ui *ui, struct settings *settings)
Select settings block.
int setting_applies(struct settings *settings, const struct setting *setting)
Check applicability of setting.
#define for_each_table_entry(pointer, table)
Iterate through all entries within a linker table.
size_t strlen(const char *src)
Get length of string.
#define CPAIR_SEPARATOR
Unselectable text (e.g.
char * buf
Dynamically allocated buffer for setting's value.
static void init_editbox(struct edit_box *box, unsigned int row, unsigned int col, unsigned int width, unsigned int flags, char **buf)
Initialise text box widget.
int curs_set(int visibility)
Set cursor visibility.
unsigned int row
Screen row.
struct setting setting
Configuration setting.
struct jump_scroller scroll
Jump scroller.
struct edit_box editbox
Edit box widget used for editing setting.
static int move(int y, int x)
#define CPAIR_SELECT
Highlighted text.
#define SETTINGS_LIST_COL
if(len >=6 *4) __asm__ __volatile__("movsl" if(len >=5 *4) __asm__ __volatile__("movsl" if(len >=4 *4) __asm__ __volatile__("movsl" if(len >=3 *4) __asm__ __volatile__("movsl" if(len >=2 *4) __asm__ __volatile__("movsl" if(len >=1 *4) __asm__ __volatile__("movsl" if((len % 4) >=2) __asm__ __volatile__("movsw" if((len % 2) >=1) __asm__ __volatile__("movsb" return dest
struct list_head children
Child settings blocks.
#define color_set(cpno, opts)
static void draw_title_row(struct settings_ui *ui)
Draw title row.
struct widget widget
Text widget.
typeof(acpi_finder=acpi_find)
ACPI table finder.
static size_t string_copy(char *dest, const char *src, size_t len)
Copy string without NUL termination.
static int edit_setting(struct settings_ui *ui, int key)
Edit setting ui.
#define SETTINGS_LIST_ROWS
int setting_name(struct settings *settings, const struct setting *setting, char *buf, size_t len)
Return full setting name.
int setting_cmp(const struct setting *a, const struct setting *b)
Compare two settings.
#define NULL
NULL pointer (VOID *)
static int mvaddstr(int y, int x, const char *str)
#define SETTING_ROW_TEXT(cols)
Layout of text within a setting row.
static int attron(int attrs)
void * memset(void *dest, int character, size_t len) __nonnull