summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-04-24 01:29:51 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-04-24 01:29:51 +0800
commit06a4d437e91b3b0165b6eafbf7eaf736816fc27c (patch)
treec2439330581b4d26feaa8605bfdde5bc344bd164 /include
parent61c39a72f5cc21e6d0d708efbe13b52e311ddf61 (diff)
downloadpttbbs-06a4d437e91b3b0165b6eafbf7eaf736816fc27c.tar
pttbbs-06a4d437e91b3b0165b6eafbf7eaf736816fc27c.tar.gz
pttbbs-06a4d437e91b3b0165b6eafbf7eaf736816fc27c.tar.bz2
pttbbs-06a4d437e91b3b0165b6eafbf7eaf736816fc27c.tar.lz
pttbbs-06a4d437e91b3b0165b6eafbf7eaf736816fc27c.tar.xz
pttbbs-06a4d437e91b3b0165b6eafbf7eaf736816fc27c.tar.zst
pttbbs-06a4d437e91b3b0165b6eafbf7eaf736816fc27c.zip
- (internal) refine visio callback
- (internal) move utility function to name.c, prepare for isolation git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4238 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'include')
-rw-r--r--include/proto.h1
-rw-r--r--include/visio.h11
2 files changed, 9 insertions, 3 deletions
diff --git a/include/proto.h b/include/proto.h
index 9500b9a5..35e2fb4e 100644
--- a/include/proto.h
+++ b/include/proto.h
@@ -156,7 +156,6 @@ void resolve_boards(void);
void resolve_fcache(void);
void sem_init(int semkey,int *semid);
void sem_lock(int op,int semid);
-char *u_namearray(char buf[][IDLEN + 1], int *pnum, char *tag);
char *getuserid(int num);
int searchnewuser(int mode);
int count_logins(int uid, int show);
diff --git a/include/visio.h b/include/visio.h
index f64a1e3d..626f12e5 100644
--- a/include/visio.h
+++ b/include/visio.h
@@ -83,7 +83,14 @@ typedef struct VCOL {
#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 {
+ char *buf;
+ const int len; // callbacks should not change this.
+ int icurr; // cursor position
+ int iend; // buffer tail (= strlen(buf))
+} VGET_RUNTIME;
+
+typedef int (*VGET_FCALLBACK)(int key, VGET_RUNTIME *prt, void *instance);
typedef struct {
VGET_FCALLBACK peek; // called immediately after key hit
VGET_FCALLBACK data; // called before inserting character data
@@ -122,7 +129,7 @@ void vshowmsg(const char *msg); /// draw standard pause/message
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 vgetstring(char *_buf, int len, int flags, const char *defstr, const VGET_CALLBACKS *pcb, void *cbparam);
+int vgetstring(char *_buf, int len, int flags, const char *defstr, const VGET_CALLBACKS *pcbs, void *instance);
// vs_*: formatted and themed virtual screen layout
// you cannot use ANSI escapes in these APIs.