diff options
-rw-r--r-- | pttbbs/include/proto.h | 8 | ||||
-rw-r--r-- | pttbbs/include/pttstruct.h | 33 | ||||
-rw-r--r-- | pttbbs/mbbsd/cal.c | 5 | ||||
-rw-r--r-- | pttbbs/mbbsd/ccw.c | 33 |
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 |