diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-04-17 20:02:18 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-04-17 20:02:18 +0800 |
commit | 0487addce5ddefe4bbd9736aaa46644271787315 (patch) | |
tree | e0034cf1af134a584e8b328288b8a110e0bc570c /include | |
parent | 1b0e3ccd58a342a56779dd843abd0f5e3f1c9dea (diff) | |
download | pttbbs-0487addce5ddefe4bbd9736aaa46644271787315.tar pttbbs-0487addce5ddefe4bbd9736aaa46644271787315.tar.gz pttbbs-0487addce5ddefe4bbd9736aaa46644271787315.tar.bz2 pttbbs-0487addce5ddefe4bbd9736aaa46644271787315.tar.lz pttbbs-0487addce5ddefe4bbd9736aaa46644271787315.tar.xz pttbbs-0487addce5ddefe4bbd9736aaa46644271787315.tar.zst pttbbs-0487addce5ddefe4bbd9736aaa46644271787315.zip |
- (internal) change chat to use vgetstring with new callback system
- (internal) move DBCS API to string lib
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4176 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'include')
-rw-r--r-- | include/cmsys.h | 1 | ||||
-rw-r--r-- | include/visio.h | 18 |
2 files changed, 13 insertions, 6 deletions
diff --git a/include/cmsys.h b/include/cmsys.h index 879b75e9..3f051d09 100644 --- a/include/cmsys.h +++ b/include/cmsys.h @@ -93,6 +93,7 @@ extern int strip_ansi(char *buf, const char *str, enum STRIP_FLAG flag); extern void strip_nonebig5(unsigned char *str, int maxlen); extern int DBCS_RemoveIntrEscape(unsigned char *buf, int *len); extern int DBCS_Status(const char *dbcstr, int pos); +extern int DBCS_strcasestr(const char* pool, const char *ptr); extern int invalid_pname(const char *str); extern int is_number(const char *p); extern char * qp_encode (char *s, size_t slen, const char *d, const char *tocode); diff --git a/include/visio.h b/include/visio.h index aafcd0af..bfc9c945 100644 --- a/include/visio.h +++ b/include/visio.h @@ -71,12 +71,17 @@ typedef struct { } VCOL; -typedef int (*VGET_CALLBACK)(char *buf, int *pcurr, int len, void *ptr); +#define VGETCB_NONE (0) // do nothing +#define VGETCB_NEXT (1) // skip to next event loop +#define VGETCB_END (2) // finish input +#define VGETCB_ABORT (3) // clear buffer and finish + +typedef int (*VGET_FCALLBACK)(int key, char *buf, int *picurr, int *piend, int len, void *param); typedef struct { - VGET_CALLBACK peek; // called immediately after key hit - VGET_CALLBACK accept; // called before inserting character data - // ... ? -} VGET_EXTENSION; + VGET_FCALLBACK peek; // called immediately after key hit + VGET_FCALLBACK data; // called before inserting character data + VGET_FCALLBACK post; // called after every data inserted into buffer. +} VGET_CALLBACKS; // API DEFINITION ---------------------------------------------------- @@ -108,7 +113,8 @@ void vshowmsg(const char *msg); /// draw standard pause/message // vget: (y, x, ...) int vgets (char *buf, int len, int flags); /// input with edit box control int vgetstr (char *buf, int len, int flags, const char *str);/// input with default value -int vget(int y, int x, const char *prompt, char *buf, int len, int mode); +int vget (int y, int x, const char *prompt, char *buf, int len, int mode); +int vgetstring(char *_buf, int len, int flags, const char *defstr, const VGET_CALLBACKS *pcb, void *cbparam); // vs_*: formatted and themed virtual screen layout // you cannot use ANSI escapes in these APIs. |