summaryrefslogtreecommitdiffstats
path: root/src/getchar.c
AgeCommit message (Expand)Author
2019-08-21patch 8.1.1901: the +insert_expand feature is not always availablev8.1.1901Bram Moolenaar
2019-08-20patch 8.1.1891: functions used in one file are globalv8.1.1891Bram Moolenaar
2019-08-08patch 8.1.1827: allocating more memory than needed for extended structsv8.1.1827Bram Moolenaar
2019-08-03patch 8.1.1799: cannot avoid mapping for a popup windowv8.1.1799Bram Moolenaar
2019-08-03patch 8.1.1798: warning for unused variable in tiny versionv8.1.1798Bram Moolenaar
2019-08-03patch 8.1.1797: the vgetorpeek() function is too longv8.1.1797Bram Moolenaar
2019-08-02patch 8.1.1794: tests are flakyv8.1.1794Bram Moolenaar
2019-08-02patch 8.1.1792: the vgetorpeek() function is too longv8.1.1792Bram Moolenaar
2019-08-01patch 8.1.1785: map functionality mixed with character inputv8.1.1785Bram Moolenaar
2019-07-27patch 8.1.1759: no mode char for terminal mapping from maparg()v8.1.1759Bram Moolenaar
2019-07-05patch 8.1.1640: the CursorHold autocommand takes down a balloonv8.1.1640Bram Moolenaar
2019-06-25patch 8.1.1591: on error garbage collection may free memory in usev8.1.1591Bram Moolenaar
2019-06-01patch 8.1.1441: popup window filter not yet implementedv8.1.1441Bram Moolenaar
2019-05-28patch 8.1.1414: alloc() returning "char_u *" causes a lot of type castsv8.1.1414Bram Moolenaar
2019-05-24patch 8.1.1386: unessesary type casts for lalloc()v8.1.1386Bram Moolenaar
2019-05-24patch 8.1.1384: using "int" for alloc() often results in compiler warningsv8.1.1384Bram Moolenaar
2019-05-22patch 8.1.1365: source command doesn't check for the sandboxv8.1.1365Bram Moolenaar
2019-05-19patch 8.1.1358: cannot enter character with a CSI bytev8.1.1358Bram Moolenaar
2019-05-04patch 8.1.1269: MS-Windows GUI: multibyte chars with a 0x80 byte do not workv8.1.1269Bram Moolenaar
2019-05-03patch 8.1.1251: no test for completion of mapping keysv8.1.1251Bram Moolenaar
2019-04-29patch 8.1.1239: key with byte sequence containing CSI does not workv8.1.1239Bram Moolenaar
2019-04-28patch 8.1.1230: a lot of code is shared between vim.exe and gvim.exev8.1.1230Bram Moolenaar
2019-04-24patch 8.1.1201: output of :command is hard to readv8.1.1201Bram Moolenaar
2019-04-18patch 8.1.1185: mapping for CTRL-X is inconsistentv8.1.1185Bram Moolenaar
2019-04-04patch 8.1.1118: a couple of conditions are hard to understandv8.1.1118Bram Moolenaar
2019-03-30patch 8.1.1086: too many curly bracesv8.1.1086Bram Moolenaar
2019-03-10patch 8.1.1003: playing back recorded key sequence mistakes key codev8.1.1003Bram Moolenaar
2019-03-09patch 8.1.1000: indenting is offv8.1.1000Bram Moolenaar
2019-02-17patch 8.1.0941: macros for MS-Windows are inconsistentv8.1.0941Bram Moolenaar
2019-02-16patch 8.1.0932: Farsi support is outdated and unusedv8.1.0932Bram Moolenaar
2019-01-25patch 8.1.0822: peeking and flushing output slows down executionv8.1.0822Bram Moolenaar
2019-01-24patch 8.1.0810: too many #ifdefsv8.1.0810Bram Moolenaar
2019-01-20patch 8.1.0785: depending on the configuration some functions are unusedv8.1.0785Bram Moolenaar
2019-01-19patch 8.1.0779: argument for message functions is inconsistentv8.1.0779Bram Moolenaar
2019-01-13patch 8.1.0743: giving error messages is not flexiblev8.1.0743Bram Moolenaar
2018-10-07patch 8.1.0466: autocmd test failsv8.1.0466Bram Moolenaar
2018-09-30patch 8.1.0443: unnecessary static function prototypesv8.1.0443Bram Moolenaar
2018-09-30patch 8.1.0439: recursive use of getcmdline() still not protectedv8.1.0439Bram Moolenaar
2018-09-10patch 8.1.0362: cannot get the script line number when executing a functionv8.1.0362Bram Moolenaar
2018-07-27patch 8.1.0216: part of file not indented properlyv8.1.0216Bram Moolenaar
2018-07-03patch 8.1.0140: recording into a register has focus eventsv8.1.0140Bram Moolenaar
2018-06-12patch 8.1.0052: when mapping to <Nop> times out the next mapping is skippedv8.1.0052Bram Moolenaar
2018-05-23patch 8.1.0022: repeating put from expression register failsv8.1.0022Bram Moolenaar
2018-05-22patch 8.1.0020: cannot tell whether a register is executing or recordingv8.1.0020Bram Moolenaar
2018-05-15patch 8.0.1845: various comment updates needed, missing white spacev8.0.1845Bram Moolenaar
2018-05-12patch 8.0.1825: might use NULL pointer when out of memoryv8.0.1825Bram Moolenaar
2018-05-01patch 8.0.1786: no test for 'termwinkey'v8.0.1786Bram Moolenaar
2018-04-24patch 8.0.1753: various warnings from a static analyserv8.0.1753Bram Moolenaar
2018-04-18patch 8.0.1735: flexible array member feature not supported by HP-UXv8.0.1735Bram Moolenaar
2018-04-16patch 8.0.1723: using one item array size declaration is misleadingv8.0.1723Bram Moolenaar
n class="o">=1 # how frequently to collect sensor data # the default is to collect it at every iteration of charts.d sensors_update_every= sensors_priority=90000 declare -A sensors_excluded=() sensors_find_all_files() { find $1 -maxdepth $sensors_sys_depth -name \*_input -o -name temp 2>/dev/null } sensors_find_all_dirs() { sensors_find_all_files $1 | while read do dirname $REPLY done | sort -u } # _check is called once, to find out if this chart should be enabled or not sensors_check() { # this should return: # - 0 to enable the chart # - 1 to disable the chart [ -z "$( sensors_find_all_files $sensors_sys_dir )" ] && error "no sensors found in '$sensors_sys_dir'." && return 1 return 0 } sensors_check_files() { # we only need sensors that report a non-zero value # also remove not needed sensors local f= v= excluded= for f in $* do [ ! -f "$f" ] && continue for ex in ${sensors_excluded[@]}; do [[ $f =~ .*$ex$ ]] && excluded='1' && break done [ "$excluded" != "1" ] && v="$( cat $f )" || v=0 v=$(( v + 1 - 1 )) [ $v -ne 0 ] && echo "$f" && continue excluded= error "$f gives zero values" done } sensors_check_temp_type() { # valid temp types are 1 to 6 # disabled sensors have the value 0 local f= t= v= for f in $* do t=$( echo $f | sed "s|_input$|_type|g" ) [ "$f" = "$t" ] && echo "$f" && continue [ ! -f "$t" ] && echo "$f" && continue v="$( cat $t )" v=$(( v + 1 - 1 )) [ $v -ne 0 ] && echo "$f" && continue error "$f is disabled" done } # _create is called once, to create the charts sensors_create() { local path= dir= name= x= file= lfile= labelname= labelid= device= subsystem= id= type= mode= files= multiplier= divisor= # we create a script with the source of the # sensors_update() function # - the highest speed we can achieve - [ $sensors_source_update -eq 1 ] && echo >$TMP_DIR/sensors.sh "sensors_update() {" for path in $( sensors_find_all_dirs $sensors_sys_dir | sort -u ) do dir=$( basename $path ) device= subsystem= id= type= name= [ -h $path/device ] && device=$( readlink -f $path/device ) [ ! -z "$device" ] && device=$( basename $device ) [ -z "$device" ] && device="$dir" [ -h $path/subsystem ] && subsystem=$( readlink -f $path/subsystem ) [ ! -z "$subsystem" ] && subsystem=$( basename $subsystem ) [ -z "$subsystem" ] && subsystem="$dir" [ -f $path/name ] && name=$( cat $path/name ) [ -z "$name" ] && name="$dir" [ -f $path/type ] && type=$( cat $path/type ) [ -z "$type" ] && type="$dir" id="$( fixid "$device.$subsystem.$dir" )" debug "path='$path', dir='$dir', device='$device', subsystem='$subsystem', id='$id', name='$name'" for mode in temperature voltage fans power current energy humidity do files= multiplier=1 divisor=1 algorithm="absolute" case $mode in temperature) files="$( ls $path/temp*_input 2>/dev/null; ls $path/temp 2>/dev/null )" files="$( sensors_check_files $files )" files="$( sensors_check_temp_type $files )" [ -z "$files" ] && continue echo "CHART sensors.temp_$id '' '$name Temperature' 'Celsius' 'temperature' 'sensors.temp' line $((sensors_priority + 1)) $sensors_update_every" echo >>$TMP_DIR/sensors.sh "echo \"BEGIN sensors.temp_$id \$1\"" divisor=1000 ;; voltage) files="$( ls $path/in*_input 2>/dev/null )" files="$( sensors_check_files $files )" [ -z "$files" ] && continue echo "CHART sensors.volt_$id '' '$name Voltage' 'Volts' 'voltage' 'sensors.volt' line $((sensors_priority + 2)) $sensors_update_every" echo >>$TMP_DIR/sensors.sh "echo \"BEGIN sensors.volt_$id \$1\"" divisor=1000 ;; current) files="$( ls $path/curr*_input 2>/dev/null )" files="$( sensors_check_files $files )" [ -z "$files" ] && continue echo "CHART sensors.curr_$id '' '$name Current' 'Ampere' 'current' 'sensors.curr' line $((sensors_priority + 3)) $sensors_update_every" echo >>$TMP_DIR/sensors.sh "echo \"BEGIN sensors.curr_$id \$1\"" divisor=1000 ;; power) files="$( ls $path/power*_input 2>/dev/null )" files="$( sensors_check_files $files )" [ -z "$files" ] && continue echo "CHART sensors.power_$id '' '$name Power' 'Watt' 'power' 'sensors.power' line $((sensors_priority + 4)) $sensors_update_every" echo >>$TMP_DIR/sensors.sh "echo \"BEGIN sensors.power_$id \$1\"" divisor=1000000 ;; fans) files="$( ls $path/fan*_input 2>/dev/null )" files="$( sensors_check_files $files )" [ -z "$files" ] && continue echo "CHART sensors.fan_$id '' '$name Fans Speed' 'Rotations / Minute' 'fans' 'sensors.fans' line $((sensors_priority + 5)) $sensors_update_every" echo >>$TMP_DIR/sensors.sh "echo \"BEGIN sensors.fan_$id \$1\"" ;; energy) files="$( ls $path/energy*_input 2>/dev/null )" files="$( sensors_check_files $files )" [ -z "$files" ] && continue echo "CHART sensors.energy_$id '' '$name Energy' 'Joule' 'energy' 'sensors.energy' areastack $((sensors_priority + 6)) $sensors_update_every" echo >>$TMP_DIR/sensors.sh "echo \"BEGIN sensors.energy_$id \$1\"" algorithm="incremental" divisor=1000000 ;; humidity) files="$( ls $path/humidity*_input 2>/dev/null )" files="$( sensors_check_files $files )" [ -z "$files" ] && continue echo "CHART sensors.humidity_$id '' '$name Humidity' 'Percent' 'humidity' 'sensors.humidity' line $((sensors_priority + 7)) $sensors_update_every" echo >>$TMP_DIR/sensors.sh "echo \"BEGIN sensors.humidity_$id \$1\"" divisor=1000 ;; *) continue ;; esac for x in $files do file="$x" fid="$( fixid "$file" )" lfile="$( basename $file | sed "s|_input$|_label|g" )" labelname="$( basename $file | sed "s|_input$||g" )" if [ ! "$path/$lfile" = "$file" -a -f "$path/$lfile" ] then labelname="$( cat "$path/$lfile" )" fi echo "DIMENSION $fid '$labelname' $algorithm $multiplier $divisor" echo >>$TMP_DIR/sensors.sh "echo \"SET $fid = \"\$(< $file )" done echo >>$TMP_DIR/sensors.sh "echo END" done done [ $sensors_source_update -eq 1 ] && echo >>$TMP_DIR/sensors.sh "}" # ok, load the function sensors_update() we created [ $sensors_source_update -eq 1 ] && . $TMP_DIR/sensors.sh return 0 } # _update is called continiously, to collect the values sensors_update() { # the first argument to this function is the microseconds since last update # pass this parameter to the BEGIN statement (see bellow). # do all the work to collect / calculate the values # for each dimension # remember: KEEP IT SIMPLE AND SHORT [ $sensors_source_update -eq 0 ] && . $TMP_DIR/sensors.sh $1 return 0 }