int command_set_winsplit(const char *value) { struct cgdbrc_config_option option; WIN_SPLIT_TYPE split_type = WIN_SPLIT_EVEN; option.option_kind = CGDBRC_WINSPLIT; if (strcasecmp(value, "top_big") == 0) split_type = WIN_SPLIT_TOP_BIG; else if (strcasecmp(value, "top_full") == 0) split_type = WIN_SPLIT_TOP_FULL; else if (strcasecmp(value, "bottom_big") == 0) split_type = WIN_SPLIT_BOTTOM_BIG; else if (strcasecmp(value, "bottom_full") == 0) split_type = WIN_SPLIT_BOTTOM_FULL; else split_type = WIN_SPLIT_EVEN; option.variant.win_split_val = split_type; if (cgdbrc_set_val(option)) return 1; if_set_winsplit(split_type); return 0; }
int command_set_cgdb_mode_key(const char *value) { struct cgdbrc_config_option option; option.option_kind = CGDBRC_CGDB_MODE_KEY; if (value) { /* If the user typed in a single key, use it. */ if (strlen(value) == 1) { option.variant.int_val = value[0]; } else { /* The user may have typed in a keycode. (e.g. <Esc>) * attempt to translate it. */ int key = kui_term_get_cgdb_key_from_keycode(value); if (key == -1) return -1; option.variant.int_val = key; } } else { return -1; } return cgdbrc_set_val(option); }
static int command_set_ttimeout(int value) { struct cgdbrc_config_option option; option.option_kind = CGDBRC_TTIMEOUT; option.variant.int_val = value; if (cgdbrc_set_val(option)) return 1; return 0; }
static int command_set_winminheight(int value) { struct cgdbrc_config_option option; option.option_kind = CGDBRC_WINMINHEIGHT; if (if_change_winminheight(value) == -1) return 1; option.variant.int_val = value; return cgdbrc_set_val(option); }
static int command_set_ttimeoutlen(int value) { if (value >= 0 && value <= 10000) { struct cgdbrc_config_option option; option.option_kind = CGDBRC_TTIMEOUT_LEN; option.variant.int_val = value; if (cgdbrc_set_val(option)) return 1; } return 0; }
static int command_set_sdc(int value) { if ((value == 0) || (value == 1)) { struct cgdbrc_config_option option; option.option_kind = CGDBRC_SHOWDEBUGCOMMANDS; option.variant.int_val = value; if (cgdbrc_set_val(option)) return 1; } else return 1; return 0; }
int command_set_arrowstyle(const char *value) { struct cgdbrc_config_option option; option.option_kind = CGDBRC_ARROWSTYLE; if (strcasecmp(value, "short") == 0) option.variant.arrow_style = ARROWSTYLE_SHORT; else if (strcasecmp(value, "long") == 0) option.variant.arrow_style = ARROWSTYLE_LONG; else if (strcasecmp(value, "highlight") == 0) option.variant.arrow_style = ARROWSTYLE_HIGHLIGHT; else return 1; return cgdbrc_set_val(option); }
int command_set_arrowstyle(const char *value) { struct cgdbrc_config_option option; option.option_kind = CGDBRC_EXECUTING_LINE_DISPLAY; if (strcasecmp(value, "short") == 0) option.variant.line_display_style = LINE_DISPLAY_SHORT_ARROW; else if (strcasecmp(value, "long") == 0) option.variant.line_display_style = LINE_DISPLAY_LONG_ARROW; else if (strcasecmp(value, "highlight") == 0) option.variant.line_display_style = LINE_DISPLAY_HIGHLIGHT; else return 1; return cgdbrc_set_val(option); }
static int command_set_stc(int value) { if ((value == 0) || (value == 1)) { struct cgdbrc_config_option option; option.option_kind = CGDBRC_SHOWTGDBCOMMANDS; option.variant.int_val = value; if (cgdbrc_set_val(option)) return 1; /* TODO: Make this not a member function. */ tgdb_set_verbose_gui_command_output(tgdb, value); } else return 1; return 0; }
int command_set_selected_line_display(const char *value) { struct cgdbrc_config_option option; option.option_kind = CGDBRC_SELECTED_LINE_DISPLAY; if (strcasecmp(value, "shortarrow") == 0) option.variant.line_display_style = LINE_DISPLAY_SHORT_ARROW; else if (strcasecmp(value, "longarrow") == 0) option.variant.line_display_style = LINE_DISPLAY_LONG_ARROW; else if (strcasecmp(value, "highlight") == 0) option.variant.line_display_style = LINE_DISPLAY_HIGHLIGHT; else if (strcasecmp(value, "block") == 0) option.variant.line_display_style = LINE_DISPLAY_BLOCK; else return 1; return cgdbrc_set_val(option); }
int command_set_winsplitorientation(const char *value) { struct cgdbrc_config_option option; WIN_SPLIT_ORIENTATION_TYPE orientation = WSO_HORIZONTAL; option.option_kind = CGDBRC_WINSPLITORIENTATION; if (strcasecmp(value, "horizontal") == 0) orientation = WSO_HORIZONTAL; else if (strcasecmp(value, "vertical") == 0) orientation = WSO_VERTICAL; option.variant.win_split_orientation_val = orientation; if (cgdbrc_set_val(option)) return 1; if_set_winsplitorientation(orientation); return 0; }
int command_set_syntax_type(const char *value) { enum tokenizer_language_support lang; struct cgdbrc_config_option option; option.option_kind = CGDBRC_SYNTAX; if (strcasecmp(value, "c") == 0) lang = TOKENIZER_LANGUAGE_C; else if (strcasecmp(value, "ada") == 0) lang = TOKENIZER_LANGUAGE_ADA; else if (strcasecmp(value, "off") == 0) lang = TOKENIZER_LANGUAGE_UNKNOWN; option.variant.language_support_val = lang; if (cgdbrc_set_val(option)) return 1; if_highlight_sviewer(lang); return 0; }
int command_set_winsplit(const char *value) { struct cgdbrc_config_option option; WIN_SPLIT_TYPE split_type = WIN_SPLIT_EVEN; option.option_kind = CGDBRC_WINSPLIT; /* deprecated: use src_big */ if (strcasecmp(value, "top_big") == 0) split_type = WIN_SPLIT_SRC_BIG; /* deprecated: use src_full */ else if (strcasecmp(value, "top_full") == 0) split_type = WIN_SPLIT_SRC_FULL; /* deprecated: use gdb_big */ else if (strcasecmp(value, "bottom_big") == 0) split_type = WIN_SPLIT_GDB_BIG; /* deprecated: use gdb_full */ else if (strcasecmp(value, "bottom_full") == 0) split_type = WIN_SPLIT_GDB_FULL; else if (strcasecmp(value, "src_big") == 0) split_type = WIN_SPLIT_SRC_BIG; else if (strcasecmp(value, "src_full") == 0) split_type = WIN_SPLIT_SRC_FULL; else if (strcasecmp(value, "gdb_big") == 0) split_type = WIN_SPLIT_GDB_BIG; else if (strcasecmp(value, "gdb_full") == 0) split_type = WIN_SPLIT_GDB_FULL; else split_type = WIN_SPLIT_EVEN; option.variant.win_split_val = split_type; if (cgdbrc_set_val(option)) return 1; if_set_winsplit(split_type); return 0; }
int command_set_syntax_type(const char *value) { /* In sources.c */ extern int sources_syntax_on; struct cgdbrc_config_option option; enum tokenizer_language_support lang = TOKENIZER_LANGUAGE_UNKNOWN; option.option_kind = CGDBRC_SYNTAX; if (strcasecmp(value, "c") == 0) lang = TOKENIZER_LANGUAGE_C; else if (strcasecmp(value, "asm") == 0) lang = TOKENIZER_LANGUAGE_ASM; else if (strcasecmp(value, "d") == 0) lang = TOKENIZER_LANGUAGE_D; else if (strcasecmp(value, "go") == 0) lang = TOKENIZER_LANGUAGE_GO; else if (strcasecmp(value, "ada") == 0) lang = TOKENIZER_LANGUAGE_ADA; else if (strcasecmp(value, "rust") == 0) lang = TOKENIZER_LANGUAGE_RUST; /* If caller specified a language or 'on', enable highlighting */ if (lang != TOKENIZER_LANGUAGE_UNKNOWN || strcasecmp(value, "on") == 0 || strcasecmp(value, "yes") == 0) sources_syntax_on = 1; else if (strcasecmp(value, "no") == 0 || strcasecmp(value, "off") == 0) sources_syntax_on = 0; option.variant.language_support_val = lang; if (cgdbrc_set_val(option)) return 1; if_highlight_sviewer(lang); return 0; }