summaryrefslogtreecommitdiffstats
path: root/RichString.h
AgeCommit message (Collapse)Author
2024-01-20RichString: add access function annotationsChristian Göttsche
2023-12-26Relocate include of config.h from header to source modeuleBenny Baumann
2023-10-10Merge branch 'style-header-consistency' of https://github.com/BenBE/htop ↵Nathan Scott
into BenBE-style-header-consistency
2023-05-28Avoid comma operator to reduce ambiguity of the assignmentBenny Baumann
2023-05-24Always mark config.h with IWYU pragma: keepBenny Baumann
2021-09-22Update license headers to explicitly say GPLv2+Daniel Lange
2021-05-10Enclose macro argumentChristian Göttsche
Also enclosing is unnecessary in declaration as in int (VAR);
2021-03-17RichString: do not unnecessarily clean whole bufferChristian Göttsche
The local stack buffer does not need to be cleaned to zeros when - just initialized, cause the length is set to 0 and the first character is set to '\0', so all printing functions will safely stop - no further used, i.e. the variable goes out of scope
2021-01-15LED Meter: display wide characters and restore non-wide ncurses supportChristian Göttsche
Print wide characters, like degree sign, properly via mvadd_wch(). Ignore attributes when returning value from RichString_getCharVal() in non-wide ncurses mode to test against raw characters.
2021-01-15RichString: implement safe rewindChristian Göttsche
The current rewind logic causes issues when rewinding over the short string optimization boundary.
2021-01-15RichString: refactor writing limited amount of columnsChristian Göttsche
Closes: #468
2021-01-13RichString_appendChr: add parameter to set attributesChristian Göttsche
Allows to set attributes when padding process fields in non-wide ncurses mode. Closes: #475
2021-01-11Mark several non-modified pointer variables constChristian Göttsche
2021-01-10RichString_setAttrn: refactor to take a length instead of a stop indexChristian Göttsche
Fixes: #459
2020-12-23RichString: return number of written characters on write/append functionsChristian Göttsche
2020-12-08Split RichString_(append|appendn|write) into wide and asciiChristian Göttsche
RichString_writeFrom takes a top spot during performance analysis due to the calls to mbstowcs() and iswprint(). Most of the time we know in advance that we are only going to print regular ASCII characters.
2020-11-25Fully support non-ascii characters in Meter-BarChristian Göttsche
Currently the code does not handle multi-byte characters, so length- computations take the raw count of C characters and not the to displayed size into account. An example is the degree sign for temperatures. Closes: #329
2020-11-16Merge branch 'hili-new-old' of adsr/htop into highlight-new-old-processesDaniel Lange
2020-11-02Avoid RichString_beginAllocated being ammendableBenny Baumann
2020-11-02Spacing around operatorsBenny Baumann
2020-11-02Spacing after keywords (while)Benny Baumann
2020-11-02Spacing after keywords (#define)Benny Baumann
2020-11-02Remove unnecessary trailing semicolon on macrosBenny Baumann
2020-10-31Enclose macro arguments in parenthesesChristian Göttsche
2020-10-30Highlight new and old processes (#74)Adam Saponara
2020-10-28Simplify RichString_beginChristian Göttsche
2020-10-28Enclose macro arguments in parenthesesChristian Göttsche
2020-10-18Make all required includes explicitBenny Baumann
Information as seen by IWYU 0.12 + clang 9 on Linux
2020-10-06Merge branch 'update-license-and-copyright-info'Nathan Scott
2020-10-05Merge identical declarationsChristian Göttsche
2020-10-05Update License consistently to GPLv2 as per COPYING fileDaniel Lange
2020-09-18Avoid checking of undefined macrosChristian Göttsche
These feature macros are either define or not defined at all at the configure step.
2020-09-12Clean up some code duplication in the header filesHugo Musso Gualandi
PR htop-dev/htop#70 got rid of the infrastructure for generating header files, but it left behind some code duplication. Some of cases are things that belong in the header file and don't need to be repeated in the C file. Other cases are things that belong in the C file and don't need to be in the header file. In this commit I tried to fix all of these that I could find. When given a choice I preferred keeping things out of the header file, unless they were being used by someone else.
2020-09-09Consolidate repeated macro definitions into one headerNathan Scott
The MIN, MAX, CLAMP, MINIMUM, and MAXIMUM macros appear throughout the codebase with many re-definitions. Make a single copy of each in a common header file, and use the BSD variants of MINIMUM/MAXIMUM due to conflicts in the system <sys/param.h> headers.
2020-09-03Remove superfluous 'extern's from function declarations.Zev Weiss
Applied via: $ find * -name '*.h' -exec sed -i -r 's/^extern (.+\()/\1/;' {} + Suggested-by: Bert Wesarg <bert.wesarg@googlemail.com>
2020-09-03Axe automated header generation.Zev Weiss
Reasoning: - implementation was unsound -- broke down when I added a fairly basic macro definition expanding to a struct initializer in a *.c file. - made it way too easy (e.g. via otherwise totally innocuous git commands) to end up with timestamps such that it always ran MakeHeader.py but never used its output, leading to overbuild noise when running what should be a null 'make'. - but mostly: it's just an awkward way of dealing with C code.
2020-08-20Merge branch 'hishamhm-pull-960'Nathan Scott
2020-08-18Re-generate all headers with latest scripts/MakeHeader.pyNathan Scott
Sync-up missing extern declarations for many functions.
2019-10-31Clean up existing whitespaceDaniel Flanagan
2018-02-26Protect against overflows in RichString_setAttrnHisham Muhammad
2016-01-15Introduce CLAMP macro. Unify all MIN(MAX(a,b),c) uses.Explorer09
With the CLAMP macro replacing the combination of MIN and MAX, we will have at least two advantages: 1. It's more obvious semantically. 2. There are no more mixes of confusing uses like MIN(MAX(a,b),c) and MAX(MIN(a,b),c) and MIN(a,MAX(b,c)) appearing everywhere. We unify the 'clamping' with a single macro. Note that the behavior of this CLAMP macro is different from the combination `MAX(low,MIN(x,high))`. * This CLAMP macro expands to two comparisons instead of three from MAX and MIN combination. In theory, this makes the code slightly smaller, in case that (low) or (high) or both are computed at runtime, so that compilers cannot optimize them. (The third comparison will matter if (low)>(high); see below.) * CLAMP has a side effect, that if (low)>(high) it will produce weird results. Unlike MIN & MAX which will force either (low) or (high) to win. No assertion of ((low)<=(high)) is done in this macro, for now. This CLAMP macro is implemented like described in glib <http://developer.gnome.org/glib/stable/glib-Standard-Macros.html> and does not handle weird uses like CLAMP(a++, low++, high--) .
2015-08-27Fixes for color glitches in ncurses ABI6.Hisham Muhammad
Could no longer reproduce #244 after these fixes.
2015-08-25include wctype.h for iswprint()Christian Hesse
2015-08-20Extra checks.Hisham Muhammad
2015-08-20Make Unicode strings safe for ncurses 6 ABI.Hisham Muhammad
Closes #241.
2014-11-19Refactored key handlers.Hisham Muhammad
Made the logic more modular, hopefully easier to follow, and removed repeated code. Plus, some optimization in RichString code.
2013-02-26Add extra checks in configure.ac for different locations of (n)curses.hHisham Muhammad
2012-11-10search and filter for the strace and lsof screens!Hisham Muhammad
2011-12-26Remove old memory debugging routines. We have Valgrind nowadays.Hisham Muhammad
2011-12-26major header cleanupHisham Muhammad