From 9f968c8886542a57ef9a9c56730857252100acd7 Mon Sep 17 00:00:00 2001 From: ptt Date: Fri, 23 Apr 2004 03:19:01 +0000 Subject: debug of segfault on userlist git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1821 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- include/perm.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/perm.h b/include/perm.h index 2d676bae..02c03d0f 100644 --- a/include/perm.h +++ b/include/perm.h @@ -11,7 +11,7 @@ #define PERM_CLOAK 000000000100 /* 目前隱形中 */ #define PERM_SEECLOAK 000000000200 /* 看見忍者 */ #define PERM_XEMPT 000000000400 /* 永久保留帳號 */ -#define PERM_DENYPOST 000000001000 /* 站長隱身術 */ +#define PERM_SYSOPHIDE 000000001000 /* 站長隱身術 */ #define PERM_BM 000000002000 /* 板主 */ #define PERM_ACCOUNTS 000000004000 /* 帳號總管 */ #define PERM_CHATROOM 000000010000 /* 聊天室總管 */ @@ -51,8 +51,7 @@ #define HAS_PERM(x) ((x) ? cuser.userlevel & (x) : 1) #define HAVE_PERM(x) (cuser.userlevel&(x)) -#define PERM_HIDE(u) ((u)->userlevel & PERM_SYSOP && \ - (u)->userlevel & PERM_DENYPOST) +#define PERM_HIDE(u) (u && (u)->userlevel & PERM_SYSOPHIDE) #define IS_BOARD(bptr) ((bptr)->brdname[0] && \ !((bptr)->brdattr & BRD_GROUPBOARD)) -- cgit v1.2.3 From b640fe2c00e591888ecc1ca594e5e51336c3bf44 Mon Sep 17 00:00:00 2001 From: ptt Date: Fri, 23 Apr 2004 15:03:54 +0000 Subject: remove useless functions integrate similiar functions git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1827 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- include/proto.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/proto.h b/include/proto.h index b3fed5a6..82865f8d 100644 --- a/include/proto.h +++ b/include/proto.h @@ -312,7 +312,6 @@ void init_alarm(void); int num_in_buf(void); int ochar(int c); int rget(int x,char *prompt); -char getans(char *prompt); /* kaede */ int Rename(char* src, char* dst); @@ -480,11 +479,13 @@ void out_lines(char *str, int line); #define isprint2(ch) ((ch & 0x80) || isprint(ch)) #define not_alpha(ch) (ch < 'A' || (ch > 'Z' && ch < 'a') || ch > 'z') #define not_alnum(ch) (ch < '0' || (ch > '9' && ch < 'A') || (ch > 'Z' && ch < 'a') || ch > 'z') +#define pressanykey() vmsg_lines(b_lines, "") +int vmsg_lines(int lines, const char *msg); time_t gettime(int line, time_t dt, char* head); void setcalfile(char *buf, char *userid); void stand_title(char *title); -void pressanykey(void); -int vmsg (const char *fmt,...) GCC_CHECK_FORMAT(1,2); +int getans(const char *fmt,...) GCC_CHECK_FORMAT(1,2); +int vmsg(const char *fmt,...) GCC_CHECK_FORMAT(1,2); void trim(char *buf); void bell(void); void setbpath(char *buf, char *boardname); -- cgit v1.2.3 From b282f3c6dca2a15ef4da7ee6c1f970e5ae926b67 Mon Sep 17 00:00:00 2001 From: ptt Date: Fri, 23 Apr 2004 20:14:20 +0000 Subject: reoragnize functions mprints, pprints -> mouts remove useless refresh, pressanykey(), sleep,... git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1833 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- include/modes.h | 2 +- include/proto.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'include') diff --git a/include/modes.h b/include/modes.h index 16d23754..1a180055 100644 --- a/include/modes.h +++ b/include/modes.h @@ -13,7 +13,7 @@ #define READ_REDRAW 9 #define PART_REDRAW 10 #define TITLE_REDRAW 11 -#define POS_NEXT 101 /* cursor_pos(locmem, locmem->crs_ln + 1, 1);*/ +#define READ_SKIP 12 /* user 操作狀態與模式 */ #define IDLE 0 diff --git a/include/proto.h b/include/proto.h index 82865f8d..097829b7 100644 --- a/include/proto.h +++ b/include/proto.h @@ -459,7 +459,6 @@ void clrtoeol(void); void clear(void); void refresh(void); void clrtobot(void); -void mprints(int y, int x, char *str); void outmsg(char *msg); void region_scroll_up(int top, int bottom); void outc(unsigned char ch); -- cgit v1.2.3 From 9638054c27af6c986d72ffe416152208fb8da006 Mon Sep 17 00:00:00 2001 From: ptt Date: Fri, 23 Apr 2004 20:22:40 +0000 Subject: two mouts clean one mouts git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1835 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/proto.h b/include/proto.h index 097829b7..773a5a0c 100644 --- a/include/proto.h +++ b/include/proto.h @@ -453,6 +453,7 @@ void check_register(void); char *genpasswd(char *pw); /* screen */ +void mouts(int y, int x, char *str); void move(int y, int x); void outs(char *str); void clrtoeol(void); -- cgit v1.2.3 From 77977eec595648e9143769c7993c65490b753b99 Mon Sep 17 00:00:00 2001 From: ptt Date: Fri, 23 Apr 2004 20:49:16 +0000 Subject: modify a little for vmsg git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1837 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- include/proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/proto.h b/include/proto.h index 773a5a0c..01593227 100644 --- a/include/proto.h +++ b/include/proto.h @@ -479,7 +479,7 @@ void out_lines(char *str, int line); #define isprint2(ch) ((ch & 0x80) || isprint(ch)) #define not_alpha(ch) (ch < 'A' || (ch > 'Z' && ch < 'a') || ch > 'z') #define not_alnum(ch) (ch < '0' || (ch > '9' && ch < 'A') || (ch > 'Z' && ch < 'a') || ch > 'z') -#define pressanykey() vmsg_lines(b_lines, "") +#define pressanykey() vmsg_lines(b_lines, NULL) int vmsg_lines(int lines, const char *msg); time_t gettime(int line, time_t dt, char* head); void setcalfile(char *buf, char *userid); -- cgit v1.2.3 From 38bde17fbfd3ebd01089fa6418bfdfb0ac7c2c27 Mon Sep 17 00:00:00 2001 From: jack Date: Sat, 24 Apr 2004 03:04:14 +0000 Subject: create i18n string array in shm git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1843 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- include/config.h | 8 ++++++++ include/pttstruct.h | 9 +++++++++ 2 files changed, 17 insertions(+) (limited to 'include') diff --git a/include/config.h b/include/config.h index d44ce8a0..5f9a5a73 100644 --- a/include/config.h +++ b/include/config.h @@ -25,6 +25,14 @@ #define MAX_CPULOAD (70) /* CPU 最高load */ #endif +#ifndef MAX_LANG +#define MAX_LANG (1) /* 最多使用語言 */ +#endif + +#ifndef MAX_STRING +#define MAX_STRING (8000) /* 系統最多使用字串 */ +#endif + #ifndef MAX_POST_MONEY /* 發表文章稿費的上限 */ #define MAX_POST_MONEY 100 #endif diff --git a/include/pttstruct.h b/include/pttstruct.h index 80cef86c..eafc8636 100644 --- a/include/pttstruct.h +++ b/include/pttstruct.h @@ -424,6 +424,15 @@ typedef struct { time_t Fuptime; time_t Ftouchtime; int Fbusystate; + +#ifdef I18N + /* i18n(internationlization) */ + char *i18nstrptr[MAX_LANG][MAX_STRING]; + char i18nstrbody[16 * MAX_LANG * MAX_STRING]; + /* Based on the statistis, we found the lengh of one string + is 16 bytes approximately. + */ +#endif } SHM_t; typedef struct { -- cgit v1.2.3