summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-10-23 00:26:10 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-10-23 00:26:10 +0800
commit8576cb8ca4ab7962b470025ef346b825374b30d2 (patch)
tree096b88260878baea9385e7d38f893bb8c8be447a
parent4189a3634ade32723a1b4a74b5c49f3b2a628cb2 (diff)
downloadpttbbs-8576cb8ca4ab7962b470025ef346b825374b30d2.tar
pttbbs-8576cb8ca4ab7962b470025ef346b825374b30d2.tar.gz
pttbbs-8576cb8ca4ab7962b470025ef346b825374b30d2.tar.bz2
pttbbs-8576cb8ca4ab7962b470025ef346b825374b30d2.tar.lz
pttbbs-8576cb8ca4ab7962b470025ef346b825374b30d2.tar.xz
pttbbs-8576cb8ca4ab7962b470025ef346b825374b30d2.tar.zst
pttbbs-8576cb8ca4ab7962b470025ef346b825374b30d2.zip
* add module name in cal
* move CCW_CTX from pttstruct to ccw because we'll hide all secret inside ccw.c git-svn-id: http://opensvn.csie.org/pttbbs/trunk@4959 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/include/proto.h8
-rw-r--r--pttbbs/include/pttstruct.h33
-rw-r--r--pttbbs/mbbsd/cal.c5
-rw-r--r--pttbbs/mbbsd/ccw.c33
4 files changed, 37 insertions, 42 deletions
diff --git a/pttbbs/include/proto.h b/pttbbs/include/proto.h
index afa35995..6958c79c 100644
--- a/pttbbs/include/proto.h
+++ b/pttbbs/include/proto.h
@@ -143,7 +143,6 @@ int g_ten_helf(void);
int card_99(void);
/* ccw (common chat window) */
-// int ccw_process(CCW_CTX *ctx);
int ccw_talk(int fd, int destuid); // common chat window: private talk
int ccw_chat(int fd); // common chat window: chatroom
@@ -654,13 +653,6 @@ int x_today(void);
int x_yesterday(void);
int x_user100(void);
int x_birth(void);
-#if 0
-int x_90(void);
-int x_89(void);
-int x_88(void);
-int x_87(void);
-int x_86(void);
-#endif
int x_history(void);
int x_weather(void);
int x_stock(void);
diff --git a/pttbbs/include/pttstruct.h b/pttbbs/include/pttstruct.h
index b8930eb3..77a32abf 100644
--- a/pttbbs/include/pttstruct.h
+++ b/pttbbs/include/pttstruct.h
@@ -439,39 +439,6 @@ typedef struct menu_t {
char mtitle[STRLEN];
} menu_t;
-// Common Chat Window (ccw)
-typedef struct CCW_CTX {
- int line; // position of next line to append data
- int abort; // indicate session complete
- int abort_vget;// temporary abort from input
- int reset_scr; // need to redraw everything
- int local_echo;// should we echo local input?
- FILE *log; // log file handle
- char *log_fpath;// path of log file
- void *arg; // private argument
- char *sep_help_msg; // quick help message on separators
-
- int fd; // remote connection
- char *remote_id;// remote user id
- char *local_id; // local user id
-
- const int max_input_len;
-
- // layout renderers
- void (*header) (struct CCW_CTX *);
- void (*prompt) (struct CCW_CTX *);
- void (*footer) (struct CCW_CTX *);
- void (*separators) (struct CCW_CTX *); // render header and footer separate lines
-
- // content processors
- int (*peek_key) (struct CCW_CTX *, int key);
- int (*peek_cmd) (struct CCW_CTX *, const char *buf, int local);
- void (*print_line) (struct CCW_CTX *, const char *buf, int local); // print on screen
- void (*log_line) (struct CCW_CTX *, const char *buf, int local); // log to file
- void (*post_input) (struct CCW_CTX *, const char *buf, int local); // after valid input
-} CCW_CTX;
-
-
/* Used to pass commands to the readmenu.
* direct mapping, indexed by ascii code. */
#define onekey_size ((int) 'z')
diff --git a/pttbbs/mbbsd/cal.c b/pttbbs/mbbsd/cal.c
index 0a00f5f6..7ceeb138 100644
--- a/pttbbs/mbbsd/cal.c
+++ b/pttbbs/mbbsd/cal.c
@@ -533,7 +533,7 @@ p_sysinfo(void)
#ifdef REPORT_PIAIP_MODULES
outs("\n" ANSI_COLOR(1;30)
"Modules powered by piaip:\n"
- "\ttelnet protocol, ALOHA fixer, BRC v3\n"
+ "\ttelnet/vkbd protocol, vtuikit, ALOHA fixer, BRC v3\n"
#if defined(USE_PIAIP_MORE) || defined(USE_PMORE)
"\tpmore (piaip's more) 2007 w/Movie\n"
#endif
@@ -549,6 +549,9 @@ p_sysinfo(void)
#if defined(USE_PFTERM)
"\t(EXP) pfterm (piaip's flat terminal, Perfect Term)\n"
#endif
+#if defined(EXP_CCW_CHAT) || defined(EXP_CCW_TALK)
+ "\t(EXP) piaip's Common Chat Window (CCW)\n"
+#endif
#if defined(USE_BBSLUA)
"\t(EXP) BBS-Lua\n"
#endif
diff --git a/pttbbs/mbbsd/ccw.c b/pttbbs/mbbsd/ccw.c
index 639ba963..22cef617 100644
--- a/pttbbs/mbbsd/ccw.c
+++ b/pttbbs/mbbsd/ccw.c
@@ -39,6 +39,39 @@
#define CCW_LOCAL_MSG (2)
///////////////////////////////////////////////////////////////////////////
+// Data Structure
+typedef struct CCW_CTX {
+ int line; // position of next line to append data
+ int abort; // indicate session complete
+ int abort_vget;// temporary abort from input
+ int reset_scr; // need to redraw everything
+ int local_echo;// should we echo local input?
+ FILE *log; // log file handle
+ char *log_fpath;// path of log file
+ void *arg; // private argument
+ char *sep_help_msg; // quick help message on separators
+
+ int fd; // remote connection
+ char *remote_id;// remote user id
+ char *local_id; // local user id
+
+ const int max_input_len;
+
+ // layout renderers
+ void (*header) (struct CCW_CTX *);
+ void (*prompt) (struct CCW_CTX *);
+ void (*footer) (struct CCW_CTX *);
+ void (*separators) (struct CCW_CTX *); // render header and footer separate lines
+
+ // content processors
+ int (*peek_key) (struct CCW_CTX *, int key);
+ int (*peek_cmd) (struct CCW_CTX *, const char *buf, int local);
+ void (*print_line) (struct CCW_CTX *, const char *buf, int local); // print on screen
+ void (*log_line) (struct CCW_CTX *, const char *buf, int local); // log to file
+ void (*post_input) (struct CCW_CTX *, const char *buf, int local); // after valid input
+} CCW_CTX;
+
+///////////////////////////////////////////////////////////////////////////
// CCW helpers
// utilities declaration