From 4393ffa0b3ba201e3fdb667c62ea3f9bccaf13b2 Mon Sep 17 00:00:00 2001 From: Christian Kroll Date: Mon, 7 Mar 2011 19:46:31 +0000 Subject: [PATCH] ignore .menuconfig.log in local tree --- borg_hw/config.in | 4 +-- scripts/Menuconfig | 61 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 2 deletions(-) diff --git a/borg_hw/config.in b/borg_hw/config.in index e0524af..8bcdb47 100644 --- a/borg_hw/config.in +++ b/borg_hw/config.in @@ -2,8 +2,8 @@ mainmenu_option next_comment comment "Borg Hardware" -int "Number of rows " NUM_ROWS 16 -int "Number of columns" NUM_COLS 16 +uint "Number of rows " NUM_ROWS 16 +uint "Number of columns" NUM_COLS 16 int "Number of brightnes-levels" NUMPLANE 3 diff --git a/scripts/Menuconfig b/scripts/Menuconfig index db37e8f..d85a381 100644 --- a/scripts/Menuconfig +++ b/scripts/Menuconfig @@ -92,6 +92,10 @@ function define_int () { eval $1=$2 } +function define_uint () { + eval $1=$2 +} + function define_string () { eval $1=\"$2\" } @@ -238,6 +242,17 @@ function int () { echo -e "function $2 () { l_int '$1' '$2' '$3' '$x' ;}" >>MCradiolists } +# +# Add a menu item which will call our local unsigned int function. +# +function uint () { + set_x_info "$2" "$3" + + echo -ne "'$2' '($x) $1$info' " >>MCmenu + + echo -e "function $2 () { l_uint '$1' '$2' '$3' '$x' ;}" >>MCradiolists +} + # # Add a menu item which will call our local hex function. # @@ -579,6 +594,40 @@ function l_int () { done } +# +# Create a dialog for entering an unsigned integer into a kernel option. +# +function l_uint () { + while true + do + if $DIALOG --title "$1" \ + --backtitle "$backtitle" \ + --inputbox "$inputbox_instructions_int" \ + 10 75 "$4" 2>MCdialog.out + then + answer="`cat MCdialog.out`" + answer="${answer:-$3}" + + # Semantics of + and ? in GNU expr changed, so + # we avoid them: + if expr "$answer" : '0$' '|' "$answer" : '[1-9][0-9]*$' >/dev/null + then + eval $2=\"$answer\" + else + eval $2=\"$3\" + echo -en "\007" + ${DIALOG} --backtitle "$backtitle" \ + --infobox "You have made an invalid entry." 3 43 + sleep 2 + fi + + break + fi + + help "$2" "$1" + done +} + # # Create a dialog for entering a hexadecimal into a kernel option. # @@ -1315,6 +1364,12 @@ save_configuration () { echo "#define $2 ($x)" >>$CONFIG_H } + function uint () { + set_x_info "$2" "$3" + echo "$2=$x" >>$CONFIG + echo "#define $2 ($x""u)" >>$CONFIG_H + } + function hex () { set_x_info "$2" "$3" echo "$2=$x" >>$CONFIG @@ -1360,6 +1415,12 @@ save_configuration () { echo "#define $1 ($2)" >>$CONFIG_H } + function define_uint () { + eval $1=\"$2\" + echo "$1=$2" >>$CONFIG + echo "#define $1 ($2""u)" >>$CONFIG_H + } + function define_symbol () { eval $1=\"$2\" echo "$1=$2" >>$CONFIG