diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-04-27 23:50:20 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-04-27 23:50:20 +0800 |
commit | 1cfd2ba12337bbad41d8e1c1bb5b828d7ef9bc95 (patch) | |
tree | 95c9fbe94ccd9f50a0f09732b577ff455149dd66 | |
parent | f793f25ce60f90f2413546a170203bcc5403e77e (diff) | |
download | pttbbs-1cfd2ba12337bbad41d8e1c1bb5b828d7ef9bc95.tar pttbbs-1cfd2ba12337bbad41d8e1c1bb5b828d7ef9bc95.tar.gz pttbbs-1cfd2ba12337bbad41d8e1c1bb5b828d7ef9bc95.tar.bz2 pttbbs-1cfd2ba12337bbad41d8e1c1bb5b828d7ef9bc95.tar.lz pttbbs-1cfd2ba12337bbad41d8e1c1bb5b828d7ef9bc95.tar.xz pttbbs-1cfd2ba12337bbad41d8e1c1bb5b828d7ef9bc95.tar.zst pttbbs-1cfd2ba12337bbad41d8e1c1bb5b828d7ef9bc95.zip |
for mbbsd.icc
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@128 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | mbbsd.icc/.cvsignore | 2 | ||||
-rw-r--r-- | mbbsd.icc/Makefile | 51 | ||||
-rw-r--r-- | mbbsd/dark.c | 40 | ||||
-rw-r--r-- | mbbsd/descrypt.c | 6 | ||||
-rw-r--r-- | mbbsd/edit.c | 4 | ||||
-rw-r--r-- | mbbsd/mbbsd.c | 6 | ||||
-rw-r--r-- | mbbsd/more.c | 18 | ||||
-rw-r--r-- | mbbsd/page.c | 34 | ||||
-rw-r--r-- | mbbsd/screen.c | 10 | ||||
-rw-r--r-- | mbbsd/talk.c | 12 | ||||
-rw-r--r-- | mbbsd/user.c | 6 |
11 files changed, 121 insertions, 68 deletions
diff --git a/mbbsd.icc/.cvsignore b/mbbsd.icc/.cvsignore new file mode 100644 index 00000000..0ffc7757 --- /dev/null +++ b/mbbsd.icc/.cvsignore @@ -0,0 +1,2 @@ +*.o +mbbsd.icc diff --git a/mbbsd.icc/Makefile b/mbbsd.icc/Makefile new file mode 100644 index 00000000..a87135cc --- /dev/null +++ b/mbbsd.icc/Makefile @@ -0,0 +1,51 @@ +.PATH: ../mbbsd + +BBSHOME=/home/bbs +PROG= mbbsd.icc +OBJS= admin.o announce.o args.o bbcall.o bbs.o board.o cache.o cal.o card.o\ + chat.o chc_draw.o chc_net.o chc_play.o chc_rule.o chicken.o dark.o\ + dice.o edit.o friend.o gamble.o gomo.o gomo1.o guess.o indict.o io.o\ + kaede.o lovepaper.o mail.o mbbsd.o menu.o more.o name.o osdep.o\ + othello.o page.o read.o record.o register.o screen.o stuff.o\ + talk.o term.o topsong.o user.o vice.o vote.o xyz.o\ + voteboard.o syspost.o var.o descrypt.o toolkit.o passwd.o\ + calendar.o + +CFLAGS= -O -DHAVE_SETPROCTITLE -DBBSHOME='"$(BBSHOME)"' -DFreeBSD -I../include -D__FreeBSD__ +LDFLAGS=-O -lutil -lkvm +GCCUSE=gcc -pipe -Wall -O -DHAVE_SETPROCTITLE -DBBSHOME='"/home/bbs"' -DFreeBSD -I../include -c + +.SUFFIXES: .c .o +.c.o: + iccbin $(CFLAGS) -c ../mbbsd/$*.c + +all: $(PROG) + +$(PROG): $(OBJS) + cc $(LDFLAGS) -o $(PROG) $(OBJS) + +install: $(PROG) + install -d $(BBSHOME)/bin/ + install -c -m 755 $(PROG) $(BBSHOME)/bin/ + rm -f $(BBSHOME)/bin/mbbsd + ln -sv $(BBSHOME)/bin/$(PROG) $(BBSHOME)/bin/mbbsd +cache.o: cache.c + $(GCCUSE) ../mbbsd/$*.c + +mail.o: mail.c + $(GCCUSE) ../mbbsd/$*.c + +menu.o: menu.c + $(GCCUSE) ../mbbsd/$*.c + +record.o: record.c + $(GCCUSE) ../mbbsd/$*.c + +topsong.o: topsong.c + $(GCCUSE) ../mbbsd/$*.c + +xyz.o: xyz.c + $(GCCUSE) ../mbbsd/$*.c + +clean: + rm -f $(OBJS) $(PROG) diff --git a/mbbsd/dark.c b/mbbsd/dark.c index 52741617..1b084407 100644 --- a/mbbsd/dark.c +++ b/mbbsd/dark.c @@ -1,4 +1,4 @@ -/* $Id: dark.c,v 1.1 2002/03/07 15:13:48 in2 Exp $ */ +/* $Id: dark.c,v 1.2 2002/04/27 15:50:17 in2 Exp $ */ #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -113,17 +113,17 @@ static void brd_rand() { static void brd_prints() { clear(); move(1,0); - outs(" - [43;30m�~�w�s�w�s�w�s�w�s�w�s�w�s�w�s�w��[m - [43;30m�x���x���x���x���x���x���x���x���x[m - [43;30m�u�w�q�w�q�w�q�w�q�w�q�w�q�w�q�w�t[m - [43;30m�x���x���x���x���x���x���x���x���x[m - [43;30m�u�w�q�w�q�w�q�w�q�w�q�w�q�w�q�w�t[m - [43;30m�x���x���x���x���x���x���x���x���x[m - [43;30m�u�w�q�w�q�w�q�w�q�w�q�w�q�w�q�w�t[m - [43;30m�x���x���x���x���x���x���x���x���x[m - [43;30m���w�r�w�r�w�r�w�r�w�r�w�r�w�r�w��[m - "); + outs("\n" +" [43;30m�~�w�s�w�s�w�s�w�s�w�s�w�s�w�s�w��[m\n" +" [43;30m�x���x���x���x���x���x���x���x���x[m\n" +" [43;30m�u�w�q�w�q�w�q�w�q�w�q�w�q�w�q�w�t[m\n" +" [43;30m�x���x���x���x���x���x���x���x���x[m\n" +" [43;30m�u�w�q�w�q�w�q�w�q�w�q�w�q�w�q�w�t[m\n" +" [43;30m�x���x���x���x���x���x���x���x���x[m\n" +" [43;30m�u�w�q�w�q�w�q�w�q�w�q�w�q�w�q�w�t[m\n" +" [43;30m�x���x���x���x���x���x���x���x���x[m\n" +" [43;30m���w�r�w�r�w�r�w�r�w�r�w�r�w�r�w��[m\n" +" "); } static void draw_line(sint y, sint f) { @@ -325,14 +325,14 @@ int main_dark(int fd,userinfo_t *uin) { } move(12,3); prints("%s[0��0��][5;31m����[1;37m.[m%s[0��0��]",currutmp->userid,currutmp->mateid); - outs(" - [1;36m����[1;31m�\\���[1;36m������������[m - [1;36m��[1;33m ��������[1;37m: [1;35m����[m - [1;36m��[1;33m ��[1;37m: [1;35m ��l,½�l[m - [1;36m��[1;33m enter[1;37m: [1;35m �Y��,���[m -�@[1;33m�w�g�ѨM��[1;37m:[1;36m�@�@ ��[1;33m ��[1;37m: [1;35m �X��[m - �@�@ [1;36m��[1;33m ��[1;37m: [1;35m �{��[m - [1;36m��[1;33m ��[1;37m: [1;35m ����[m"); + outs("\n" +" [1;36m����[1;31m�\\���[1;36m������������[m\n" +" [1;36m��[1;33m ��������[1;37m: [1;35m����[m\n" +" [1;36m��[1;33m ��[1;37m: [1;35m ��l,½�l[m\n" +" [1;36m��[1;33m enter[1;37m: [1;35m �Y��,���[m\n" +"�@[1;33m�w�g�ѨM��[1;37m:[1;36m�@�@ ��[1;33m ��[1;37m: [1;35m �X��[m\n" +" �@�@ [1;36m��[1;33m ��[1;37m: [1;35m �{��[m\n" +" [1;36m��[1;33m ��[1;37m: [1;35m ����[m"); if(currutmp->turn) move(cury[0],curx[0]); diff --git a/mbbsd/descrypt.c b/mbbsd/descrypt.c index 3bb0a5e5..1d246670 100644 --- a/mbbsd/descrypt.c +++ b/mbbsd/descrypt.c @@ -1,4 +1,4 @@ -/* $Id: descrypt.c,v 1.1 2002/03/07 15:13:48 in2 Exp $ */ +/* $Id: descrypt.c,v 1.2 2002/04/27 15:50:17 in2 Exp $ */ /* * FreeSec: libcrypt for NetBSD @@ -560,7 +560,7 @@ char *crypt(char *key, char *setting) { if((*q++ = *key << 1)) key++; } - if(des_setkey((unsigned char *)keybuf)) + if(des_setkey((char *)keybuf)) return NULL; /* @@ -611,6 +611,6 @@ char *crypt(char *key, char *setting) { *p++ = ascii64[l & 0x3f]; *p = 0; - return output; + return (char *)output; } #endif diff --git a/mbbsd/edit.c b/mbbsd/edit.c index 8072de6d..0b372209 100644 --- a/mbbsd/edit.c +++ b/mbbsd/edit.c @@ -1,4 +1,4 @@ -/* $Id: edit.c,v 1.3 2002/04/16 15:27:40 in2 Exp $ */ +/* $Id: edit.c,v 1.4 2002/04/27 15:50:17 in2 Exp $ */ #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -860,7 +860,7 @@ void addsignature(FILE *fp, int ifuseanony) { fprintf(fp, "\n--\n�� �o�H��: " BBSNAME "(" MYHOSTNAME ") \n�� From: %s\n", "�ʦW�ѨϪ��a"); else { - char temp[32]; + char temp[33]; strncpy(temp, fromhost, 31); temp[32] = '\0'; diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index 3f2b68e7..49915683 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -1,4 +1,4 @@ -/* $Id: mbbsd.c,v 1.21 2002/04/15 20:00:22 in2 Exp $ */ +/* $Id: mbbsd.c,v 1.22 2002/04/27 15:50:17 in2 Exp $ */ #include <stdio.h> #include <string.h> #include <stdlib.h> @@ -288,7 +288,7 @@ dosearchuser (char *userid) } static void -talk_request () +talk_request(int sig) { bell (); bell (); @@ -1351,7 +1351,7 @@ daemon_login (int argc, char *argv[], char *envp[]) /* main loop */ for(;;) { len_of_sock_addr = sizeof(xsin); - csock = accept(msock, (struct sockaddr *)&xsin, &len_of_sock_addr); + csock = accept(msock, (struct sockaddr *)&xsin, (socklen_t *)&len_of_sock_addr); if(csock < 0) { if(errno!=EINTR) sleep(1); diff --git a/mbbsd/more.c b/mbbsd/more.c index e072dac4..7440ecc4 100644 --- a/mbbsd/more.c +++ b/mbbsd/more.c @@ -1,4 +1,4 @@ -/* $Id: more.c,v 1.10 2002/04/24 11:16:30 in2 Exp $ */ +/* $Id: more.c,v 1.11 2002/04/27 15:50:17 in2 Exp $ */ #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -119,9 +119,9 @@ more_readln (int fd, unsigned char *buf) } else if (ch == '\033') { - if (atoi (data + 1) > 47) + if (atoi ((char *)(data + 1)) > 47) { - if ((cc = strchr (data + 1, 'm')) != NULL) + if ((cc = (unsigned char *)strchr ((char *)(data + 1), 'm')) != NULL) { ch = cc - data + 1; @@ -251,7 +251,7 @@ int more(char *fpath, int promptend) { more_base = more_head = more_size = 0; - while((numbytes = more_readln(fd, buf)) || (line == t_lines)) { + while((numbytes = more_readln(fd, (unsigned char *)buf)) || (line == t_lines)) { if(scrollup) { rscroll(); move(0, 0); @@ -280,7 +280,7 @@ int more(char *fpath, int promptend) { "\033[m\n", head[pos], word); viewed += numbytes; - numbytes = more_readln(fd, buf); + numbytes = more_readln(fd, (unsigned char *)buf); /* �Ĥ@��Ӫ��F */ if(!pos && viewed > 79) { @@ -288,7 +288,7 @@ int more(char *fpath, int promptend) { if(memcmp( buf, head[1], 2)) { /* Ū�U�@��i�ӳB�z */ viewed += numbytes; - numbytes = more_readln(fd, buf); + numbytes = more_readln(fd, (unsigned char *)buf); } } pos++; @@ -390,7 +390,7 @@ int more(char *fpath, int promptend) { move(line = b_lines, 0); clrtoeol(); for(pos = 1; pos < b_lines; pos++) - viewed += more_readln(fd, buf); + viewed += more_readln(fd, (unsigned char *)buf); } else if(pos == b_lines) /* ���ʿù� */ scroll(); else @@ -693,13 +693,13 @@ int more(char *fpath, int promptend) { scrollup = lino - 1; more_goto(fd, viewed = pagebreak[pageno - 1]); while(line--) - viewed += more_readln(fd, buf); + viewed += more_readln(fd, (unsigned char *)buf); } else if(pageno > 1) { scrollup = b_lines - 1; line = (b_lines - 2) - local; more_goto(fd, viewed = pagebreak[--pageno - 1]); while(line--) - viewed += more_readln(fd, buf); + viewed += more_readln(fd, (unsigned char *)buf); } line = pos = 0; } else { diff --git a/mbbsd/page.c b/mbbsd/page.c index c77ef421..33201bfc 100644 --- a/mbbsd/page.c +++ b/mbbsd/page.c @@ -1,4 +1,4 @@ -/* $Id: page.c,v 1.1 2002/03/07 15:13:48 in2 Exp $ */ +/* $Id: page.c,v 1.2 2002/04/27 15:50:17 in2 Exp $ */ #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -59,22 +59,22 @@ int main_railway() { move(0,25); prints("\033[1;37;45m �����d�ߨt�� \033[1;44;33m�@��:Heat\033[m"); move(1,0); - outs("\033[1;33m - 1.�� 16.���c 31.�s�� 46.���r 61.�Ф� 76.�L���� 91.���� - 2.�K�� 17.�H�� 32.�ըF�� 47.�T�q 62.�G�� 77.���� 92.��s - 3.�C�� 18.���� 33.�s�H 48.�ӿ� 63.�L�� 78.�ުL 93.�E���� - 4.���� 19.��f 34.�q�] 49.���w 64.�ۺh 79.���� 94.�̪F - 5.���� 20.�s�� 35.�b�� 50.�Z�� 65.�椻 80.�s�� - 6.�n�� 21.�˥_ 36.��n 51.�� 66.��n 81.�ñd - 7.�Q�s 22.�s�� 37.�j�� 52.��l 67.���t 82.�x�n - 8.�x�_ 23.���s 38.�O���� 53.�x�� 68.�j�L 83.�O�w - 9.�U�� 24.�T�� 39.�M�� 54.�Q�� 69.���� 84.���w -10.�O�� 25.�˫n 40.�F�� 55.���\\ 70.�Ÿq 85.�j�� -11.��L 26.�y�� 41.�s�� 56.���� 71.���W 86.���� -12.�s�� 27.�״I 42.�j�{ 57.��� 72.�n�t 87.���s -13.�a�q 28.�ͤ� 43.�l�� 58.���L 73.��� 88.���Y -14.��� 29.�j�s 44.�]�� 59.�ùt 74.�s�� 89.���� -15.���c 30.���s 45.�n�� 60.���Y 75.�h�� 90.����\033[m"); + outs("\033[1;33m\n" +" 1.�� 16.���c 31.�s�� 46.���r 61.�Ф� 76.�L���� 91.����\n" +" 2.�K�� 17.�H�� 32.�ըF�� 47.�T�q 62.�G�� 77.���� 92.��s\n" +" 3.�C�� 18.���� 33.�s�H 48.�ӿ� 63.�L�� 78.�ުL 93.�E����\n" +" 4.���� 19.��f 34.�q�] 49.���w 64.�ۺh 79.���� 94.�̪F\n" +" 5.���� 20.�s�� 35.�b�� 50.�Z�� 65.�椻 80.�s��\n" +" 6.�n�� 21.�˥_ 36.��n 51.�� 66.��n 81.�ñd\n" +" 7.�Q�s 22.�s�� 37.�j�� 52.��l 67.���t 82.�x�n\n" +" 8.�x�_ 23.���s 38.�O���� 53.�x�� 68.�j�L 83.�O�w\n" +" 9.�U�� 24.�T�� 39.�M�� 54.�Q�� 69.���� 84.���w\n" +"10.�O�� 25.�˫n 40.�F�� 55.���\\ 70.�Ÿq 85.�j��\n" +"11.��L 26.�y�� 41.�s�� 56.���� 71.���W 86.����\n" +"12.�s�� 27.�״I 42.�j�{ 57.��� 72.�n�t 87.���s\n" +"13.�a�q 28.�ͤ� 43.�l�� 58.���L 73.��� 88.���Y\n" +"14.��� 29.�j�s 44.�]�� 59.�ùt 74.�s�� 89.����\n" +"15.���c 30.���s 45.�n�� 60.���Y 75.�h�� 90.����\033[m"); getdata(17, 0, "\033[1;35m�A�T�w�n�j�M��?[y/n]:\033[m", buf, 2, LCECHO); if(buf[0] != 'y' && buf[0] != 'Y') diff --git a/mbbsd/screen.c b/mbbsd/screen.c index 46ad5b38..2c70917f 100644 --- a/mbbsd/screen.c +++ b/mbbsd/screen.c @@ -1,4 +1,4 @@ -/* $Id: screen.c,v 1.1 2002/03/07 15:13:48 in2 Exp $ */ +/* $Id: screen.c,v 1.2 2002/04/27 15:50:17 in2 Exp $ */ #include <stdio.h> #include <string.h> #include <stdlib.h> @@ -131,9 +131,9 @@ void redoscr() { if((len = bp->len)) { rel_move(tc_col, tc_line, 0, i); if(bp->mode & STANDOUT) - standoutput(bp->data, 0, len, bp->sso, bp->eso); + standoutput((char *)bp->data, 0, len, bp->sso, bp->eso); else - output(bp->data, len); + output((char *)bp->data, len); tc_col += len; if(tc_col >= t_columns) { if (automargins) @@ -195,10 +195,10 @@ void refresh() { rel_move(tc_col, tc_line, bp->smod, i); if(bp->mode & STANDOUT) - standoutput(bp->data, bp->smod, bp->emod + 1, + standoutput((char *)bp->data, bp->smod, bp->emod + 1, bp->sso, bp->eso); else - output(&bp->data[bp->smod], bp->emod - bp->smod + 1); + output((char *)&bp->data[bp->smod], bp->emod - bp->smod + 1); tc_col = bp->emod + 1; if(tc_col >= t_columns) { if(automargins) { diff --git a/mbbsd/talk.c b/mbbsd/talk.c index facab4b4..73fdbc43 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -1,4 +1,4 @@ -/* $Id: talk.c,v 1.21 2002/04/10 10:49:42 in2 Exp $ */ +/* $Id: talk.c,v 1.22 2002/04/27 15:50:17 in2 Exp $ */ #include <stdio.h> #include <string.h> #include <errno.h> @@ -954,13 +954,13 @@ static void do_talk_char(talkwin_t * twin, int ch) case Ctrl('M'): case Ctrl('J'): line = big_picture + twin->curln; - strncpy(buf, line->data, line->len); + strncpy(buf, (char *)line->data, line->len); buf[line->len] = 0; do_talk_nextline(twin); break; case Ctrl('P'): line = big_picture + twin->curln; - strncpy(buf, line->data, line->len); + strncpy(buf, (char *)line->data, line->len); buf[line->len] = 0; if (twin->curln > twin->sline){ --(twin->curln); @@ -969,7 +969,7 @@ static void do_talk_char(talkwin_t * twin, int ch) break; case Ctrl('N'): line = big_picture + twin->curln; - strncpy(buf, line->data, line->len); + strncpy(buf, (char *)line->data, line->len); buf[line->len] = 0; if (twin->curln < twin->eline){ ++(twin->curln); @@ -1230,7 +1230,7 @@ static void my_talk(userinfo_t * uin, int fri_stat) { return; } length = sizeof(server); - if (getsockname(sock, (struct sockaddr *) &server, &length) < 0){ + if (getsockname(sock, (struct sockaddr *) &server, (socklen_t*)&length) < 0){ close(sock); perror("sock name err"); unlockutmpmode(); @@ -1305,7 +1305,7 @@ static void my_talk(userinfo_t * uin, int fri_stat) { } } - msgsock = accept(sock, (struct sockaddr *) 0, (int *) 0); + msgsock = accept(sock, (struct sockaddr *) 0, (socklen_t *) 0); if (msgsock == -1){ perror("accept"); unlockutmpmode(); diff --git a/mbbsd/user.c b/mbbsd/user.c index 2e2e3401..55719a4a 100644 --- a/mbbsd/user.c +++ b/mbbsd/user.c @@ -1,4 +1,4 @@ -/* $Id: user.c,v 1.13 2002/04/05 18:49:47 in2 Exp $ */ +/* $Id: user.c,v 1.14 2002/04/27 15:50:17 in2 Exp $ */ #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -319,7 +319,7 @@ void uinfo_query(userec_t *u, int real, int unum) { if(HAS_PERM(PERM_BBSADM)) { sprintf(genbuf, "%d", x.money); if(getdata_str(i++, 0,"�Ȧ�b��G", buf, 10, DOECHO,genbuf)) - if((l = atol(buf)) >= 0) { + if((l = atol(buf)) != 0) { if(l != x.money) { money_change = 1; money = x.money; @@ -329,7 +329,7 @@ void uinfo_query(userec_t *u, int real, int unum) { } sprintf(genbuf, "%d", x.exmailbox); if(getdata_str(i++, 0,"�ʶR�H�c�ơG", buf, 4, DOECHO,genbuf)) - if((l = atol(buf)) >= 0) + if((l = atol(buf)) != 0) x.exmailbox = (int)l; getdata_buf(i++, 0, "�{�Ҹ�ơG", x.justify, 44, DOECHO); |