diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2012-02-08 01:45:28 -0500 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2012-02-08 01:45:28 -0500 |
commit | f0a9358661ef1e5b61037c1862854c2f2acce2e0 (patch) | |
tree | a674d1a4aa010a0a3acc5872c19f5809c523512d /src/LYStrings.h | |
parent | 1c60b1717a1ee37412aa4196f9bc2fbd2899fc65 (diff) | |
download | lynx-snapshots-f0a9358661ef1e5b61037c1862854c2f2acce2e0.tar.gz |
snapshot of project "lynx", label v2-8-8dev_9k
Diffstat (limited to 'src/LYStrings.h')
-rw-r--r-- | src/LYStrings.h | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/LYStrings.h b/src/LYStrings.h index b3b27af3..f661d59b 100644 --- a/src/LYStrings.h +++ b/src/LYStrings.h @@ -1,5 +1,5 @@ /* - * $LynxId: LYStrings.h,v 1.79 2011/05/28 13:07:55 tom Exp $ + * $LynxId: LYStrings.h,v 1.86 2012/02/07 19:47:45 tom Exp $ */ #ifndef LYSTRINGS_H #define LYSTRINGS_H @@ -50,6 +50,10 @@ extern "C" { RecallType recall); #define LYGetStr(input,hidden,bufsize,recall) \ LYgetstr(input,hidden,(size_t)(bufsize),recall) + extern int LYgetBString(bstring **inputline, + int hidden, + size_t max_cols, + RecallType recall); extern int LYscanFloat(const char *source, float *result); extern int LYscanFloat2(const char **source, float *result); extern char *LYstrsep(char **stringp, @@ -195,18 +199,17 @@ extern "C" { #define ENHANCED_LINEEDIT #endif -#define MAX_EDIT 1024 - /* EditFieldData preserves state between calls to LYEdit1 */ typedef struct _EditFieldData { int sx; /* Origin of editfield */ int sy; - int dspwdth; /* Screen real estate for editting */ + int dspwdth; /* Screen real estate for editing */ - int strlen; /* Current size of string. */ - int maxlen; /* Max size of string, excluding zero at end */ + size_t buffer_used; /* current size of string. */ + size_t buffer_size; /* current buffer-size, excluding nul at end */ + size_t buffer_limit; /* buffer size limit, zero if indefinite */ char pad; /* Right padding typically ' ' or '_' */ BOOL hidden; /* Masked password entry flag */ @@ -221,10 +224,8 @@ extern "C" { unactive mark. */ #endif - char buffer[MAX_EDIT]; /* String buffer */ - - int offset2col[MAX_EDIT * 2]; - int col2offset[MAX_EDIT * 2]; + char *buffer; /* the buffer which is being edited */ + int *offset2col; /* fixups for multibyte characters */ } EditFieldData; @@ -318,9 +319,10 @@ extern "C" { extern void LYTrimTrailing(char *buffer); extern void LYTrimAllStartfile(char *buffer); extern BOOLEAN LYTrimStartfile(char *buffer); + extern void LYFinishEdit(EditFieldData *edit); extern void LYSetupEdit(EditFieldData *edit, char *old, - int maxstr, - int maxdsp); + size_t buffer_limit, + int display_limit); extern void LYRefreshEdit(EditFieldData *edit); extern int EditBinding(int ch); /* in LYEditmap.c */ extern BOOL LYRemapEditBinding(int xlkc, |