diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-05-27 17:13:25 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-05-27 17:13:25 +0800 |
commit | 7fb50c3a816f8b243e387dd903df6fbd732735d3 (patch) | |
tree | 1d64a28cd87a251048652b27299fab8abcd6aa2c /mbbsd | |
parent | 47e1682c7ad6d559f46b49d525423479d7d78316 (diff) | |
download | pttbbs-7fb50c3a816f8b243e387dd903df6fbd732735d3.tar pttbbs-7fb50c3a816f8b243e387dd903df6fbd732735d3.tar.gz pttbbs-7fb50c3a816f8b243e387dd903df6fbd732735d3.tar.bz2 pttbbs-7fb50c3a816f8b243e387dd903df6fbd732735d3.tar.lz pttbbs-7fb50c3a816f8b243e387dd903df6fbd732735d3.tar.xz pttbbs-7fb50c3a816f8b243e387dd903df6fbd732735d3.tar.zst pttbbs-7fb50c3a816f8b243e387dd903df6fbd732735d3.zip |
- many small revise
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4487 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/Makefile | 2 | ||||
-rw-r--r-- | mbbsd/chc.c | 2 | ||||
-rw-r--r-- | mbbsd/chess.c | 6 | ||||
-rw-r--r-- | mbbsd/convert.c | 15 | ||||
-rw-r--r-- | mbbsd/io.c | 16 | ||||
-rw-r--r-- | mbbsd/record.c | 1 |
6 files changed, 31 insertions, 11 deletions
diff --git a/mbbsd/Makefile b/mbbsd/Makefile index f6486530..f5ea4269 100644 --- a/mbbsd/Makefile +++ b/mbbsd/Makefile @@ -72,7 +72,7 @@ OBJS+= screen.o ####################################################################### .if defined(DIET) -OBJS+= random.o time.o alloc.o +LDLIBS+= $(SRCROOT)/common/diet/libdiet.a DIETCC:= diet -Os .endif diff --git a/mbbsd/chc.c b/mbbsd/chc.c index 5c69a9bd..4df8e2d7 100644 --- a/mbbsd/chc.c +++ b/mbbsd/chc.c @@ -778,7 +778,7 @@ chc_select(ChessInfo* info, rc_t scrloc, ChessGameResult* result) return 0; } -int round_to_int(double x) +static int round_to_int(double x) { /* assume that double cast to int will drop fraction parts */ if(x>=0) diff --git a/mbbsd/chess.c b/mbbsd/chess.c index 3e578a20..03475926 100644 --- a/mbbsd/chess.c +++ b/mbbsd/chess.c @@ -48,11 +48,13 @@ static const char * const ChessHintStr[] = { "Enter ���/����" }; -static const struct { +struct ChessReplayMap_t { const char* name; int name_len; ChessInfo* (*func)(FILE* fp); -} ChessReplayMap[] = { +}; + +static const struct ChessReplayMap_t ChessReplayMap[] = { { "gomoku", 6, &gomoku_replay }, { "chc", 3, &chc_replay }, { "go", 2, &gochess_replay }, diff --git a/mbbsd/convert.c b/mbbsd/convert.c index e5d0f07b..611e54ac 100644 --- a/mbbsd/convert.c +++ b/mbbsd/convert.c @@ -3,6 +3,13 @@ #ifdef CONVERT +#ifdef CONVERT +extern void big2gb_init(void*); +extern void gb2big_init(void*); +extern void big2uni_init(void*); +extern void uni2big_init(void*); +#endif + extern unsigned char *gb2big(unsigned char *, int *, int); extern unsigned char *big2gb(unsigned char *, int *, int); extern unsigned char *utf8_uni(unsigned char *, int *, int); @@ -120,4 +127,12 @@ void set_converting_type(int which) // bbs_convert_type = which; } +void init_convert() +{ + big2gb_init(NULL); + gb2big_init(NULL); + big2uni_init(NULL); + uni2big_init(NULL); +} + #endif @@ -31,7 +31,7 @@ static unsigned long szTotalOutput = 0, szLastOutput = 0; extern unsigned char fakeEscape; unsigned char fakeEscape = 0; -unsigned char fakeEscFilter(unsigned char c) +static unsigned char fakeEscFilter(unsigned char c) { if (!fakeEscape) return c; if (c == ESC_CHR) return '*'; @@ -48,17 +48,15 @@ unsigned char fakeEscFilter(unsigned char c) /* ----------------------------------------------------- */ #ifdef CONVERT -extern read_write_type write_type; -extern read_write_type read_type; -extern convert_type input_type; - inline static ssize_t input_wrapper(void *buf, ssize_t count) { /* input_wrapper is a special case. * because we may do nothing, * a if-branch is better than a function-pointer call. */ - if(input_type) return (*input_type)(buf, count); - else return count; + if(input_type) + return (*input_type)(buf, count); + else + return count; } inline static int read_wrapper(int fd, void *buf, size_t count) { @@ -745,6 +743,10 @@ drop_input(void) icurrchar = ibufsize = 0; } +/* + * wait user input for f seconds. + * return 1 if control key c is available. + */ int peek_input(float f, int c) { diff --git a/mbbsd/record.c b/mbbsd/record.c index ec992b0b..83bafe76 100644 --- a/mbbsd/record.c +++ b/mbbsd/record.c @@ -322,6 +322,7 @@ safe_article_delete_range(const char *direct, int from, int to) #endif /* mail / post �ɡA�̾ڮɶ��إ��ɮסA�[�W�l�W */ +/* @param[in,out] fpath input as dirname, output as filename */ int stampfile_u(char *fpath, fileheader_t * fh) // Ptt: stampfile_u: won't clear fileheader |