diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-12-04 03:37:23 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-12-04 03:37:23 +0800 |
commit | ea5f148819c3986ef751dce5d83d9314f920b10c (patch) | |
tree | 8e07d0610d342b3de83dbc1d9cc83e725a61f34d | |
parent | 64abee05405680452d0e7d8b7237d6de0cb12cdf (diff) | |
download | pttbbs-ea5f148819c3986ef751dce5d83d9314f920b10c.tar pttbbs-ea5f148819c3986ef751dce5d83d9314f920b10c.tar.gz pttbbs-ea5f148819c3986ef751dce5d83d9314f920b10c.tar.bz2 pttbbs-ea5f148819c3986ef751dce5d83d9314f920b10c.tar.lz pttbbs-ea5f148819c3986ef751dce5d83d9314f920b10c.tar.xz pttbbs-ea5f148819c3986ef751dce5d83d9314f920b10c.tar.zst pttbbs-ea5f148819c3986ef751dce5d83d9314f920b10c.zip |
- add option to support both coloured and symboled modification mark (~ and +)
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3625 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | include/convert.h | 2 | ||||
-rw-r--r-- | include/uflags.h | 8 | ||||
-rw-r--r-- | mbbsd/bbs.c | 26 | ||||
-rw-r--r-- | mbbsd/convert.c | 7 | ||||
-rw-r--r-- | mbbsd/user.c | 4 |
5 files changed, 38 insertions, 9 deletions
diff --git a/include/convert.h b/include/convert.h index c5303d56..a4f1b410 100644 --- a/include/convert.h +++ b/include/convert.h @@ -11,7 +11,7 @@ typedef ssize_t (*read_write_type)(int, void *, size_t); typedef ssize_t (*convert_type)(void *, ssize_t); -extern int bbs_convert_type; +// extern int bbs_convert_type; #endif // CONVERT #endif // _BBS_CONVERT_H diff --git a/include/uflags.h b/include/uflags.h index 48bcc326..1686c98e 100644 --- a/include/uflags.h +++ b/include/uflags.h @@ -23,9 +23,15 @@ /* DBCS CONFIG */ #define DBCSAWARE_FLAG 0x00000200 /* true if DBCS-aware enabled. */ /* please keep this even if you don't have DBCSAWARE features turned on */ +// #define DBCS__??? 0x00000400 +// #define DBCS__??? 0x00000800 + +/* Modification Mark (~) */ +#define NO_MODMARK_FLAG 0x00001000 /* true if modified files are NOT marked */ +#define COLORED_MODMARK 0x00002000 /* true if mod-mark is coloured. */ /* NEW ENTRY HERE */ -// #define ??__??? 0x00000400 +// #define ??__??? 0x00010000 /* -------------------- userec_t.uflag2 (unsigned int) */ diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index a853371b..ad101bb5 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -330,10 +330,18 @@ readdoent(int num, fileheader_t * ent) type = '+'; break; case 2: // unread (modified) - // why not use +? because some terminals may not easily + // why not always +? because some terminals may not easily // see highlights easily - type = '~'; - // typeattr = ANSI_COLOR(1;30); + if (!(cuser.uflag & NO_MODMARK_FLAG)) + { + if (cuser.uflag & COLORED_MODMARK) + { + typeattr = ANSI_COLOR(1;30); + type = '+'; + } else { + type = '~'; + } + } break; default: break; @@ -355,8 +363,16 @@ readdoent(int num, fileheader_t * ent) else if (isunread == 2) { // modified mark - type = 'm'; - typeattr = ANSI_COLOR(36); + if (!(cuser.uflag & NO_MODMARK_FLAG)) + { + if (cuser.uflag & COLORED_MODMARK) + { + typeattr = ANSI_COLOR(36); + type = 'm'; + } else { + type = '='; + } + } } } } diff --git a/mbbsd/convert.c b/mbbsd/convert.c index acb61c03..e5d0f07b 100644 --- a/mbbsd/convert.c +++ b/mbbsd/convert.c @@ -94,7 +94,10 @@ norm_input(void *buf, ssize_t icount) read_write_type write_type = (read_write_type)write; read_write_type read_type = read; convert_type input_type = norm_input; -int bbs_convert_type = CONV_NORMAL; + +// enable this in case some day we want to detect +// current type. but right now disable for less memory cost +// int bbs_convert_type = CONV_NORMAL; void set_converting_type(int which) { @@ -114,7 +117,7 @@ void set_converting_type(int which) write_type = utf8_write; input_type = utf8_input; } - bbs_convert_type = which; + // bbs_convert_type = which; } #endif diff --git a/mbbsd/user.c b/mbbsd/user.c index 7fcfb6c6..29b6d030 100644 --- a/mbbsd/user.c +++ b/mbbsd/user.c @@ -326,6 +326,8 @@ void Customize(void) /* cuser.uflag settings */ static const unsigned int masks1[] = { MOVIE_FLAG, + NO_MODMARK_FLAG , + COLORED_MODMARK, #ifdef DBCSAWARE DBCSAWARE_FLAG, #endif @@ -334,6 +336,8 @@ void Customize(void) static const char* desc1[] = { "動態看板", + "隱藏文章修改符號(推文/修文) (~)", + "改用彩色修改符號 (+)", #ifdef DBCSAWARE "自動偵測雙位元字集(如全型中文)", #endif |