mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 12:14:36 +03:00
Refactored key handlers.
Made the logic more modular, hopefully easier to follow, and removed repeated code. Plus, some optimization in RichString code.
This commit is contained in:
@ -9,7 +9,7 @@ Released under the GNU GPL, see the COPYING file
|
||||
in the source distribution for its full text.
|
||||
*/
|
||||
|
||||
#define RICHSTRING_MAXLEN 300
|
||||
#define RICHSTRING_MAXLEN 350
|
||||
|
||||
#include "config.h"
|
||||
#include <ctype.h>
|
||||
@ -50,8 +50,8 @@ in the source distribution for its full text.
|
||||
|
||||
typedef struct RichString_ {
|
||||
int chlen;
|
||||
CharType chstr[RICHSTRING_MAXLEN+1];
|
||||
CharType* chptr;
|
||||
CharType chstr[RICHSTRING_MAXLEN+1];
|
||||
} RichString;
|
||||
|
||||
|
||||
@ -61,6 +61,8 @@ typedef struct RichString_ {
|
||||
|
||||
#define charBytes(n) (sizeof(CharType) * (n))
|
||||
|
||||
#define RichString_setLen(this, len) do{ if(len < RICHSTRING_MAXLEN) { RichString_setChar(this,len,0); this->chlen=len; } else RichString_extendLen(this,len); }while(0)
|
||||
|
||||
#ifdef HAVE_LIBNCURSESW
|
||||
|
||||
extern void RichString_setAttrn(RichString* this, int attrs, int start, int finish);
|
||||
|
Reference in New Issue
Block a user