summaryrefslogtreecommitdiffstats
path: root/RichString.h
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2014-11-19 23:17:52 -0200
committerHisham Muhammad <hisham@gobolinux.org>2014-11-19 23:17:52 -0200
commit9faf4938b8195a0fb5d62cf1702f9f5c07523031 (patch)
tree84732ab7ef1bf66d55feefaf97216ccfc9bf2fad /RichString.h
parent300af4b829c6552d7efdfcde43220cf318b5a265 (diff)
Refactored key handlers.
Made the logic more modular, hopefully easier to follow, and removed repeated code. Plus, some optimization in RichString code.
Diffstat (limited to 'RichString.h')
-rw-r--r--RichString.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/RichString.h b/RichString.h
index a9cb3f6e..971e3acb 100644
--- a/RichString.h
+++ b/RichString.h
@@ -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);

© 2014-2024 Faster IT GmbH | imprint | privacy policy