diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-07-21 17:26:02 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-07-21 17:26:02 +0800 |
commit | e9a7b75babb76e1a3341161bcb6e80f3753b83c7 (patch) | |
tree | 04debdc816cd5405bba70904a1eea16ca6fca663 | |
parent | 1428a82d1644166fdaa5285c67f236ac02687818 (diff) | |
download | pttbbs-e9a7b75babb76e1a3341161bcb6e80f3753b83c7.tar pttbbs-e9a7b75babb76e1a3341161bcb6e80f3753b83c7.tar.gz pttbbs-e9a7b75babb76e1a3341161bcb6e80f3753b83c7.tar.bz2 pttbbs-e9a7b75babb76e1a3341161bcb6e80f3753b83c7.tar.lz pttbbs-e9a7b75babb76e1a3341161bcb6e80f3753b83c7.tar.xz pttbbs-e9a7b75babb76e1a3341161bcb6e80f3753b83c7.tar.zst pttbbs-e9a7b75babb76e1a3341161bcb6e80f3753b83c7.zip |
indent -i4
fix indent's word error
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@429 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
54 files changed, 2045 insertions, 1954 deletions
diff --git a/mbbsd/admin.c b/mbbsd/admin.c index f6d13042..8fe3621c 100644 --- a/mbbsd/admin.c +++ b/mbbsd/admin.c @@ -1,8 +1,8 @@ -/* $Id: admin.c,v 1.26 2002/07/21 08:18:41 in2 Exp $ */ +/* $Id: admin.c,v 1.27 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" /* ¨Ï¥ÎªÌºÞ²z */ -int +int m_user() { userec_t muser; @@ -26,7 +26,7 @@ m_user() return 0; } -static int +static int search_key_user(char *passwdfile, int mode) { userec_t user; @@ -111,7 +111,7 @@ search_key_user(char *passwdfile, int mode) } /* ¥H¥ô·N key ´M§ä¨Ï¥ÎªÌ */ -int +int search_user_bypwd() { search_key_user(FN_PASSWD, 1); @@ -119,7 +119,7 @@ search_user_bypwd() } /* ´M§ä³Æ¥÷ªº¨Ï¥ÎªÌ¸ê®Æ */ -int +int search_user_bybakpwd() { char *choice[] = { @@ -149,14 +149,14 @@ search_user_bybakpwd() return 0; } -static void +static void bperm_msg(boardheader_t * board) { prints("\n³]©w [%s] ¬ÝªO¤§(%s)Åv¡G", board->brdname, board->brdattr & BRD_POSTMASK ? "µoªí" : "¾\\Ū"); } -unsigned int +unsigned int setperms(unsigned int pbits, char *pstring[]) { register int i; @@ -189,7 +189,7 @@ setperms(unsigned int pbits, char *pstring[]) } /* ¦Û°Ê³]¥ßºëµØ°Ï */ -void +void setup_man(boardheader_t * board) { char genbuf[200]; @@ -199,7 +199,7 @@ setup_man(boardheader_t * board) } -int +int m_mod_board(char *bname) { boardheader_t bh, newbh; @@ -381,7 +381,7 @@ m_mod_board(char *bname) } /* ³]©w¬ÝªO */ -int +int m_board() { char bname[32]; @@ -398,7 +398,7 @@ m_board() } /* ³]©w¨t²ÎÀÉ®× */ -int +int x_file() { int aborted; @@ -522,7 +522,7 @@ x_file() return FULLUPDATE; } -int +int m_newbrd(int recover) { boardheader_t newboard; @@ -633,7 +633,7 @@ m_newbrd(int recover) return 0; } -static int +static int auto_scan(char fdata[][STRLEN], char ans[]) { int good = 0; @@ -718,7 +718,7 @@ auto_scan(char fdata[][STRLEN], char ans[]) } /* ³B²z Register Form */ -int +int scan_register_form(char *regfile, int automode, int neednum) { char genbuf[200]; @@ -949,8 +949,8 @@ scan_register_form(char *regfile, int automode, int neednum) /** DickG: ±N¼f¤F´X¥÷ªº¬ÛÃö¸ê®Æ post ¨ì Security ªO¤W ***********/ /* - * DickG: ¦]À³·sªº¯¸ªø¤W¯¸»Ý¼f®Ö¤è®×¡A¬O¬G¨S¦³¥²n¯d¤U record - * ime(buf, 200, "%Y/%m/%d/%H:%M", pt); + * DickG: ¦]À³·sªº¯¸ªø¤W¯¸»Ý¼f®Ö¤è®×¡A¬O¬G¨S¦³¥²n¯d¤U record ime(buf, + * 200, "%Y/%m/%d/%H:%M", pt); * * strcpy(xboard, "Security"); setbpath(xfpath, xboard); stampfile(xfpath, * &xfile); strcpy(xfile.owner, "¨t²Î"); strcpy(xfile.title, "[³ø§i] @@ -966,7 +966,7 @@ scan_register_form(char *regfile, int automode, int neednum) return (0); } -int +int m_register() { FILE *fn; @@ -1005,7 +1005,7 @@ m_register() return 0; } -int +int cat_register() { if (system("cat register.new.tmp >> register.new") == 0 && @@ -1017,7 +1017,7 @@ cat_register() return 0; } -static void +static void give_id_money(char *user_id, int money, FILE * log_fp, char *mail_title, time_t t) { char tt[TTLEN + 1] = {0}; @@ -1034,7 +1034,7 @@ give_id_money(char *user_id, int money, FILE * log_fp, char *mail_title, time_t } } -int +int give_money() { FILE *fp, *fp2; diff --git a/mbbsd/announce.c b/mbbsd/announce.c index 889c986d..5df8a9fa 100644 --- a/mbbsd/announce.c +++ b/mbbsd/announce.c @@ -1,7 +1,7 @@ -/* $Id: announce.c,v 1.14 2002/07/21 08:18:41 in2 Exp $ */ +/* $Id: announce.c,v 1.15 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" -static void +static void g_showmenu(gmenu_t * pm) { static char *mytype = "½s ¿ï µ·¸ô¤§®È"; @@ -119,7 +119,7 @@ my_open(char *path) static jmp_buf jbuf; -static void +static void isig(int sig) { longjmp(jbuf, 1); @@ -127,7 +127,7 @@ isig(int sig) #define PROXY_HOME "proxy/" -static void +static void go_proxy(char *fpath, item_t * node, int update) { char *ptr, *str, *server; @@ -209,7 +209,7 @@ go_proxy(char *fpath, item_t * node, int update) } } -static void +static void g_additem(gmenu_t * pm, item_t * myitem) { if (pm->num < MAX_ITEMS) { @@ -220,7 +220,7 @@ g_additem(gmenu_t * pm, item_t * myitem) } } -static void +static void go_menu(gmenu_t * pm, item_t * node, int update) { FILE *fp; @@ -264,7 +264,7 @@ go_menu(gmenu_t * pm, item_t * node, int update) } } -static int +static int g_searchtitle(gmenu_t * pm, int rev) { static char search_str[30] = ""; @@ -290,7 +290,7 @@ g_searchtitle(gmenu_t * pm, int rev) return pm->now; } -static void +static void g_showhelp() { clear(); @@ -314,7 +314,7 @@ g_showhelp() static char paste_fname[200]; -static void +static void load_paste() { struct stat st; @@ -343,7 +343,7 @@ static char copyfile[PATHLEN]; static char copytitle[TTLEN + 1]; static char copyowner[IDLEN + 2]; -void +void a_copyitem(char *fpath, char *title, char *owner, int mode) { strcpy(copyfile, fpath); @@ -360,7 +360,7 @@ a_copyitem(char *fpath, char *title, char *owner, int mode) #define FHSZ sizeof(fileheader_t) -static void +static void a_loadname(menu_t * pm) { char buf[PATHLEN]; @@ -372,7 +372,7 @@ a_loadname(menu_t * pm) bzero(&pm->header[len], FHSZ * (p_lines - len)); } -static void +static void a_timestamp(char *buf, time_t * time) { struct tm *pt = localtime(time); @@ -380,7 +380,7 @@ a_timestamp(char *buf, time_t * time) sprintf(buf, "%02d/%02d/%02d", pt->tm_mon + 1, pt->tm_mday, (pt->tm_year + 1900) % 100); } -static void +static void a_showmenu(menu_t * pm) { char *title, *editor; @@ -425,7 +425,7 @@ a_showmenu(menu_t * pm) "\033[31m(enter/¡÷)\033[30mŪ¨ú¸ê®Æ \033[m"); } -static int +static int a_searchtitle(menu_t * pm, int rev) { static char search_str[40] = ""; @@ -460,7 +460,7 @@ enum { NOBODY, MANAGER, SYSOP }; -static void +static void a_showhelp(int level) { clear(); @@ -491,7 +491,7 @@ a_showhelp(int level) pressanykey(); } -static int +static int AnnounceSelect() { static char xboard[20]; @@ -521,7 +521,7 @@ AnnounceSelect() return FULLUPDATE; } -void +void gem(char *maintitle, item_t * path, int update) { gmenu_t me; @@ -714,7 +714,7 @@ gem(char *maintitle, item_t * path, int update) free(me.item[ch]); } -static void +static void a_forward(char *path, fileheader_t * pitem, int mode) { fileheader_t fhdr; @@ -734,7 +734,7 @@ a_forward(char *path, fileheader_t * pitem, int mode) } } -static void +static void a_additem(menu_t * pm, fileheader_t * myheader) { char buf[PATHLEN]; @@ -759,7 +759,7 @@ a_additem(menu_t * pm, fileheader_t * myheader) #define ADDGOPHER 2 #define ADDLINK 3 -static void +static void a_newitem(menu_t * pm, int mode) { static char *mesg[4] = { @@ -874,7 +874,7 @@ a_newitem(menu_t * pm, int mode) a_additem(pm, &item); } -static void +static void a_pasteitem(menu_t * pm, int mode) { char newpath[PATHLEN]; @@ -947,7 +947,7 @@ a_pasteitem(menu_t * pm, int mode) } } -static void +static void a_appenditem(menu_t * pm, int isask) { char fname[PATHLEN]; @@ -1002,7 +1002,7 @@ a_appenditem(menu_t * pm, int isask) } } -static int +static int a_pastetagpost(menu_t * pm, int mode) { fileheader_t fhdr; @@ -1037,7 +1037,7 @@ a_pastetagpost(menu_t * pm, int mode) return ans; } -static void +static void a_moveitem(menu_t * pm) { fileheader_t *tmp; @@ -1079,7 +1079,7 @@ a_moveitem(menu_t * pm) free(tmp); } -static void +static void a_delrange(menu_t * pm) { char fname[256]; @@ -1089,7 +1089,7 @@ a_delrange(menu_t * pm) pm->num = get_num_records(fname, FHSZ); } -static void +static void a_delete(menu_t * pm) { char fpath[PATHLEN], buf[PATHLEN], cmd[PATHLEN]; @@ -1166,7 +1166,7 @@ a_delete(menu_t * pm) pm->num--; } -static void +static void a_newtitle(menu_t * pm) { char buf[PATHLEN]; @@ -1180,7 +1180,7 @@ a_newtitle(menu_t * pm) substitute_record(buf, &item, FHSZ, pm->now + 1); } } -static void +static void a_hideitem(menu_t * pm) { fileheader_t *item = &pm->header[pm->now - pm->page]; @@ -1195,7 +1195,7 @@ a_hideitem(menu_t * pm) setadir(buf, pm->path); substitute_record(buf, item, FHSZ, pm->now + 1); } -static void +static void a_editsign(menu_t * pm) { char buf[PATHLEN]; @@ -1212,7 +1212,7 @@ a_editsign(menu_t * pm) } } -static void +static void a_showname(menu_t * pm) { char buf[PATHLEN]; @@ -1257,7 +1257,7 @@ a_showname(menu_t * pm) #if 0 static char *a_title; -static void +static void atitle() { showtitle("ºëµØ¤å³¹", a_title); @@ -1267,7 +1267,7 @@ atitle() } #endif -static int +static int isvisible_man(menu_t * me) { fileheader_t *fhdr = &me->header[me->now - me->page]; @@ -1277,7 +1277,7 @@ isvisible_man(menu_t * me) return 0; return 1; } -int +int a_menu(char *maintitle, char *path, int lastlevel) { static char Fexit; @@ -1407,8 +1407,8 @@ a_menu(char *maintitle, char *path, int lastlevel) fhdr.filename, sizeof(me.header[me.now - me.page].filename)); strlcpy(me.header[me.now - me.page].owner, - cuser.userid, - sizeof(me.header[me.now - me.page].owner)); + cuser.userid, + sizeof(me.header[me.now - me.page].owner)); setadir(fpath, path); substitute_record(fpath, me.header + me.now - me.page, sizeof(fhdr), me.now + 1); @@ -1603,7 +1603,7 @@ a_menu(char *maintitle, char *path, int lastlevel) static char *mytitle = BBSNAME "§G§iÄæ"; -int +int Announce() { setutmpmode(ANNOUNCE); diff --git a/mbbsd/args.c b/mbbsd/args.c index 57e6798b..d1291176 100644 --- a/mbbsd/args.c +++ b/mbbsd/args.c @@ -1,8 +1,8 @@ -/* $Id: args.c,v 1.4 2002/07/21 08:18:41 in2 Exp $ */ +/* $Id: args.c,v 1.5 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" #ifdef HAVE_SETPROCTITLE -void +void initsetproctitle(int argc, char **argv, char **envp) { } @@ -14,7 +14,7 @@ char **Argv = NULL; /* pointer to argument vector */ char *LastArgv = NULL;/* end of argv */ extern char **environ; -void +void initsetproctitle(int argc, char **argv, char **envp) { register int i; @@ -37,7 +37,7 @@ initsetproctitle(int argc, char **argv, char **envp) LastArgv = argv[argc - 1] + strlen(argv[argc - 1]); } -static void +static void do_setproctitle(const char *cmdline) { char buf[256], *p; @@ -56,7 +56,7 @@ do_setproctitle(const char *cmdline) Argv[1] = NULL; } -void +void setproctitle(const char *format,...) { char buf[256]; diff --git a/mbbsd/bbcall.c b/mbbsd/bbcall.c index dfc6320c..c3527e01 100644 --- a/mbbsd/bbcall.c +++ b/mbbsd/bbcall.c @@ -1,4 +1,4 @@ -/* $Id: bbcall.c,v 1.6 2002/07/21 08:18:41 in2 Exp $ */ +/* $Id: bbcall.c,v 1.7 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" #define SERVER_0941 "www.chips.com.tw" @@ -21,7 +21,7 @@ #define REFER_0947 "http://web1.hoyard.com.tw/freeway/freewayi.html" #define REFER_0945 "http://203.73.181.254/call.HTM" -static void +static void pager_msg_encode(char *field, char *buf) { char *cc = field; @@ -41,7 +41,7 @@ pager_msg_encode(char *field, char *buf) *cc = 0; } -static void +static void Gettime(int flag, int *Year, int *Month, int *Day, int *Hour, int *Minute) { @@ -69,7 +69,7 @@ Gettime(int flag, int *Year, int *Month, int *Day, int *Hour, #define hpressanykey(a) {move(22, 0); prints(a); pressanykey();} -static int +static int Connect(char *s, char *server) { FILE *fp = fopen(BBSHOME "/log/bbcall.log", "a"); @@ -262,3 +262,7 @@ int main_bbcall() { return 0; } + + + + diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index 46222bed..a706ff0c 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -1,7 +1,7 @@ -/* $Id: bbs.c,v 1.64 2002/07/21 08:18:41 in2 Exp $ */ +/* $Id: bbs.c,v 1.65 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" -static void +static void mail_by_link(char *owner, char *title, char *path) { char genbuf[200]; @@ -19,7 +19,7 @@ mail_by_link(char *owner, char *title, char *path) } -void +void anticrosspost() { char buf[200]; @@ -39,7 +39,7 @@ anticrosspost() } /* Heat CharlieL */ -int +int save_violatelaw() { char buf[128], ok[3]; @@ -98,7 +98,7 @@ save_violatelaw() static time_t board_note_time; static char *brd_title; -void +void set_board() { boardheader_t *bp; @@ -119,7 +119,7 @@ set_board() currmode |= MODE_POST; } -static void +static void readtitle() { showtitle(currBM, brd_title); @@ -128,7 +128,7 @@ readtitle() " \033[m"); } -static void +static void readdoent(int num, fileheader_t * ent) { int type, uid; @@ -184,25 +184,25 @@ readdoent(int num, fileheader_t * ent) title); } -int +int cmpfilename(fileheader_t * fhdr) { return (!strcmp(fhdr->filename, currfile)); } -int +int cmpfmode(fileheader_t * fhdr) { return (fhdr->filemode & currfmode); } -int +int cmpfowner(fileheader_t * fhdr) { return !strcasecmp(fhdr->owner, currowner); } -int +int whereami(int ent, fileheader_t * fhdr, char *direct) { boardheader_t *bh, *p[32], *root; @@ -229,7 +229,7 @@ whereami(int ent, fileheader_t * fhdr, char *direct) return FULLUPDATE; } -static int +static int substitute_check(fileheader_t * fhdr) { fileheader_t hdr; @@ -250,7 +250,7 @@ substitute_check(fileheader_t * fhdr) } return num; } -static int +static int do_select(int ent, fileheader_t * fhdr, char *direct) { char bname[20]; @@ -295,7 +295,7 @@ do_select(int ent, fileheader_t * fhdr, char *direct) /* ----------------------------------------------------- */ /* §ï¨} innbbsd Âà¥X«H¥ó¡B³s½u¬å«H¤§³B²zµ{§Ç */ /* ----------------------------------------------------- */ -void +void outgo_post(fileheader_t * fh, char *board) { FILE *foo; @@ -307,7 +307,7 @@ outgo_post(fileheader_t * fh, char *board) } } -static void +static void cancelpost(fileheader_t * fh, int by_BM) { FILE *fin, *fout; @@ -352,7 +352,7 @@ cancelpost(fileheader_t * fh, int by_BM) /* ----------------------------------------------------- */ /* µoªí¡B¦^À³¡B½s¿è¡BÂà¿ý¤å³¹ */ /* ----------------------------------------------------- */ -void +void do_reply_title(int row, char *title) { char genbuf[200]; @@ -369,7 +369,7 @@ do_reply_title(int row, char *title) getdata(++row, 0, "¼ÐÃD¡G", save_title, TTLEN, DOECHO); } -static void +static void do_unanonymous_post(char *fpath) { fileheader_t mhdr; @@ -394,7 +394,7 @@ static time_t last_post_time = 0; static time_t water_counts = 0; #endif -static int +static int do_general() { fileheader_t postfile; @@ -586,7 +586,7 @@ do_general() return FULLUPDATE; } -int +int do_post() { boardheader_t *bp; @@ -599,7 +599,7 @@ do_post() return 0; } -static void +static void do_generalboardreply(fileheader_t * fhdr) { char genbuf[200]; @@ -622,7 +622,7 @@ do_generalboardreply(fileheader_t * fhdr) *quote_file = 0; } -int +int getindex(char *fpath, char *fname, int size) { int fd, now = 0; @@ -641,7 +641,7 @@ getindex(char *fpath, char *fname, int size) return 0; } -int +int invalid_brdname(char *brd) { register char ch; @@ -656,7 +656,7 @@ invalid_brdname(char *brd) return 0; } -static int +static int b_call_in(int ent, fileheader_t * fhdr, char *direct) { userinfo_t *u = search_ulist(searchuser(fhdr->owner)); @@ -669,7 +669,7 @@ b_call_in(int ent, fileheader_t * fhdr, char *direct) return DONOTHING; } -static void +static void do_reply(fileheader_t * fhdr) { boardheader_t *bp; @@ -680,7 +680,7 @@ do_reply(fileheader_t * fhdr) do_generalboardreply(fhdr); } -static int +static int reply_post(int ent, fileheader_t * fhdr, char *direct) { if (!(currmode & MODE_POST)) @@ -692,7 +692,7 @@ reply_post(int ent, fileheader_t * fhdr, char *direct) return FULLUPDATE; } -static int +static int edit_post(int ent, fileheader_t * fhdr, char *direct) { char fpath[80], fpath0[80]; @@ -751,7 +751,7 @@ edit_post(int ent, fileheader_t * fhdr, char *direct) #define UPDATE_USEREC (currmode |= MODE_DIRTY) -static int +static int cross_post(int ent, fileheader_t * fhdr, char *direct) { char xboard[20], fname[80], xfpath[80], xtitle[80], inputbuf[10]; @@ -825,1140 +825,1213 @@ cross_post(int ent, fileheader_t * fhdr, char *direct) xfile.filemode = FILE_LOCAL; } setbfile(fname, currboard, fhdr->filename); - //if (ent) { - xptr = fopen(xfpath, "w"); + xptr = fopen(xfpath, "w"); + + strlcpy(save_title, xfile.title, sizeof(save_title)); + strlcpy(xfpath, currboard, sizeof(xfpath)); + strlcpy(currboard, xboard, sizeof(currboard)); + write_header(xptr); + strlcpy(currboard, xfpath, sizeof(currboard)); + + fprintf(xptr, "¡° [¥»¤åÂà¿ý¦Û %s ¬ÝªO]\n\n", currboard); + + b_suckinfile(xptr, fname); + addsignature(xptr, 0); + fclose(xptr); + /* + * Cross fs¦³°ÝÃD } else { unlink(xfpath); link(fname, xfpath); } + */ + setbdir(fname, xboard); + append_record(fname, &xfile, sizeof(xfile)); + bp = getbcache(getbnum(xboard)); + if (!xfile.filemode && !(bp->brdattr && BRD_NOTRAN)) + outgo_post(&xfile, xboard); + setbtotal(getbnum(xboard)); + cuser.numposts++; + UPDATE_USEREC; + outs("¤å³¹Âà¿ý§¹¦¨"); + pressanykey(); + currmode = currmode0; + } + return FULLUPDATE; +} +static int +read_post(int ent, fileheader_t * fhdr, char *direct) +{ + char genbuf[200]; + int more_result; - strlcpy(save_title, xfile.title, sizeof(save_title)); - strlcpy(xfpath, currboard, sizeof(xfpath)); - strlcpy(currboard, xboard, sizeof(currboard)); - write_header(xptr); - strlcpy(currboard, xfpath, sizeof(currboard)); + if (fhdr->owner[0] == '-') + return DONOTHING; - fprintf(xptr, "¡° [¥»¤åÂà¿ý¦Û %s ¬ÝªO]\n\n", currboard); + setdirpath(genbuf, direct, fhdr->filename); - b_suckinfile(xptr, fname); - addsignature(xptr, 0); - fclose(xptr); - /* - * Cross fs¦³°ÝÃD } else { unlink(xfpath); link(fname, xfpath); } - */ - setbdir(fname, xboard); - append_record(fname, &xfile, sizeof(xfile)); - bp = getbcache(getbnum(xboard)); - if (!xfile.filemode && !(bp->brdattr && BRD_NOTRAN)) - outgo_post(&xfile, xboard); - setbtotal(getbnum(xboard)); - cuser.numposts++; - UPDATE_USEREC; - outs("¤å³¹Âà¿ý§¹¦¨"); - pressanykey(); - currmode = currmode0; + if ((more_result = more(genbuf, YEA)) == -1) + return DONOTHING; + + brc_addlist(fhdr->filename); + strncpy(currtitle, subject(fhdr->title), TTLEN); + strncpy(currowner, subject(fhdr->owner), IDLEN + 2); + + switch (more_result) { + case 1: + return READ_PREV; + case 2: + return RELATE_PREV; + case 3: + return READ_NEXT; + case 4: + return RELATE_NEXT; + case 5: + return RELATE_FIRST; + case 6: + return FULLUPDATE; + case 7: + case 8: + if ((currmode & MODE_POST)) { + strlcpy(quote_file, genbuf, sizeof(quote_file)); + do_reply(fhdr); + *quote_file = 0; } return FULLUPDATE; + case 9: + return 'A'; + case 10: + return 'a'; + case 11: + return '/'; + case 12: + return '?'; } - static int read_post(int ent, fileheader_t * fhdr, char *direct){ - char genbuf[200]; - int more_result; - - if (fhdr->owner[0] == '-') - return DONOTHING; - - setdirpath(genbuf, direct, fhdr->filename); - - if ((more_result = more(genbuf, YEA)) == -1) - return DONOTHING; - - brc_addlist(fhdr->filename); - strncpy(currtitle, subject(fhdr->title), TTLEN); - strncpy(currowner, subject(fhdr->owner), IDLEN + 2); - - switch (more_result) { - case 1: - return READ_PREV; - case 2: - return RELATE_PREV; - case 3: - return READ_NEXT; - case 4: - return RELATE_NEXT; - case 5: - return RELATE_FIRST; - case 6: - return FULLUPDATE; - case 7: - case 8: - if ((currmode & MODE_POST)) { - strlcpy(quote_file, genbuf, sizeof(quote_file)); - do_reply(fhdr); - *quote_file = 0; - } - return FULLUPDATE; - case 9: - return 'A'; - case 10: - return 'a'; - case 11: - return '/'; - case 12: - return '?'; - } - outmsg("\033[34;46m ¾\\Ū¤å³¹ \033[31;47m (R/Y)\033[30m¦^«H \033[31m" + outmsg("\033[34;46m ¾\\Ū¤å³¹ \033[31;47m (R/Y)\033[30m¦^«H \033[31m" "(=[]<>)\033[30m¬ÛÃö¥DÃD \033[31m(¡ô¡õ)\033[30m¤W¤U«Ê \033[31m(¡ö)" - "\033[30mÂ÷¶} \033[m"); + "\033[30mÂ÷¶} \033[m"); - switch (egetch()) { - case 'q': - case 'Q': - case KEY_LEFT: - break; + switch (egetch()) { + case 'q': + case 'Q': + case KEY_LEFT: + break; - case ' ': - case KEY_RIGHT: - case KEY_DOWN: - case KEY_PGDN: - case 'n': - case Ctrl('N'): - return READ_NEXT; + case ' ': + case KEY_RIGHT: + case KEY_DOWN: + case KEY_PGDN: + case 'n': + case Ctrl('N'): + return READ_NEXT; - case KEY_UP: - case 'p': - case Ctrl('P'): - case KEY_PGUP: - return READ_PREV; + case KEY_UP: + case 'p': + case Ctrl('P'): + case KEY_PGUP: + return READ_PREV; - case '=': - return RELATE_FIRST; + case '=': + return RELATE_FIRST; - case ']': - case 't': - return RELATE_NEXT; + case ']': + case 't': + return RELATE_NEXT; - case '[': - return RELATE_PREV; + case '[': + return RELATE_PREV; - case '.': - case '>': - return THREAD_NEXT; + case '.': + case '>': + return THREAD_NEXT; - case ',': - case '<': - return THREAD_PREV; + case ',': + case '<': + return THREAD_PREV; - case Ctrl('C'): - cal(); - return FULLUPDATE; - break; + case Ctrl('C'): + cal(); + return FULLUPDATE; + break; - case Ctrl('I'): - t_idle(); - return FULLUPDATE; - case 'y': - case 'r': - case 'R': - case 'Y': - if ((currmode & MODE_POST)) { - strlcpy(quote_file, genbuf, sizeof(quote_file)); - do_reply(fhdr); - *quote_file = 0; - } - } + case Ctrl('I'): + t_idle(); return FULLUPDATE; + case 'y': + case 'r': + case 'R': + case 'Y': + if ((currmode & MODE_POST)) { + strlcpy(quote_file, genbuf, sizeof(quote_file)); + do_reply(fhdr); + *quote_file = 0; + } } + return FULLUPDATE; +} - /* ----------------------------------------------------- */ - /* ±Ä¶°ºëµØ°Ï */ - /* ----------------------------------------------------- */ - static int b_man() { - char buf[64]; - - setapath(buf, currboard); - if ((currmode & MODE_BOARD) || HAS_PERM(PERM_SYSOP)) { - char genbuf[128]; - int fd; - sprintf(genbuf, "%s/.rebuild", buf); - if ((fd = open(genbuf, O_CREAT, 0640)) > 0) - close(fd); - } - return a_menu(currboard, buf, HAS_PERM(PERM_ALLBOARD) ? 2 : - (currmode & MODE_BOARD ? 1 : 0)); +/* ----------------------------------------------------- */ +/* ±Ä¶°ºëµØ°Ï */ +/* ----------------------------------------------------- */ +static int +b_man() +{ + char buf[64]; + + setapath(buf, currboard); + if ((currmode & MODE_BOARD) || HAS_PERM(PERM_SYSOP)) { + char genbuf[128]; + int fd; + sprintf(genbuf, "%s/.rebuild", buf); + if ((fd = open(genbuf, O_CREAT, 0640)) > 0) + close(fd); } + return a_menu(currboard, buf, HAS_PERM(PERM_ALLBOARD) ? 2 : + (currmode & MODE_BOARD ? 1 : 0)); +} #ifndef NO_GAMBLE - void stop_gamble() { - boardheader_t *bp = getbcache(currbid); - char fn_ticket[128], fn_ticket_end[128]; - if (!bp->endgamble || bp->endgamble > now) - return; - - setbfile(fn_ticket, currboard, FN_TICKET); - setbfile(fn_ticket_end, currboard, FN_TICKET_END); +void +stop_gamble() +{ + boardheader_t *bp = getbcache(currbid); + char fn_ticket[128], fn_ticket_end[128]; + if (!bp->endgamble || bp->endgamble > now) + return; + + setbfile(fn_ticket, currboard, FN_TICKET); + setbfile(fn_ticket_end, currboard, FN_TICKET_END); + + rename(fn_ticket, fn_ticket_end); + if (bp->endgamble) { + bp->endgamble = 0; + substitute_record(fn_board, bp, sizeof(boardheader_t), currbid); + } +} +static int +join_gamble(int ent, fileheader_t * fhdr, char *direct) +{ + if (!HAS_PERM(PERM_LOGINOK)) + return DONOTHING; + stop_gamble(); + ticket(currbid); + return FULLUPDATE; +} +static int +hold_gamble(int ent, fileheader_t * fhdr, char *direct) +{ + char fn_ticket[128], fn_ticket_end[128], genbuf[128], msg[256] = "", + yn[10] = ""; + boardheader_t *bp = getbcache(currbid); + int i; + FILE *fp = NULL; - rename(fn_ticket, fn_ticket_end); - if (bp->endgamble) { + if (!(currmode & MODE_BOARD)) + return 0; + setbfile(fn_ticket, currboard, FN_TICKET); + setbfile(fn_ticket_end, currboard, FN_TICKET_END); + setbfile(genbuf, currboard, FN_TICKET_LOCK); + if (dashf(fn_ticket)) { + getdata(b_lines - 1, 0, "¤w¸g¦³Á|¿ì½ä½L, " + "¬O§_n [°±¤î¤Uª`]?(N/y)¡G", yn, 3, LCECHO); + if (yn[0] != 'y') + return FULLUPDATE; + rename(fn_ticket, fn_ticket_end); + if (bp->endgamble) { bp->endgamble = 0; substitute_record(fn_board, bp, sizeof(boardheader_t), currbid); + } - } - static int join_gamble(int ent, fileheader_t * fhdr, char *direct){ - if (!HAS_PERM(PERM_LOGINOK)) - return DONOTHING; - stop_gamble(); - ticket(currbid); return FULLUPDATE; } - static int hold_gamble(int ent, fileheader_t * fhdr, char *direct){ - char fn_ticket[128], fn_ticket_end[128], genbuf[128], msg[256] = "", - yn[10] = ""; - boardheader_t *bp = getbcache(currbid); - int i; - FILE *fp = NULL; - - if (!(currmode & MODE_BOARD)) - return 0; - setbfile(fn_ticket, currboard, FN_TICKET); - setbfile(fn_ticket_end, currboard, FN_TICKET_END); - setbfile(genbuf, currboard, FN_TICKET_LOCK); - if (dashf(fn_ticket)) { - getdata(b_lines - 1, 0, "¤w¸g¦³Á|¿ì½ä½L, " - "¬O§_n [°±¤î¤Uª`]?(N/y)¡G", yn, 3, LCECHO); - if (yn[0] != 'y') - return FULLUPDATE; - rename(fn_ticket, fn_ticket_end); - if (bp->endgamble) { - bp->endgamble = 0; - substitute_record(fn_board, bp, sizeof(boardheader_t), currbid); - - } - return FULLUPDATE; - } - if (dashf(fn_ticket_end)) { - getdata(b_lines - 1, 0, "¤w¸g¦³Á|¿ì½ä½L, " - "¬O§_n [¶}¼ú/¨ú®ø]?(N/y)¡G", yn, 3, LCECHO); - if (yn[0] != 'y') - return FULLUPDATE; - openticket(currbid); - return FULLUPDATE; - } else if (dashf(genbuf)) { - move(b_lines - 1, 0); - prints(" ¥Ø«e¨t²Î¥¿¦b³B²z¶}¼ú¨Æ©y, ½Ðµ²ªG¥XÄl«á¦AÁ|¿ì......."); - pressanykey(); - return FULLUPDATE; - } - getdata(b_lines - 2, 0, "nÁ|¿ì½ä½L (N/y):", yn, 3, LCECHO); + if (dashf(fn_ticket_end)) { + getdata(b_lines - 1, 0, "¤w¸g¦³Á|¿ì½ä½L, " + "¬O§_n [¶}¼ú/¨ú®ø]?(N/y)¡G", yn, 3, LCECHO); if (yn[0] != 'y') return FULLUPDATE; - getdata(b_lines - 1, 0, "½ä¤°»ò? ½Ð¿é¤J¥DÃD (¿é¤J«á½s¿è¤º®e):", - msg, 20, DOECHO); - if (msg[0] == 0 || - vedit(fn_ticket_end, NA, NULL) < 0) - return FULLUPDATE; + openticket(currbid); + return FULLUPDATE; + } else if (dashf(genbuf)) { + move(b_lines - 1, 0); + prints(" ¥Ø«e¨t²Î¥¿¦b³B²z¶}¼ú¨Æ©y, ½Ðµ²ªG¥XÄl«á¦AÁ|¿ì......."); + pressanykey(); + return FULLUPDATE; + } + getdata(b_lines - 2, 0, "nÁ|¿ì½ä½L (N/y):", yn, 3, LCECHO); + if (yn[0] != 'y') + return FULLUPDATE; + getdata(b_lines - 1, 0, "½ä¤°»ò? ½Ð¿é¤J¥DÃD (¿é¤J«á½s¿è¤º®e):", + msg, 20, DOECHO); + if (msg[0] == 0 || + vedit(fn_ticket_end, NA, NULL) < 0) + return FULLUPDATE; - clear(); - showtitle("Á|¿ì½ä½L", BBSNAME); - setbfile(genbuf, currboard, FN_TICKET_ITEMS); + clear(); + showtitle("Á|¿ì½ä½L", BBSNAME); + setbfile(genbuf, currboard, FN_TICKET_ITEMS); - //sprintf(genbuf, "%s/" FN_TICKET_ITEMS, direct); + //sprintf(genbuf, "%s/" FN_TICKET_ITEMS, direct); - if (!(fp = fopen(genbuf, "w"))) - return FULLUPDATE; - do { - getdata(2, 0, "¿é¤J±m²¼»ù®æ (»ù®æ:10-10000):", yn, 6, LCECHO); - i = atoi(yn); - } while (i < 10 || i > 10000); - fprintf(fp, "%d\n", i); - if (!getdata(3, 0, "³]©w¦Û°Ê«Ê½L®É¶¡?(Y/n)", yn, 3, LCECHO) || yn[0] != 'n') { - bp->endgamble = gettime(4, now); - substitute_record(fn_board, bp, sizeof(boardheader_t), currbid); - } - move(6, 0); - sprintf(genbuf, "½Ð¨ì %s ªO «ö'f'°Ñ»P½ä³Õ!\n\n¤@±i %d Ptt¹ô, ³o¬O%sªº½ä³Õ\n%s%s", - currboard, - i, i < 100 ? "¤p½ä¦¡" : i < 500 ? "¥¥Á¯Å" : - i < 1000 ? "¶Q±Ú¯Å" : i < 5000 ? "´I»¨¯Å" : "¶É®a¿º²£", - bp->endgamble ? "½ä½Lµ²§ô®É¶¡: " : "", - bp->endgamble ? Cdate(&bp->endgamble) : "" - ); - strcat(msg, genbuf); - prints("½Ð¨Ì¦¸¿é¤J±m²¼¦WºÙ, »Ý´£¨Ñ2~8¶µ. (¥¼º¡¤K¶µ, ¿é¤Jª½±µ«öenter)\n"); - for (i = 0; i < 8; i++) { - sprintf(yn, " %d)", i + 1); - getdata(7 + i, 0, yn, genbuf, 9, DOECHO); - if (!genbuf[0] && i > 1) - break; - fprintf(fp, "%s\n", genbuf); - } - fclose(fp); - move(8 + i, 0); - prints("½ä½L³]©w§¹¦¨"); - sprintf(genbuf, "[¤½§i] %s ªO ¶}©l½ä³Õ!", currboard); - post_msg(currboard, genbuf, msg, cuser.userid); - post_msg("Record", genbuf + 7, msg, "[°¨¸ô±´¤l]"); - /* Tim ±±¨îCS, ¥H§K¥¿¦bª±ªºuser§â¸ê®Æ¤w¸g¼g¶i¨Ó */ - rename(fn_ticket_end, fn_ticket); - //³] © w § ¹¤~§âÀɦW § ï¹L ¨ Ó - - return FULLUPDATE; + if (!(fp = fopen(genbuf, "w"))) + return FULLUPDATE; + do { + getdata(2, 0, "¿é¤J±m²¼»ù®æ (»ù®æ:10-10000):", yn, 6, LCECHO); + i = atoi(yn); + } while (i < 10 || i > 10000); + fprintf(fp, "%d\n", i); + if (!getdata(3, 0, "³]©w¦Û°Ê«Ê½L®É¶¡?(Y/n)", yn, 3, LCECHO) || yn[0] != 'n') { + bp->endgamble = gettime(4, now); + substitute_record(fn_board, bp, sizeof(boardheader_t), currbid); } + move(6, 0); + sprintf(genbuf, "½Ð¨ì %s ªO «ö'f'°Ñ»P½ä³Õ!\n\n¤@±i %d Ptt¹ô, ³o¬O%sªº½ä³Õ\n%s%s", + currboard, + i, i < 100 ? "¤p½ä¦¡" : i < 500 ? "¥¥Á¯Å" : + i < 1000 ? "¶Q±Ú¯Å" : i < 5000 ? "´I»¨¯Å" : "¶É®a¿º²£", + bp->endgamble ? "½ä½Lµ²§ô®É¶¡: " : "", + bp->endgamble ? Cdate(&bp->endgamble) : "" + ); + strcat(msg, genbuf); + prints("½Ð¨Ì¦¸¿é¤J±m²¼¦WºÙ, »Ý´£¨Ñ2~8¶µ. (¥¼º¡¤K¶µ, ¿é¤Jª½±µ«öenter)\n"); + for (i = 0; i < 8; i++) { + sprintf(yn, " %d)", i + 1); + getdata(7 + i, 0, yn, genbuf, 9, DOECHO); + if (!genbuf[0] && i > 1) + break; + fprintf(fp, "%s\n", genbuf); + } + fclose(fp); + move(8 + i, 0); + prints("½ä½L³]©w§¹¦¨"); + sprintf(genbuf, "[¤½§i] %s ªO ¶}©l½ä³Õ!", currboard); + post_msg(currboard, genbuf, msg, cuser.userid); + post_msg("Record", genbuf + 7, msg, "[°¨¸ô±´¤l]"); + /* Tim ±±¨îCS, ¥H§K¥¿¦bª±ªºuser§â¸ê®Æ¤w¸g¼g¶i¨Ó */ + rename(fn_ticket_end, fn_ticket); + /* ³]©w§¹¤~§âÀɦW§ï¹L¨Ó */ + + return FULLUPDATE; +} #endif - static int cite_post(int ent, fileheader_t * fhdr, char *direct){ - char fpath[256]; - char title[TTLEN + 1]; - - setbfile(fpath, currboard, fhdr->filename); - strlcpy(title, "¡º ", sizeof(title)); - strlcpy(title + 3, fhdr->title, TTLEN - 3); - title[TTLEN] = '\0'; - a_copyitem(fpath, title, 0, 1); - b_man(); - return FULLUPDATE; - } +static int +cite_post(int ent, fileheader_t * fhdr, char *direct) +{ + char fpath[256]; + char title[TTLEN + 1]; + + setbfile(fpath, currboard, fhdr->filename); + strlcpy(title, "¡º ", sizeof(title)); + strlcpy(title + 3, fhdr->title, TTLEN - 3); + title[TTLEN] = '\0'; + a_copyitem(fpath, title, 0, 1); + b_man(); + return FULLUPDATE; +} - int edit_title(int ent, fileheader_t * fhdr, char *direct){ - char genbuf[200]; - fileheader_t tmpfhdr = *fhdr; - int dirty = 0; +int +edit_title(int ent, fileheader_t * fhdr, char *direct) +{ + char genbuf[200]; + fileheader_t tmpfhdr = *fhdr; + int dirty = 0; - if (currmode & MODE_BOARD || !strcmp(cuser.userid, fhdr->owner)) { - if (getdata(b_lines - 1, 0, "¼ÐÃD¡G", genbuf, TTLEN, DOECHO)) { - strlcpy(tmpfhdr.title, genbuf, sizeof(tmpfhdr.title)); - dirty++; - } + if (currmode & MODE_BOARD || !strcmp(cuser.userid, fhdr->owner)) { + if (getdata(b_lines - 1, 0, "¼ÐÃD¡G", genbuf, TTLEN, DOECHO)) { + strlcpy(tmpfhdr.title, genbuf, sizeof(tmpfhdr.title)); + dirty++; } - if (HAS_PERM(PERM_SYSOP)) { - if (getdata(b_lines - 1, 0, "§@ªÌ¡G", genbuf, IDLEN + 2, DOECHO)) { - strlcpy(tmpfhdr.owner, genbuf, sizeof(tmpfhdr.owner)); - dirty++; - } - if (getdata(b_lines - 1, 0, "¤é´Á¡G", genbuf, 6, DOECHO)) { - sprintf(tmpfhdr.date, "%.5s", genbuf); - dirty++; - } + } + if (HAS_PERM(PERM_SYSOP)) { + if (getdata(b_lines - 1, 0, "§@ªÌ¡G", genbuf, IDLEN + 2, DOECHO)) { + strlcpy(tmpfhdr.owner, genbuf, sizeof(tmpfhdr.owner)); + dirty++; } - if (currmode & MODE_BOARD || !strcmp(cuser.userid, fhdr->owner)) { - getdata(b_lines - 1, 0, "½T©w(Y/N)?[n] ", genbuf, 3, DOECHO); - if ((genbuf[0] == 'y' || genbuf[0] == 'Y') && dirty) { - *fhdr = tmpfhdr; - substitute_record(direct, fhdr, sizeof(*fhdr), ent); - /* rocker.011018: ³o¸ÌÀ³¸Ó§ï¦¨¥Îreferenceªº¤è¦¡¨ú±oì¨ÓªºÀÉ®× */ - substitute_check(fhdr); - touchdircache(currbid); - } - return FULLUPDATE; + if (getdata(b_lines - 1, 0, "¤é´Á¡G", genbuf, 6, DOECHO)) { + sprintf(tmpfhdr.date, "%.5s", genbuf); + dirty++; } - return DONOTHING; } - - static int solve_post(int ent, fileheader_t * fhdr, char *direct){ - if (HAS_PERM(PERM_SYSOP)) { - fhdr->filemode ^= FILE_SOLVED; + if (currmode & MODE_BOARD || !strcmp(cuser.userid, fhdr->owner)) { + getdata(b_lines - 1, 0, "½T©w(Y/N)?[n] ", genbuf, 3, DOECHO); + if ((genbuf[0] == 'y' || genbuf[0] == 'Y') && dirty) { + *fhdr = tmpfhdr; substitute_record(direct, fhdr, sizeof(*fhdr), ent); + /* rocker.011018: ³o¸ÌÀ³¸Ó§ï¦¨¥Îreferenceªº¤è¦¡¨ú±oì¨ÓªºÀÉ®× */ + substitute_check(fhdr); touchdircache(currbid); - return PART_REDRAW; } - return DONOTHING; + return FULLUPDATE; } + return DONOTHING; +} - static int recommend_cancel(int ent, fileheader_t * fhdr, char *direct){ - char yn[5]; - if (!(currmode & MODE_BOARD)) - return DONOTHING; - getdata(b_lines - 1, 0, "½T©wn±ÀÂËÂk¹s(Y/N)?[n] ", yn, 5, LCECHO); - if (yn[0] != 'y') - return FULLUPDATE; - fhdr->recommend = 0; - - substitute_record(direct, fhdr, sizeof(*fhdr), ent); - substitute_check(fhdr); - touchdircache(currbid); - return FULLUPDATE; +static int +solve_post(int ent, fileheader_t * fhdr, char *direct) +{ + if (HAS_PERM(PERM_SYSOP)) { + fhdr->filemode ^= FILE_SOLVED; + substitute_record(direct, fhdr, sizeof(*fhdr), ent); + touchdircache(currbid); + return PART_REDRAW; } - static int recommend(int ent, fileheader_t * fhdr, char *direct){ - struct tm *ptime = localtime(&now); - char buf[200], path[200], yn[5]; - boardheader_t *bp; - bp = getbcache(currbid); - - if (!(currmode & MODE_POST) || !strcmp(fhdr->owner, cuser.userid) || - bp->brdattr & BRD_VOTEBOARD) { - move(b_lines - 1, 0); - prints("±z¦]Åv¤£¨¬µLªk±ÀÂË ©Î ¤£¯à±ÀÂ˦ۤvªº¤å³¹!"); - pressanykey(); - return FULLUPDATE; - } - if (fhdr->recommend > 9 || fhdr->recommend < 0) - //¼È®É©Êªºcode ì¨Ó¦³È¨ú®ø - fhdr->recommend = 0; - - if (!(currmode & MODE_BOARD) && getuser(cuser.userid) && - now - xuser.recommend < 60) { - move(b_lines - 1, 0); - prints("Â÷¤W¦¸±ÀÂˮɶ¡¤ÓªñÅo, ½Ð¦hªáÂI®É¶¡¥J²Ó¾\\Ū¤å³¹!"); - pressanykey(); - return FULLUPDATE; - } - if (!getdata(b_lines - 2, 0, "±ÀÂË»y:", path, 40, DOECHO) || - !getdata(b_lines - 1, 0, "½T©wn±ÀÂË, ½Ð¥J²Ó¦Ò¼{(Y/N)?[n] ", yn, 5, LCECHO) - || yn[0] != 'y') - return FULLUPDATE; + return DONOTHING; +} - sprintf(buf, - "\033[1;31m¡÷ \033[33m%s\033[m\033[33m:%s\033[m%*s±ÀÂ˦Û:%s %02d/%02d\n", - cuser.userid, path, - 45 - strlen(cuser.userid) - strlen(path), " ", fromhost, - ptime->tm_mon + 1, ptime->tm_mday); - setdirpath(path, direct, fhdr->filename); - log_file(path, buf); - if (fhdr->recommend < 9) { - fhdr->recommend++; - cuser.recommend = now; - passwd_update(usernum, &cuser); - substitute_record(direct, fhdr, sizeof(*fhdr), ent); - substitute_check(fhdr); - touchdircache(currbid); - } +static int +recommend_cancel(int ent, fileheader_t * fhdr, char *direct) +{ + char yn[5]; + if (!(currmode & MODE_BOARD)) + return DONOTHING; + getdata(b_lines - 1, 0, "½T©wn±ÀÂËÂk¹s(Y/N)?[n] ", yn, 5, LCECHO); + if (yn[0] != 'y') + return FULLUPDATE; + fhdr->recommend = 0; + + substitute_record(direct, fhdr, sizeof(*fhdr), ent); + substitute_check(fhdr); + touchdircache(currbid); + return FULLUPDATE; +} +static int +recommend(int ent, fileheader_t * fhdr, char *direct) +{ + struct tm *ptime = localtime(&now); + char buf[200], path[200], yn[5]; + boardheader_t *bp; + bp = getbcache(currbid); + + if (!(currmode & MODE_POST) || !strcmp(fhdr->owner, cuser.userid) || + bp->brdattr & BRD_VOTEBOARD) { + move(b_lines - 1, 0); + prints("±z¦]Åv¤£¨¬µLªk±ÀÂË ©Î ¤£¯à±ÀÂ˦ۤvªº¤å³¹!"); + pressanykey(); return FULLUPDATE; } - static int mark_post(int ent, fileheader_t * fhdr, char *direct){ + if (fhdr->recommend > 9 || fhdr->recommend < 0) + /* ¼È®É©Êªº code ì¨Ó¦³È¨ú®ø */ + fhdr->recommend = 0; - if (!(currmode & MODE_BOARD)) - return DONOTHING; + if (!(currmode & MODE_BOARD) && getuser(cuser.userid) && + now - xuser.recommend < 60) { + move(b_lines - 1, 0); + prints("Â÷¤W¦¸±ÀÂˮɶ¡¤ÓªñÅo, ½Ð¦hªáÂI®É¶¡¥J²Ó¾\\Ū¤å³¹!"); + pressanykey(); + return FULLUPDATE; + } + if (!getdata(b_lines - 2, 0, "±ÀÂË»y:", path, 40, DOECHO) || + !getdata(b_lines - 1, 0, "½T©wn±ÀÂË, ½Ð¥J²Ó¦Ò¼{(Y/N)?[n] ", yn, 5, LCECHO) + || yn[0] != 'y') + return FULLUPDATE; - fhdr->filemode ^= FILE_MARKED; + sprintf(buf, + "\033[1;31m¡÷ \033[33m%s\033[m\033[33m:%s\033[m%*s±ÀÂ˦Û:%s %02d/%02d\n", + cuser.userid, path, + 45 - strlen(cuser.userid) - strlen(path), " ", fromhost, + ptime->tm_mon + 1, ptime->tm_mday); + setdirpath(path, direct, fhdr->filename); + log_file(path, buf); + if (fhdr->recommend < 9) { + fhdr->recommend++; + cuser.recommend = now; + passwd_update(usernum, &cuser); substitute_record(direct, fhdr, sizeof(*fhdr), ent); substitute_check(fhdr); touchdircache(currbid); - return PART_REDRAW; } + return FULLUPDATE; +} +static int +mark_post(int ent, fileheader_t * fhdr, char *direct) +{ + + if (!(currmode & MODE_BOARD)) + return DONOTHING; + + fhdr->filemode ^= FILE_MARKED; + substitute_record(direct, fhdr, sizeof(*fhdr), ent); + substitute_check(fhdr); + touchdircache(currbid); + return PART_REDRAW; +} - int del_range(int ent, fileheader_t * fhdr, char *direct){ - char num1[8], num2[8]; - int inum1, inum2; - boardheader_t *bp; - bp = getbcache(currbid); +int +del_range(int ent, fileheader_t * fhdr, char *direct) +{ + char num1[8], num2[8]; + int inum1, inum2; + boardheader_t *bp; + bp = getbcache(currbid); - /* rocker.011018: ¦ê±µ¼Ò¦¡¤UÁÙ¬O¤£¤¹³\§R°£¤ñ¸û¦n */ - if (currmode & MODE_SELECT) { - outmsg("½Ð¥ý¦^¨ì¥¿±`¼Ò¦¡«á¦A¶i¦æ§R°£..."); + /* rocker.011018: ¦ê±µ¼Ò¦¡¤UÁÙ¬O¤£¤¹³\§R°£¤ñ¸û¦n */ + if (currmode & MODE_SELECT) { + outmsg("½Ð¥ý¦^¨ì¥¿±`¼Ò¦¡«á¦A¶i¦æ§R°£..."); + refresh(); + /* safe_sleep(1); */ + return FULLUPDATE; + } + if (strcmp(bp->brdname, "Security") == 0) + return DONOTHING; + if ((currstat != READING) || (currmode & MODE_BOARD)) { + getdata(1, 0, "[³]©w§R°£½d³ò] °_ÂI¡G", num1, 5, DOECHO); + inum1 = atoi(num1); + if (inum1 <= 0) { + outmsg("°_ÂI¦³»~"); refresh(); /* safe_sleep(1); */ return FULLUPDATE; } - if (strcmp(bp->brdname, "Security") == 0) - return DONOTHING; - if ((currstat != READING) || (currmode & MODE_BOARD)) { - getdata(1, 0, "[³]©w§R°£½d³ò] °_ÂI¡G", num1, 5, DOECHO); - inum1 = atoi(num1); - if (inum1 <= 0) { - outmsg("°_ÂI¦³»~"); - refresh(); - /* safe_sleep(1); */ - return FULLUPDATE; - } - getdata(1, 28, "²×ÂI¡G", num2, 5, DOECHO); - inum2 = atoi(num2); - if (inum2 < inum1) { - outmsg("²×ÂI¦³»~"); - refresh(); - /* safe_sleep(1); */ - return FULLUPDATE; - } - getdata(1, 48, msg_sure_ny, num1, 3, LCECHO); - if (*num1 == 'y') { - outmsg("³B²z¤¤,½Ðµy«á..."); - refresh(); - if (currmode & MODE_SELECT) { - int fd, size = sizeof(fileheader_t); - char genbuf[100]; - fileheader_t rsfh; - int i = inum1, now; - if (currstat == RMAIL) - sethomedir(genbuf, cuser.userid); - else - setbdir(genbuf, currboard); - if ((fd = (open(direct, O_RDONLY, 0))) != -1) { - if (lseek(fd, (off_t) (size * (inum1 - 1)), SEEK_SET) != - -1) { - while (read(fd, &rsfh, size) == size) { - if (i > inum2) - break; - now = getindex(genbuf, rsfh.filename, size); - strlcpy(currfile, rsfh.filename, sizeof(currfile)); - delete_file(genbuf, sizeof(fileheader_t), now, - cmpfilename); - i++; - } + getdata(1, 28, "²×ÂI¡G", num2, 5, DOECHO); + inum2 = atoi(num2); + if (inum2 < inum1) { + outmsg("²×ÂI¦³»~"); + refresh(); + /* safe_sleep(1); */ + return FULLUPDATE; + } + getdata(1, 48, msg_sure_ny, num1, 3, LCECHO); + if (*num1 == 'y') { + outmsg("³B²z¤¤,½Ðµy«á..."); + refresh(); + if (currmode & MODE_SELECT) { + int fd, size = sizeof(fileheader_t); + char genbuf[100]; + fileheader_t rsfh; + int i = inum1, now; + if (currstat == RMAIL) + sethomedir(genbuf, cuser.userid); + else + setbdir(genbuf, currboard); + if ((fd = (open(direct, O_RDONLY, 0))) != -1) { + if (lseek(fd, (off_t) (size * (inum1 - 1)), SEEK_SET) != + -1) { + while (read(fd, &rsfh, size) == size) { + if (i > inum2) + break; + now = getindex(genbuf, rsfh.filename, size); + strlcpy(currfile, rsfh.filename, sizeof(currfile)); + delete_file(genbuf, sizeof(fileheader_t), now, + cmpfilename); + i++; } - close(fd); } + close(fd); } - delete_range(direct, inum1, inum2); - fixkeep(direct, inum1); + } + delete_range(direct, inum1, inum2); + fixkeep(direct, inum1); - if (currmode & MODE_BOARD) - setbtotal(currbid); + if (currmode & MODE_BOARD) + setbtotal(currbid); - return DIRCHANGED; - } - return FULLUPDATE; + return DIRCHANGED; } - return DONOTHING; + return FULLUPDATE; } + return DONOTHING; +} - static int del_post(int ent, fileheader_t * fhdr, char *direct){ - char genbuf[100]; - int not_owned; - boardheader_t *bp; - - bp = getbcache(currbid); - if (strcmp(bp->brdname, "Security") == 0) - return DONOTHING; - if ((fhdr->filemode & FILE_MARKED) || (fhdr->filemode & FILE_DIGEST) || - (fhdr->owner[0] == '-')) - return DONOTHING; - - not_owned = strcmp(fhdr->owner, cuser.userid); - if ((!(currmode & MODE_BOARD) && not_owned) || - ((bp->brdattr & BRD_VOTEBOARD) && !HAS_PERM(PERM_SYSOP)) || - !strcmp(cuser.userid, STR_GUEST)) - return DONOTHING; - - getdata(1, 0, msg_del_ny, genbuf, 3, LCECHO); - if (genbuf[0] == 'y' || genbuf[0] == 'Y') { - strlcpy(currfile, fhdr->filename, sizeof(currfile)); - - setbfile(genbuf, currboard, fhdr->filename); - if (!delete_file(direct, sizeof(fileheader_t), ent, cmpfilename)) { - - if (currmode & MODE_SELECT) { - /* rocker.011018: §Q¥Îreference´î§Cloading */ - fileheader_t hdr; - int num; - - num = fhdr->money & ~FHR_REFERENCE; - setbdir(genbuf, currboard); - get_record(genbuf, &hdr, sizeof(hdr), num); - - /* ¦A³o¸Ìncheck¤@¤Uì¨Óªºdir¸Ì±¬O¤£¬O¦³³Q¤H°Ê¹L... */ - if (strcmp(hdr.filename, fhdr->filename)) { - num = getindex(genbuf, fhdr->filename, sizeof(fileheader_t)); - get_record(genbuf, &hdr, sizeof(hdr), num); - } - /* rocker.011018: ³o¸ÌnÁÙì³Q¯}Ãaªºmoney */ - fhdr->money = hdr.money; - delete_file(genbuf, sizeof(fileheader_t), num, cmpfilename); - } - cancelpost(fhdr, not_owned); +static int +del_post(int ent, fileheader_t * fhdr, char *direct) +{ + char genbuf[100]; + int not_owned; + boardheader_t *bp; - setbtotal(currbid); - if (fhdr->money < 0) - fhdr->money = 0; - if (not_owned && strcmp(currboard, "Test")) { - deumoney(searchuser(fhdr->owner), -fhdr->money); - } - if (!not_owned && strcmp(currboard, "Test")) { - if (cuser.numposts) - cuser.numposts--; - move(b_lines - 1, 0); - clrtoeol(); - demoney(-fhdr->money); - passwd_update(usernum, &cuser); /* post ¼Æ */ - prints("%s¡A±zªº¤å³¹´î¬° %d ½g¡A¤ä¥I²M¼ä¶O %d »È", msg_del_ok, - cuser.numposts, fhdr->money); - refresh(); - pressanykey(); + bp = getbcache(currbid); + if (strcmp(bp->brdname, "Security") == 0) + return DONOTHING; + if ((fhdr->filemode & FILE_MARKED) || (fhdr->filemode & FILE_DIGEST) || + (fhdr->owner[0] == '-')) + return DONOTHING; + + not_owned = strcmp(fhdr->owner, cuser.userid); + if ((!(currmode & MODE_BOARD) && not_owned) || + ((bp->brdattr & BRD_VOTEBOARD) && !HAS_PERM(PERM_SYSOP)) || + !strcmp(cuser.userid, STR_GUEST)) + return DONOTHING; + + getdata(1, 0, msg_del_ny, genbuf, 3, LCECHO); + if (genbuf[0] == 'y' || genbuf[0] == 'Y') { + strlcpy(currfile, fhdr->filename, sizeof(currfile)); + + setbfile(genbuf, currboard, fhdr->filename); + if (!delete_file(direct, sizeof(fileheader_t), ent, cmpfilename)) { + + if (currmode & MODE_SELECT) { + /* rocker.011018: §Q¥Îreference´î§Cloading */ + fileheader_t hdr; + int num; + + num = fhdr->money & ~FHR_REFERENCE; + setbdir(genbuf, currboard); + get_record(genbuf, &hdr, sizeof(hdr), num); + + /* ¦A³o¸Ìncheck¤@¤Uì¨Óªºdir¸Ì±¬O¤£¬O¦³³Q¤H°Ê¹L... */ + if (strcmp(hdr.filename, fhdr->filename)) { + num = getindex(genbuf, fhdr->filename, sizeof(fileheader_t)); + get_record(genbuf, &hdr, sizeof(hdr), num); } - return DIRCHANGED; + /* rocker.011018: ³o¸ÌnÁÙì³Q¯}Ãaªºmoney */ + fhdr->money = hdr.money; + delete_file(genbuf, sizeof(fileheader_t), num, cmpfilename); + } + cancelpost(fhdr, not_owned); + + setbtotal(currbid); + if (fhdr->money < 0) + fhdr->money = 0; + if (not_owned && strcmp(currboard, "Test")) { + deumoney(searchuser(fhdr->owner), -fhdr->money); + } + if (!not_owned && strcmp(currboard, "Test")) { + if (cuser.numposts) + cuser.numposts--; + move(b_lines - 1, 0); + clrtoeol(); + demoney(-fhdr->money); + passwd_update(usernum, &cuser); /* post ¼Æ */ + prints("%s¡A±zªº¤å³¹´î¬° %d ½g¡A¤ä¥I²M¼ä¶O %d »È", msg_del_ok, + cuser.numposts, fhdr->money); + refresh(); + pressanykey(); } + return DIRCHANGED; } - return FULLUPDATE; } + return FULLUPDATE; +} - static int view_postmoney(int ent, fileheader_t * fhdr, char *direct){ - move(b_lines - 1, 0); - clrtoeol(); - prints("³o¤@½g¤å³¹È %d »È", fhdr->money); - refresh(); +static int +view_postmoney(int ent, fileheader_t * fhdr, char *direct) +{ + move(b_lines - 1, 0); + clrtoeol(); + prints("³o¤@½g¤å³¹È %d »È", fhdr->money); + refresh(); + pressanykey(); + return FULLUPDATE; +} + +#ifdef OUTJOBSPOOL +/* ¬ÝªO³Æ¥÷ */ +static int +tar_addqueue(int ent, fileheader_t * fhdr, char *direct) +{ + char email[60], qfn[80], ans[2]; + FILE *fp; + char bakboard, bakman; + clear(); + showtitle("¬ÝªO³Æ¥÷", BBSNAME); + move(2, 0); + if (!((currmode & MODE_BOARD) || HAS_PERM(PERM_SYSOP))) { + move(5, 10); + outs("©pn¬OªO¥D©Î¬O¯¸ªø¤~¯àÂæÂæ°Ú -.-\"\""); pressanykey(); return FULLUPDATE; } + sprintf(qfn, BBSHOME "/jobspool/tarqueue.%s", currboard); + if (access(qfn, 0) == 0) { + outs("¤w¸g±Æ©w¦æµ{, µy«á·|¶i¦æ³Æ¥÷"); + pressanykey(); + return FULLUPDATE; + } + if (!getdata(4, 0, "½Ð¿é¤J¥Øªº«H½c¡G", email, sizeof(email), DOECHO)) + return FULLUPDATE; -#ifdef OUTJOBSPOOL - /* ¬ÝªO³Æ¥÷ */ - static int tar_addqueue(int ent, fileheader_t * fhdr, char *direct){ - char email[60], qfn[80], ans[2]; - FILE *fp; - char bakboard, bakman; - clear(); - showtitle("¬ÝªO³Æ¥÷", BBSNAME); - move(2, 0); - if (!((currmode & MODE_BOARD) || HAS_PERM(PERM_SYSOP))) { - move(5, 10); - outs("©pn¬OªO¥D©Î¬O¯¸ªø¤~¯àÂæÂæ°Ú -.-\"\""); - pressanykey(); - return FULLUPDATE; - } - sprintf(qfn, BBSHOME "/jobspool/tarqueue.%s", currboard); - if (access(qfn, 0) == 0) { - outs("¤w¸g±Æ©w¦æµ{, µy«á·|¶i¦æ³Æ¥÷"); - pressanykey(); - return FULLUPDATE; - } - if (!getdata(4, 0, "½Ð¿é¤J¥Øªº«H½c¡G", email, sizeof(email), DOECHO)) - return FULLUPDATE; - - /* check email -.-"" */ - if (strstr(email, "@") == NULL || strstr(email, ".bbs@") != NULL) { - move(6, 0); - outs("±z«ü©wªº«H½c¤£¥¿½T! "); - pressanykey(); - return FULLUPDATE; - } - getdata(6, 0, "n³Æ¥÷¬ÝªO¤º®e¶Ü(Y/N)?[Y]", ans, sizeof(ans), LCECHO); - bakboard = (ans[0] == 'n' || ans[0] == 'N') ? 0 : 1; - getdata(7, 0, "n³Æ¥÷ºëµØ°Ï¤º®e¶Ü(Y/N)?[N]", ans, sizeof(ans), LCECHO); - bakman = (ans[0] == 'y' || ans[0] == 'Y') ? 1 : 0; - if (!bakboard && !bakman) { - move(8, 0); - outs("¥i¬O§ÚÌ¥u¯à³Æ¥÷¬ÝªO©ÎºëµØ°ÏªºC ^^\"\"\""); - pressanykey(); - return FULLUPDATE; - } - fp = fopen(qfn, "w"); - fprintf(fp, "%s\n", cuser.userid); - fprintf(fp, "%s\n", email); - fprintf(fp, "%d,%d\n", bakboard, bakman); - fclose(fp); - - move(10, 0); - outs("¨t²Î¤w¸g±N±zªº³Æ¥÷±Æ¤J¦æµ{, \n"); - outs("µy«á±N·|¦b¨t²Ît²ü¸û§Cªº®ÉÔ±N¸ê®Æ±Hµ¹±z~ :) "); + /* check email -.-"" */ + if (strstr(email, "@") == NULL || strstr(email, ".bbs@") != NULL) { + move(6, 0); + outs("±z«ü©wªº«H½c¤£¥¿½T! "); + pressanykey(); + return FULLUPDATE; + } + getdata(6, 0, "n³Æ¥÷¬ÝªO¤º®e¶Ü(Y/N)?[Y]", ans, sizeof(ans), LCECHO); + bakboard = (ans[0] == 'n' || ans[0] == 'N') ? 0 : 1; + getdata(7, 0, "n³Æ¥÷ºëµØ°Ï¤º®e¶Ü(Y/N)?[N]", ans, sizeof(ans), LCECHO); + bakman = (ans[0] == 'y' || ans[0] == 'Y') ? 1 : 0; + if (!bakboard && !bakman) { + move(8, 0); + outs("¥i¬O§ÚÌ¥u¯à³Æ¥÷¬ÝªO©ÎºëµØ°ÏªºC ^^\"\"\""); pressanykey(); return FULLUPDATE; } + fp = fopen(qfn, "w"); + fprintf(fp, "%s\n", cuser.userid); + fprintf(fp, "%s\n", email); + fprintf(fp, "%d,%d\n", bakboard, bakman); + fclose(fp); + + move(10, 0); + outs("¨t²Î¤w¸g±N±zªº³Æ¥÷±Æ¤J¦æµ{, \n"); + outs("µy«á±N·|¦b¨t²Ît²ü¸û§Cªº®ÉÔ±N¸ê®Æ±Hµ¹±z~ :) "); + pressanykey(); + return FULLUPDATE; +} #endif - static int sequent_ent; - static int continue_flag; +static int sequent_ent; +static int continue_flag; - /* ----------------------------------------------------- */ - /* ¨Ì§ÇŪ·s¤å³¹ */ - /* ----------------------------------------------------- */ - static int sequent_messages(fileheader_t * fptr) { - static int idc; - char genbuf[200]; +/* ----------------------------------------------------- */ +/* ¨Ì§ÇŪ·s¤å³¹ */ +/* ----------------------------------------------------- */ +static int +sequent_messages(fileheader_t * fptr) +{ + static int idc; + char genbuf[200]; - if (fptr == NULL) - return (idc = 0); + if (fptr == NULL) + return (idc = 0); - if (++idc < sequent_ent) - return 0; + if (++idc < sequent_ent) + return 0; - if (!brc_unread(fptr->filename, brc_num, brc_list)) - return 0; + if (!brc_unread(fptr->filename, brc_num, brc_list)) + return 0; - if (continue_flag) - genbuf[0] = 'y'; - else { - prints("Ū¨ú¤å³¹©ó¡G[%s] §@ªÌ¡G[%s]\n¼ÐÃD¡G[%s]", - currboard, fptr->owner, fptr->title); - getdata(3, 0, "(Y/N/Quit) [Y]: ", genbuf, 3, LCECHO); - } + if (continue_flag) + genbuf[0] = 'y'; + else { + prints("Ū¨ú¤å³¹©ó¡G[%s] §@ªÌ¡G[%s]\n¼ÐÃD¡G[%s]", + currboard, fptr->owner, fptr->title); + getdata(3, 0, "(Y/N/Quit) [Y]: ", genbuf, 3, LCECHO); + } - if (genbuf[0] != 'y' && genbuf[0]) { - clear(); - return (genbuf[0] == 'q' ? QUIT : 0); - } - setbfile(genbuf, currboard, fptr->filename); - brc_addlist(fptr->filename); - - if (more(genbuf, YEA) == 0) - outmsg("\033[31;47m \033[31m(R)\033[30m¦^«H \033[31m(¡õ,n)" - "\033[30m¤U¤@«Ê \033[31m(¡ö,q)\033[30mÂ÷¶} \033[m"); - continue_flag = 0; - - switch (egetch()) { - case KEY_LEFT: - case 'e': - case 'q': - case 'Q': - break; + if (genbuf[0] != 'y' && genbuf[0]) { + clear(); + return (genbuf[0] == 'q' ? QUIT : 0); + } + setbfile(genbuf, currboard, fptr->filename); + brc_addlist(fptr->filename); - case 'y': - case 'r': - case 'Y': - case 'R': - if (currmode & MODE_POST) { - strlcpy(quote_file, genbuf, sizeof(quote_file)); - do_reply(fptr); - *quote_file = 0; - } - break; + if (more(genbuf, YEA) == 0) + outmsg("\033[31;47m \033[31m(R)\033[30m¦^«H \033[31m(¡õ,n)" + "\033[30m¤U¤@«Ê \033[31m(¡ö,q)\033[30mÂ÷¶} \033[m"); + continue_flag = 0; - case ' ': - case KEY_DOWN: - case '\n': - case 'n': - continue_flag = 1; + switch (egetch()) { + case KEY_LEFT: + case 'e': + case 'q': + case 'Q': + break; + + case 'y': + case 'r': + case 'Y': + case 'R': + if (currmode & MODE_POST) { + strlcpy(quote_file, genbuf, sizeof(quote_file)); + do_reply(fptr); + *quote_file = 0; } + break; - clear(); - return 0; + case ' ': + case KEY_DOWN: + case '\n': + case 'n': + continue_flag = 1; } - static int sequential_read(int ent, fileheader_t * fhdr, char *direct){ - char buf[40]; + clear(); + return 0; +} - clear(); - sequent_messages((fileheader_t *) NULL); - sequent_ent = ent; - continue_flag = 0; - setbdir(buf, currboard); - apply_record(buf, sequent_messages, sizeof(fileheader_t)); - return FULLUPDATE; - } +static int +sequential_read(int ent, fileheader_t * fhdr, char *direct) +{ + char buf[40]; - /* ----------------------------------------------------- */ - /* ¬ÝªO³Æ§Ñ¿ý¡B¤åºK¡BºëµØ°Ï */ - /* ----------------------------------------------------- */ - int b_note_edit_bname(int bid){ - char buf[64]; - int aborted; - boardheader_t *fh = getbcache(bid); - setbfile(buf, fh->brdname, fn_notes); - aborted = vedit(buf, NA, NULL); - if (aborted == -1) { - clear(); - outs(msg_cancel); - pressanykey(); - } else { - if (!getdata(2, 0, "³]©w¦³®Ä´Á¤Ñ¡H(n/Y)", buf, 3, LCECHO) - || buf[0] != 'n') - fh->bupdate = gettime(3, fh->bupdate ? fh->bupdate : now); - else - fh->bupdate = 0; - substitute_record(fn_board, fh, sizeof(boardheader_t), bid); - } - return 0; - } + clear(); + sequent_messages((fileheader_t *) NULL); + sequent_ent = ent; + continue_flag = 0; + setbdir(buf, currboard); + apply_record(buf, sequent_messages, sizeof(fileheader_t)); + return FULLUPDATE; +} - static int b_notes_edit() { - if (currmode & MODE_BOARD) { - b_note_edit_bname(currbid); - return FULLUPDATE; - } - return 0; +/* ----------------------------------------------------- */ +/* ¬ÝªO³Æ§Ñ¿ý¡B¤åºK¡BºëµØ°Ï */ +/* ----------------------------------------------------- */ +int +b_note_edit_bname(int bid) +{ + char buf[64]; + int aborted; + boardheader_t *fh = getbcache(bid); + setbfile(buf, fh->brdname, fn_notes); + aborted = vedit(buf, NA, NULL); + if (aborted == -1) { + clear(); + outs(msg_cancel); + pressanykey(); + } else { + if (!getdata(2, 0, "³]©w¦³®Ä´Á¤Ñ¡H(n/Y)", buf, 3, LCECHO) + || buf[0] != 'n') + fh->bupdate = gettime(3, fh->bupdate ? fh->bupdate : now); + else + fh->bupdate = 0; + substitute_record(fn_board, fh, sizeof(boardheader_t), bid); } + return 0; +} - static int b_water_edit() { - if (currmode & MODE_BOARD) { - friend_edit(BOARD_WATER); - return FULLUPDATE; - } - return 0; +static int +b_notes_edit() +{ + if (currmode & MODE_BOARD) { + b_note_edit_bname(currbid); + return FULLUPDATE; } + return 0; +} - static int visable_list_edit() { - if (currmode & MODE_BOARD) { - friend_edit(BOARD_VISABLE); - hbflreload(currbid); - return FULLUPDATE; - } - return 0; +static int +b_water_edit() +{ + if (currmode & MODE_BOARD) { + friend_edit(BOARD_WATER); + return FULLUPDATE; } + return 0; +} - static int b_post_note() { - char buf[200], yn[3]; - - if (currmode & MODE_BOARD) { - setbfile(buf, currboard, FN_POST_NOTE); - if (more(buf, NA) == -1) - more("etc/" FN_POST_NOTE, NA); - getdata(b_lines - 2, 0, "¬O§_n¥Î¦Ûqpostª`·N¨Æ¶µ?", yn, sizeof(yn), LCECHO); - if (yn[0] == 'y') - vedit(buf, NA, NULL); - else - unlink(buf); - return FULLUPDATE; - } - return 0; +static int +visable_list_edit() +{ + if (currmode & MODE_BOARD) { + friend_edit(BOARD_VISABLE); + hbflreload(currbid); + return FULLUPDATE; } + return 0; +} - static int b_application() { - char buf[200]; - - if (currmode & MODE_BOARD) { - setbfile(buf, currboard, FN_APPLICATION); +static int +b_post_note() +{ + char buf[200], yn[3]; + + if (currmode & MODE_BOARD) { + setbfile(buf, currboard, FN_POST_NOTE); + if (more(buf, NA) == -1) + more("etc/" FN_POST_NOTE, NA); + getdata(b_lines - 2, 0, "¬O§_n¥Î¦Ûqpostª`·N¨Æ¶µ?", yn, sizeof(yn), LCECHO); + if (yn[0] == 'y') vedit(buf, NA, NULL); - return FULLUPDATE; - } - return 0; + else + unlink(buf); + return FULLUPDATE; } + return 0; +} - static int can_vote_edit() { - if (currmode & MODE_BOARD) { - friend_edit(FRIEND_CANVOTE); - return FULLUPDATE; - } - return 0; +static int +b_application() +{ + char buf[200]; + + if (currmode & MODE_BOARD) { + setbfile(buf, currboard, FN_APPLICATION); + vedit(buf, NA, NULL); + return FULLUPDATE; } + return 0; +} - static int bh_title_edit() { - boardheader_t *bp; - - if (currmode & MODE_BOARD) { - char genbuf[BTLEN]; - - bp = getbcache(currbid); - move(1, 0); - clrtoeol(); - getdata_str(1, 0, "½Ð¿é¤J¬ÝªO·s¤¤¤å±Ôz:", genbuf, - BTLEN - 16, DOECHO, bp->title + 7); - - if (!genbuf[0]) - return 0; - strip_ansi(genbuf, genbuf, 0); - strlcpy(bp->title + 7, genbuf, sizeof(bp->title) - 7); - substitute_record(fn_board, bp, sizeof(boardheader_t), currbid); - log_usies("SetBoard", currboard); - return FULLUPDATE; - } - return 0; +static int +can_vote_edit() +{ + if (currmode & MODE_BOARD) { + friend_edit(FRIEND_CANVOTE); + return FULLUPDATE; } + return 0; +} - static int b_notes() { - char buf[64]; +static int +bh_title_edit() +{ + boardheader_t *bp; - setbfile(buf, currboard, fn_notes); - if (more(buf, NA) == -1) { - clear(); - move(4, 20); - outs("¥»¬ÝªO©|µL¡u³Æ§Ñ¿ý¡v¡C"); - } - pressanykey(); + if (currmode & MODE_BOARD) { + char genbuf[BTLEN]; + + bp = getbcache(currbid); + move(1, 0); + clrtoeol(); + getdata_str(1, 0, "½Ð¿é¤J¬ÝªO·s¤¤¤å±Ôz:", genbuf, + BTLEN - 16, DOECHO, bp->title + 7); + + if (!genbuf[0]) + return 0; + strip_ansi(genbuf, genbuf, 0); + strlcpy(bp->title + 7, genbuf, sizeof(bp->title) - 7); + substitute_record(fn_board, bp, sizeof(boardheader_t), currbid); + log_usies("SetBoard", currboard); return FULLUPDATE; } + return 0; +} - int board_select() { - char fpath[80]; - char genbuf[100]; +static int +b_notes() +{ + char buf[64]; - currmode &= ~MODE_SELECT; - sprintf(fpath, "SR.%s", cuser.userid); - setbfile(genbuf, currboard, fpath); - unlink(genbuf); - if (currstat == RMAIL) - sethomedir(currdirect, cuser.userid); - else - setbdir(currdirect, currboard); - return NEWDIRECT; + setbfile(buf, currboard, fn_notes); + if (more(buf, NA) == -1) { + clear(); + move(4, 20); + outs("¥»¬ÝªO©|µL¡u³Æ§Ñ¿ý¡v¡C"); } + pressanykey(); + return FULLUPDATE; +} - int board_digest() { - if (currmode & MODE_SELECT) - board_select(); - currmode ^= MODE_DIGEST; - if (currmode & MODE_DIGEST) - currmode &= ~MODE_POST; - else if (haspostperm(currboard)) - currmode |= MODE_POST; +int +board_select() +{ + char fpath[80]; + char genbuf[100]; + currmode &= ~MODE_SELECT; + sprintf(fpath, "SR.%s", cuser.userid); + setbfile(genbuf, currboard, fpath); + unlink(genbuf); + if (currstat == RMAIL) + sethomedir(currdirect, cuser.userid); + else setbdir(currdirect, currboard); - return NEWDIRECT; - } + return NEWDIRECT; +} - int board_etc() { - if (!HAS_PERM(PERM_SYSOP)) - return DONOTHING; - currmode ^= MODE_ETC; - if (currmode & MODE_ETC) - currmode &= ~MODE_POST; - else if (haspostperm(currboard)) - currmode |= MODE_POST; +int +board_digest() +{ + if (currmode & MODE_SELECT) + board_select(); + currmode ^= MODE_DIGEST; + if (currmode & MODE_DIGEST) + currmode &= ~MODE_POST; + else if (haspostperm(currboard)) + currmode |= MODE_POST; - setbdir(currdirect, currboard); - return NEWDIRECT; - } + setbdir(currdirect, currboard); + return NEWDIRECT; +} - static int good_post(int ent, fileheader_t * fhdr, char *direct){ - char genbuf[200]; - char genbuf2[200]; - int delta = 0; - - if ((currmode & MODE_DIGEST) || !(currmode & MODE_BOARD)) - return DONOTHING; - - if (fhdr->filemode & FILE_DIGEST) { - fhdr->filemode = (fhdr->filemode & ~FILE_DIGEST); - if (!strcmp(currboard, "Note") || !strcmp(currboard, "PttBug") || - !strcmp(currboard, "Artdsn") || !strcmp(currboard, "PttLaw")) { - deumoney(searchuser(fhdr->owner), -1000); - if (!(currmode & MODE_SELECT)) - fhdr->money -= 1000; - else - delta = -1000; - } - } else { - fileheader_t digest; - char *ptr, buf[64]; - - memcpy(&digest, fhdr, sizeof(digest)); - digest.filename[0] = 'G'; - strlcpy(buf, direct, sizeof(buf)); - ptr = strrchr(buf, '/') + 1; - ptr[0] = '\0'; - sprintf(genbuf, "%s%s", buf, digest.filename); - - if (dashf(genbuf)) - unlink(genbuf); +int +board_etc() +{ + if (!HAS_PERM(PERM_SYSOP)) + return DONOTHING; + currmode ^= MODE_ETC; + if (currmode & MODE_ETC) + currmode &= ~MODE_POST; + else if (haspostperm(currboard)) + currmode |= MODE_POST; - digest.filemode = 0; - sprintf(genbuf2, "%s%s", buf, fhdr->filename); - Link(genbuf2, genbuf); - strcpy(ptr, fn_mandex); - append_record(buf, &digest, sizeof(digest)); - - fhdr->filemode = (fhdr->filemode & ~FILE_MARKED) | FILE_DIGEST; - if (!strcmp(currboard, "Note") || !strcmp(currboard, "PttBug") || - !strcmp(currboard, "Artdsn") || !strcmp(currboard, "PttLaw")) { - deumoney(searchuser(fhdr->owner), 1000); - if (!(currmode & MODE_SELECT)) - fhdr->money += 1000; - else - delta = 1000; - } + setbdir(currdirect, currboard); + return NEWDIRECT; +} + +static int +good_post(int ent, fileheader_t * fhdr, char *direct) +{ + char genbuf[200]; + char genbuf2[200]; + int delta = 0; + + if ((currmode & MODE_DIGEST) || !(currmode & MODE_BOARD)) + return DONOTHING; + + if (fhdr->filemode & FILE_DIGEST) { + fhdr->filemode = (fhdr->filemode & ~FILE_DIGEST); + if (!strcmp(currboard, "Note") || !strcmp(currboard, "PttBug") || + !strcmp(currboard, "Artdsn") || !strcmp(currboard, "PttLaw")) { + deumoney(searchuser(fhdr->owner), -1000); + if (!(currmode & MODE_SELECT)) + fhdr->money -= 1000; + else + delta = -1000; } - substitute_record(direct, fhdr, sizeof(*fhdr), ent); - touchdircache(currbid); - /* rocker.011018: ¦ê±µ¼Ò¦¡¥Îreference¼W¶i®Ä²v */ - if ((currmode & MODE_SELECT) && (fhdr->money & FHR_REFERENCE)) { - fileheader_t hdr; - char genbuf[100]; - int num; + } else { + fileheader_t digest; + char *ptr, buf[64]; - num = fhdr->money & ~FHR_REFERENCE; - setbdir(genbuf, currboard); - get_record(genbuf, &hdr, sizeof(hdr), num); + memcpy(&digest, fhdr, sizeof(digest)); + digest.filename[0] = 'G'; + strlcpy(buf, direct, sizeof(buf)); + ptr = strrchr(buf, '/') + 1; + ptr[0] = '\0'; + sprintf(genbuf, "%s%s", buf, digest.filename); - /* ¦A³o¸Ìncheck¤@¤Uì¨Óªºdir¸Ì±¬O¤£¬O¦³³Q¤H°Ê¹L... */ - if (strcmp(hdr.filename, fhdr->filename)) { - num = getindex(genbuf, fhdr->filename, sizeof(fileheader_t)); - get_record(genbuf, &hdr, sizeof(hdr), num); - } - fhdr->money = hdr.money + delta; + if (dashf(genbuf)) + unlink(genbuf); - substitute_record(genbuf, fhdr, sizeof(*fhdr), num); + digest.filemode = 0; + sprintf(genbuf2, "%s%s", buf, fhdr->filename); + Link(genbuf2, genbuf); + strcpy(ptr, fn_mandex); + append_record(buf, &digest, sizeof(digest)); + + fhdr->filemode = (fhdr->filemode & ~FILE_MARKED) | FILE_DIGEST; + if (!strcmp(currboard, "Note") || !strcmp(currboard, "PttBug") || + !strcmp(currboard, "Artdsn") || !strcmp(currboard, "PttLaw")) { + deumoney(searchuser(fhdr->owner), 1000); + if (!(currmode & MODE_SELECT)) + fhdr->money += 1000; + else + delta = 1000; } - return PART_REDRAW; } + substitute_record(direct, fhdr, sizeof(*fhdr), ent); + touchdircache(currbid); + /* rocker.011018: ¦ê±µ¼Ò¦¡¥Îreference¼W¶i®Ä²v */ + if ((currmode & MODE_SELECT) && (fhdr->money & FHR_REFERENCE)) { + fileheader_t hdr; + char genbuf[100]; + int num; - /* help for board reading */ - static char *board_help[] = { - "\0¥þ¥\\¯à¬ÝªO¾Þ§@»¡©ú", - "\01°ò¥»©R¥O", - "(p)(¡ô) ¤W²¾¤@½g¤å³¹ (^P) µoªí¤å³¹", - "(n)(¡õ) ¤U²¾¤@½g¤å³¹ (d) §R°£¤å³¹", - "(P)(PgUp) ¤W²¾¤@¶ (S) ¦ê³s¬ÛÃö¤å³¹", - "(N)(PgDn) ¤U²¾¤@¶ (##) ¸õ¨ì ## ¸¹¤å³¹", - "(r)(¡÷) ¾\\Ū¦¹½g¤å³¹ ($) ¸õ¨ì³Ì«á¤@½g¤å³¹", - "\01¶i¶¥©R¥O", - "(tab)/z ¤åºK¼Ò¦¡/ºëµØ°Ï (a/A)(^Q)§ä´M§@ªÌ/§@ªÌ¸ê®Æ", - "(b/f) ®iŪ³Æ§Ñ¿ý/°Ñ»P½ä½L (?)(/) §ä´M¼ÐÃD", - "(V/R) §ë²¼/¬d¸ß§ë²¼µ²ªG (^W)(X) §Ú¦bþ¸Ì/±ÀÂˤ峹", - "(x)(w) Âà¿ý¤å³¹/¥á¤ô²y (=)/([]<>-+) §ä´Mº½g¤å³¹/¥DÃD¦¡¾\\Ū", + num = fhdr->money & ~FHR_REFERENCE; + setbdir(genbuf, currboard); + get_record(genbuf, &hdr, sizeof(hdr), num); + + /* ¦A³o¸Ìncheck¤@¤Uì¨Óªºdir¸Ì±¬O¤£¬O¦³³Q¤H°Ê¹L... */ + if (strcmp(hdr.filename, fhdr->filename)) { + num = getindex(genbuf, fhdr->filename, sizeof(fileheader_t)); + get_record(genbuf, &hdr, sizeof(hdr), num); + } + fhdr->money = hdr.money + delta; + + substitute_record(genbuf, fhdr, sizeof(*fhdr), num); + } + return PART_REDRAW; +} + +/* help for board reading */ +static char *board_help[] = { + "\0¥þ¥\\¯à¬ÝªO¾Þ§@»¡©ú", + "\01°ò¥»©R¥O", + "(p)(¡ô) ¤W²¾¤@½g¤å³¹ (^P) µoªí¤å³¹", + "(n)(¡õ) ¤U²¾¤@½g¤å³¹ (d) §R°£¤å³¹", + "(P)(PgUp) ¤W²¾¤@¶ (S) ¦ê³s¬ÛÃö¤å³¹", + "(N)(PgDn) ¤U²¾¤@¶ (##) ¸õ¨ì ## ¸¹¤å³¹", + "(r)(¡÷) ¾\\Ū¦¹½g¤å³¹ ($) ¸õ¨ì³Ì«á¤@½g¤å³¹", + "\01¶i¶¥©R¥O", + "(tab)/z ¤åºK¼Ò¦¡/ºëµØ°Ï (a/A)(^Q)§ä´M§@ªÌ/§@ªÌ¸ê®Æ", + "(b/f) ®iŪ³Æ§Ñ¿ý/°Ñ»P½ä½L (?)(/) §ä´M¼ÐÃD", + "(V/R) §ë²¼/¬d¸ß§ë²¼µ²ªG (^W)(X) §Ú¦bþ¸Ì/±ÀÂˤ峹", + "(x)(w) Âà¿ý¤å³¹/¥á¤ô²y (=)/([]<>-+) §ä´Mº½g¤å³¹/¥DÃD¦¡¾\\Ū", #ifdef INTERNET_EMAIL - "(F) ¤å³¹±H¦^Internet¶l½c (U) ±N¤å³¹ uuencode «á±H¦^¶l½c", + "(F) ¤å³¹±H¦^Internet¶l½c (U) ±N¤å³¹ uuencode «á±H¦^¶l½c", #endif - "(E) «½s¤å³¹ (^H) ¦C¥X©Ò¦³ªº New Post(s)", - "\01ªO¥D©R¥O", - "(G) Á|¿ì½ä½L/°±¤î¤Uª`/¶}¼ú(W/K/v) ½s¿è³Æ§Ñ¿ý/¤ô±í¦W³æ/¥i¬Ý¨£¦W³æ", - "(M/o) Á|¦æ§ë²¼/½s¨p§ë²¼¦W³æ (m/c/g) «O¯d¤å³¹/¿ï¿ýºëµØ/¤åºK", - "(D) §R°£¤@¬q½d³òªº¤å³¹ (T/B) «½s¤å³¹¼ÐÃD/«½s¬ÝªO¼ÐÃD", - "(i) ½s¿è¥Ó½Ð¤J·|ªí®æ (t/^D) ¼Ð°O¤å³¹/¬å°£¼Ð°Oªº¤å³¹", - "(O) ½s¿èPostª`·N¨Æ¶µ (H)/(Y) ¬ÝªOÁôÂÃ/²{¨ ¨ú®ø±ÀÂˤ峹", - NULL - }; - - static int b_help() { - show_help(board_help); - return FULLUPDATE; - } + "(E) «½s¤å³¹ (^H) ¦C¥X©Ò¦³ªº New Post(s)", + "\01ªO¥D©R¥O", + "(G) Á|¿ì½ä½L/°±¤î¤Uª`/¶}¼ú(W/K/v) ½s¿è³Æ§Ñ¿ý/¤ô±í¦W³æ/¥i¬Ý¨£¦W³æ", + "(M/o) Á|¦æ§ë²¼/½s¨p§ë²¼¦W³æ (m/c/g) «O¯d¤å³¹/¿ï¿ýºëµØ/¤åºK", + "(D) §R°£¤@¬q½d³òªº¤å³¹ (T/B) «½s¤å³¹¼ÐÃD/«½s¬ÝªO¼ÐÃD", + "(i) ½s¿è¥Ó½Ð¤J·|ªí®æ (t/^D) ¼Ð°O¤å³¹/¬å°£¼Ð°Oªº¤å³¹", + "(O) ½s¿èPostª`·N¨Æ¶µ (H)/(Y) ¬ÝªOÁôÂÃ/²{¨ ¨ú®ø±ÀÂˤ峹", + NULL +}; + +static int +b_help() +{ + show_help(board_help); + return FULLUPDATE; +} - /* ----------------------------------------------------- */ - /* ªO¥D³]©wÁô§Î/ ¸ÑÁô§Î */ - /* ----------------------------------------------------- */ - char board_hidden_status; +/* ----------------------------------------------------- */ +/* ªO¥D³]©wÁô§Î/ ¸ÑÁô§Î */ +/* ----------------------------------------------------- */ +char board_hidden_status; #ifdef BMCHS - static int change_hidden(int ent, fileheader_t * fhdr, char *direct){ - boardheader_t bh; - int bid; - char ans[4]; - - if (!((currmode & MODE_BOARD) || HAS_PERM(PERM_SYSOP)) || - currboard[0] == 0 || - (bid = getbnum(currboard)) < 0 || - get_record(fn_board, &bh, sizeof(bh), bid) == -1) - return DONOTHING; - - if (((bh.brdattr & BRD_HIDE) && (bh.brdattr & BRD_POSTMASK))) { - getdata(1, 0, "¥Ø«eªO¦bÁô§Îª¬ºA, n¸ÑÁô§Î¹À(Y/N)?[N]", - ans, sizeof(ans), LCECHO); - if (ans[0] != 'y' && ans[0] != 'Y') - return FULLUPDATE; - getdata(2, 0, "¦A½T»{¤@¦¸, ¯uªºn§âªOªO¤½¶}¹À @____@(Y/N)?[N]", - ans, sizeof(ans), LCECHO); - if (ans[0] != 'y' && ans[0] != 'Y') - return FULLUPDATE; - if (bh.brdattr & BRD_HIDE) - bh.brdattr -= BRD_HIDE; - if (bh.brdattr & BRD_POSTMASK) - bh.brdattr -= BRD_POSTMASK; - log_usies("OpenBoard", bh.brdname); - outs("§g¤ß¤µ¶Ç²³¤H¡AµL³B¤£»D©¶ºq¡C\n"); - board_hidden_status = 0; - hbflreload(bid); - } else { - getdata(1, 0, "¥Ø«eªO¦b²{§Îª¬ºA, nÁô§Î¹À(Y/N)?[N]", - ans, sizeof(ans), LCECHO); - if (ans[0] != 'y' && ans[0] != 'Y') - return FULLUPDATE; - bh.brdattr |= BRD_HIDE; - bh.brdattr |= BRD_POSTMASK; - log_usies("CloseBoard", bh.brdname); - outs("§g¤ß¤µ¤w±»§í¡A±©¬ßµ½¦Û¬Ã«¡C\n"); - board_hidden_status = 1; - } - setup_man(&bh); - substitute_record(fn_board, &bh, sizeof(bh), bid); - reset_board(bid); - log_usies("SetBoard", bh.brdname); - pressanykey(); - return FULLUPDATE; +static int +change_hidden(int ent, fileheader_t * fhdr, char *direct) +{ + boardheader_t bh; + int bid; + char ans[4]; + + if (!((currmode & MODE_BOARD) || HAS_PERM(PERM_SYSOP)) || + currboard[0] == 0 || + (bid = getbnum(currboard)) < 0 || + get_record(fn_board, &bh, sizeof(bh), bid) == -1) + return DONOTHING; + + if (((bh.brdattr & BRD_HIDE) && (bh.brdattr & BRD_POSTMASK))) { + getdata(1, 0, "¥Ø«eªO¦bÁô§Îª¬ºA, n¸ÑÁô§Î¹À(Y/N)?[N]", + ans, sizeof(ans), LCECHO); + if (ans[0] != 'y' && ans[0] != 'Y') + return FULLUPDATE; + getdata(2, 0, "¦A½T»{¤@¦¸, ¯uªºn§âªOªO¤½¶}¹À @____@(Y/N)?[N]", + ans, sizeof(ans), LCECHO); + if (ans[0] != 'y' && ans[0] != 'Y') + return FULLUPDATE; + if (bh.brdattr & BRD_HIDE) + bh.brdattr -= BRD_HIDE; + if (bh.brdattr & BRD_POSTMASK) + bh.brdattr -= BRD_POSTMASK; + log_usies("OpenBoard", bh.brdname); + outs("§g¤ß¤µ¶Ç²³¤H¡AµL³B¤£»D©¶ºq¡C\n"); + board_hidden_status = 0; + hbflreload(bid); + } else { + getdata(1, 0, "¥Ø«eªO¦b²{§Îª¬ºA, nÁô§Î¹À(Y/N)?[N]", + ans, sizeof(ans), LCECHO); + if (ans[0] != 'y' && ans[0] != 'Y') + return FULLUPDATE; + bh.brdattr |= BRD_HIDE; + bh.brdattr |= BRD_POSTMASK; + log_usies("CloseBoard", bh.brdname); + outs("§g¤ß¤µ¤w±»§í¡A±©¬ßµ½¦Û¬Ã«¡C\n"); + board_hidden_status = 1; } + setup_man(&bh); + substitute_record(fn_board, &bh, sizeof(bh), bid); + reset_board(bid); + log_usies("SetBoard", bh.brdname); + pressanykey(); + return FULLUPDATE; +} #endif - /* ----------------------------------------------------- */ - /* ¬ÝªO¥\¯àªí */ - /* ----------------------------------------------------- */ - struct onekey_t read_comms[] = { - {KEY_TAB, board_digest}, - {'C', board_etc}, - {'b', b_notes}, - {'c', cite_post}, - {'r', read_post}, - {'z', b_man}, - {'D', del_range}, - {'S', sequential_read}, - {'E', edit_post}, - {'T', edit_title}, - {'s', do_select}, - {'R', b_results}, - {'V', b_vote}, - {'M', b_vote_maintain}, - {'B', bh_title_edit}, - {'W', b_notes_edit}, - {'O', b_post_note}, - {'K', b_water_edit}, - {'w', b_call_in}, - {'v', visable_list_edit}, - {'i', b_application}, - {'o', can_vote_edit}, - {'x', cross_post}, - {'X', recommend}, - {'Y', recommend_cancel}, - {'h', b_help}, +/* ----------------------------------------------------- */ +/* ¬ÝªO¥\¯àªí */ +/* ----------------------------------------------------- */ +struct onekey_t read_comms[] = { + {KEY_TAB, board_digest}, + {'C', board_etc}, + {'b', b_notes}, + {'c', cite_post}, + {'r', read_post}, + {'z', b_man}, + {'D', del_range}, + {'S', sequential_read}, + {'E', edit_post}, + {'T', edit_title}, + {'s', do_select}, + {'R', b_results}, + {'V', b_vote}, + {'M', b_vote_maintain}, + {'B', bh_title_edit}, + {'W', b_notes_edit}, + {'O', b_post_note}, + {'K', b_water_edit}, + {'w', b_call_in}, + {'v', visable_list_edit}, + {'i', b_application}, + {'o', can_vote_edit}, + {'x', cross_post}, + {'X', recommend}, + {'Y', recommend_cancel}, + {'h', b_help}, #ifndef NO_GAMBLE - {'f', join_gamble}, - {'G', hold_gamble}, + {'f', join_gamble}, + {'G', hold_gamble}, #endif - {'g', good_post}, - {'y', reply_post}, - {'d', del_post}, - {'m', mark_post}, - {'L', solve_post}, - {Ctrl('P'), do_post}, - {Ctrl('W'), whereami}, - {'Q', view_postmoney}, + {'g', good_post}, + {'y', reply_post}, + {'d', del_post}, + {'m', mark_post}, + {'L', solve_post}, + {Ctrl('P'), do_post}, + {Ctrl('W'), whereami}, + {'Q', view_postmoney}, #ifdef OUTJOBSPOOL - {'u', tar_addqueue}, + {'u', tar_addqueue}, #endif #ifdef BMCHS - {'H', change_hidden}, + {'H', change_hidden}, #endif - {'\0', NULL} - }; + {'\0', NULL} +}; - int Read() { - int mode0 = currutmp->mode; - int stat0 = currstat, tmpbid = currutmp->brc_id; - char buf[40]; +int +Read() +{ + int mode0 = currutmp->mode; + int stat0 = currstat, tmpbid = currutmp->brc_id; + char buf[40]; #ifdef LOG_BOARD - time_t usetime = now; + time_t usetime = now; #endif - setutmpmode(READING); - set_board(); + setutmpmode(READING); + set_board(); - if (board_visit_time < board_note_time) { - setbfile(buf, currboard, fn_notes); - more(buf, NA); - pressanykey(); - } - setutmpbid(currbid); - setbdir(buf, currboard); - curredit &= ~EDIT_MAIL; - i_read(READING, buf, readtitle, readdoent, read_comms, - currbid); + if (board_visit_time < board_note_time) { + setbfile(buf, currboard, fn_notes); + more(buf, NA); + pressanykey(); + } + setutmpbid(currbid); + setbdir(buf, currboard); + curredit &= ~EDIT_MAIL; + i_read(READING, buf, readtitle, readdoent, read_comms, + currbid); #ifdef LOG_BOARD - log_board(currboard, now - usetime); + log_board(currboard, now - usetime); #endif - brc_update(); - setutmpbid(tmpbid); - currutmp->mode = mode0; - currstat = stat0; - return 0; - } + brc_update(); + setutmpbid(tmpbid); + currutmp->mode = mode0; + currstat = stat0; + return 0; +} - void ReadSelect() { - int mode0 = currutmp->mode; - int stat0 = currstat; - char genbuf[200]; - - currstat = XMODE; - if (do_select(0, 0, genbuf) == NEWDIRECT) - Read(); - setutmpbid(0); - currutmp->mode = mode0; - currstat = stat0; - } +void +ReadSelect() +{ + int mode0 = currutmp->mode; + int stat0 = currstat; + char genbuf[200]; + + currstat = XMODE; + if (do_select(0, 0, genbuf) == NEWDIRECT) + Read(); + setutmpbid(0); + currutmp->mode = mode0; + currstat = stat0; +} #ifdef LOG_BOARD - static void log_board(char *mode, time_t usetime){ - char buf[256]; +static void +log_board(char *mode, time_t usetime) +{ + char buf[256]; - if (usetime > 30) { - sprintf(buf, "USE %-20.20s Stay: %5ld (%s) %s", - mode, usetime, cuser.userid, ctime(&now)); - log_file(FN_USEBOARD, buf); - } + if (usetime > 30) { + sprintf(buf, "USE %-20.20s Stay: %5ld (%s) %s", + mode, usetime, cuser.userid, ctime(&now)); + log_file(FN_USEBOARD, buf); } +} #endif - int Select() { - char genbuf[200]; +int +Select() +{ + char genbuf[200]; - setutmpmode(SELECT); - do_select(0, NULL, genbuf); - return 0; - } + setutmpmode(SELECT); + do_select(0, NULL, genbuf); + return 0; +} #ifdef HAVEMOBILE - void mobile_message(char *mobile, char *message){ +void +mobile_message(char *mobile, char *message) +{ - bsmtp(char *fpath, char *title, char *rcpt, int method); - } + bsmtp(char *fpath, char *title, char *rcpt, int method); +} #endif diff --git a/mbbsd/board.c b/mbbsd/board.c index 859c8c8b..d6d8c8ea 100644 --- a/mbbsd/board.c +++ b/mbbsd/board.c @@ -1,4 +1,4 @@ -/* $Id: board.c,v 1.41 2002/07/21 08:18:41 in2 Exp $ */ +/* $Id: board.c,v 1.42 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" #define BRC_STRLEN 15 /* Length of board name */ #define BRC_MAXSIZE 24576 @@ -49,7 +49,7 @@ static char brc_name[BRC_STRLEN]; static char *fn_boardrc = ".boardrc"; static int brc_size; -void +void brc_update() { if (brc_changed && cuser.userlevel) { @@ -88,7 +88,7 @@ brc_update() } } -static void +static void read_brc_buf() { char dirfile[STRLEN]; @@ -105,7 +105,7 @@ read_brc_buf() } } -int +int brc_initial(char *boardname) { char *ptr; @@ -129,7 +129,7 @@ brc_initial(char *boardname) return 0; } -void +void brc_addlist(char *fname) { int ftime, n, i; @@ -167,7 +167,7 @@ brc_addlist(char *fname) } } -static int +static int brc_unread_time(time_t ftime, int bnum, int *blist) { int n; @@ -186,7 +186,7 @@ brc_unread_time(time_t ftime, int bnum, int *blist) return 0; } -int +int brc_unread(char *fname, int bnum, int *blist) { int ftime, n; @@ -225,7 +225,7 @@ static boardstat_t *nbrd = NULL; #define STR_BBSRC ".bbsrc" #define STR_FAV ".fav" -void +void init_brdbuf() { register int n, size; @@ -260,7 +260,7 @@ init_brdbuf() brc_expire_time = login_start_time - 365 * 86400; } -void +void save_brdbuf() { int fd, size; @@ -288,7 +288,7 @@ save_brdbuf() } } -int +int Ben_Perm(boardheader_t * bptr) { register int level, brdattr; @@ -323,7 +323,7 @@ Ben_Perm(boardheader_t * bptr) } #if 0 -static int +static int have_author(char *brdname) { char dirname[100]; @@ -342,7 +342,7 @@ have_author(char *brdname) } #endif -static int +static int check_newpost(boardstat_t * ptr) { /* Ptt §ï */ int tbrc_list[BRC_MAXNUM], tbrc_num; @@ -377,7 +377,7 @@ check_newpost(boardstat_t * ptr) static int brdnum; static int yank_flag = 1; -static void +static void load_uidofgid(const int gid, const int type) { boardheader_t *bptr, *currbptr; @@ -423,13 +423,13 @@ addnewbrdstat(int n, int state) return ptr; } -static int +static int cmpboardfriends(const void *brd, const void *tmp) { return ((boardstat_t *) tmp)->bh->nuser - ((boardstat_t *) brd)->bh->nuser; } -static void +static void load_boards(char *key) { boardheader_t *bptr = NULL; @@ -476,7 +476,7 @@ load_boards(char *key) } } -static int +static int search_board() { int num; @@ -494,7 +494,7 @@ search_board() return -1; } -static int +static int unread_position(char *dirfile, boardstat_t * ptr) { fileheader_t fh; @@ -535,7 +535,7 @@ unread_position(char *dirfile, boardstat_t * ptr) return num; } -static void +static void brdlist_foot() { prints("\033[34;46m ¿ï¾Ü¬ÝªO \033[31;47m (c)\033[30m·s¤å³¹¼Ò¦¡ " @@ -544,7 +544,7 @@ brdlist_foot() yank_flag == 0 ? "³Ì·R" : yank_flag == 1 ? "³¡¥÷" : "¥þ³¡"); } -static void +static void show_brdlist(int head, int clsflag, int newflag) { int myrow = 2; @@ -670,7 +670,7 @@ static char *choosebrdhelp[] = { }; -static void +static void set_menu_BM(char *BM) { if (HAS_PERM(PERM_ALLBOARD) || is_BM(BM)) { @@ -681,7 +681,7 @@ set_menu_BM(char *BM) static char *privateboard = "\n\n\n\n ¹ï¤£°_ ¦¹ªO¥Ø«e¥uã¬ÝªO¦n¤Í¶i¤J ½Ð¥ý¦VªO¥D¥Ó½Ð¤J¹Ò³\\¥i"; -static void +static void dozap(int num) { boardstat_t *ptr; @@ -695,7 +695,7 @@ dozap(int num) } -static void +static void choose_board(int newflag) { static int num = 0; @@ -1063,7 +1063,7 @@ choose_board(int newflag) free(nbrd); } -int +int root_board() { class_bid = 1; @@ -1072,7 +1072,7 @@ root_board() return 0; } -int +int Boards() { class_bid = 0; @@ -1082,7 +1082,7 @@ Boards() } -int +int New() { int mode0 = currutmp->mode; diff --git a/mbbsd/cache.c b/mbbsd/cache.c index ba0701a8..fd61cf55 100644 --- a/mbbsd/cache.c +++ b/mbbsd/cache.c @@ -1,4 +1,4 @@ -/* $Id: cache.c,v 1.42 2002/07/21 08:18:41 in2 Exp $ */ +/* $Id: cache.c,v 1.43 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" #ifndef __FreeBSD__ @@ -15,7 +15,7 @@ union semun { * handler routine, while SIGALRM is blocked. if we use the original sleep, * we'll never wake up. */ -unsigned int +unsigned int safe_sleep(unsigned int seconds) { /* jochang sleep¦³°ÝÃD®É¥Î */ @@ -39,7 +39,7 @@ safe_sleep(unsigned int seconds) } #if defined(_BBS_UTIL_C_) -static void +static void setapath(char *buf, char *boardname) { sprintf(buf, "man/boards/%c/%s", boardname[0], boardname); @@ -47,14 +47,14 @@ setapath(char *buf, char *boardname) static char *str_dotdir = ".DIR"; -static void +static void setadir(char *buf, char *path) { sprintf(buf, "%s/%s", path, str_dotdir); } #endif -static void +static void attach_err(int shmkey, char *name) { fprintf(stderr, "[%s error] key = %x\n", name, shmkey); @@ -91,7 +91,7 @@ attach_shm(int shmkey, int shmsize) /* ----------------------------------------------------- */ /* semaphore : for critical section */ /* ----------------------------------------------------- */ -void +void sem_init(int semkey, int *semid) { union semun s; @@ -106,7 +106,7 @@ sem_init(int semkey, int *semid) } } -void +void sem_lock(int op, int semid) { struct sembuf sops; @@ -130,7 +130,7 @@ sem_lock(int op, int semid) /* attach_uhash should be called before using uhash */ -void +void attach_SHM(void) { SHM = attach_shm(SHM_KEY, sizeof(SHM_t)); @@ -149,7 +149,7 @@ attach_SHM(void) SHM->Ftouchtime = 1; } -void +void add_to_uhash(int n, char *id) { int *p, h = StringHash(id); @@ -171,7 +171,7 @@ add_to_uhash(int n, char *id) * note: after remove_from_uhash(), you should add_to_uhash() (likely with a * different name) */ -void +void remove_from_uhash(int n) { int h = StringHash(SHM->userid[n]); @@ -188,7 +188,7 @@ remove_from_uhash(int n) *p = SHM->next_in_hash[n]; } -int +int setumoney(int uid, int money) { SHM->money[uid - 1] = money; @@ -196,7 +196,7 @@ setumoney(int uid, int money) return SHM->money[uid - 1]; } -int +int deumoney(int uid, int money) { if (money < 0 && SHM->money[uid - 1] < -money) @@ -204,17 +204,17 @@ deumoney(int uid, int money) else return setumoney(uid, SHM->money[uid - 1] + money); } -int +int demoney(int money) { return deumoney(usernum, money); } -int +int moneyof(int uid) { /* ptt §ï¶iª÷¿ú³B²z®Ä²v */ return SHM->money[uid - 1]; } -int +int searchuser(char *userid) { int h, p, times; @@ -234,7 +234,7 @@ searchuser(char *userid) #if !defined(_BBS_UTIL_C_) -int +int getuser(char *userid) { int uid; @@ -252,7 +252,7 @@ getuserid(int num) return NULL; } -void +void setuserid(int num, char *userid) { if (num > 0 && num <= MAX_USERS) { @@ -267,7 +267,7 @@ setuserid(int num, char *userid) /* 0 ==> §ä¹L´Á±b¸¹ */ /* 1 ==> «Ø¥ß·s±b¸¹ */ /* should do it by searching "" in the hash */ -int +int searchnewuser(int mode) { register int i, num; @@ -320,7 +320,7 @@ u_namearray(char buf[][IDLEN + 1], int *pnum, char *tag) /* .UTMP cache */ /*-------------------------------------------------------*/ #if !defined(_BBS_UTIL_C_) -void +void setutmpmode(int mode) { if (currstat != mode) @@ -335,31 +335,31 @@ setutmpmode(int mode) } } #endif -static int +static int cmputmpuserid(const void *i, const void *j) { return strcasecmp((*((userinfo_t **) i))->userid, (*((userinfo_t **) j))->userid); } -static int +static int cmputmpmode(const void *i, const void *j) { return (*((userinfo_t **) i))->mode - (*((userinfo_t **) j))->mode; } -static int +static int cmputmpidle(const void *i, const void *j) { return (*((userinfo_t **) i))->lastact - (*((userinfo_t **) j))->lastact; } -static int +static int cmputmpfrom(const void *i, const void *j) { return strcasecmp((*((userinfo_t **) i))->from, (*((userinfo_t **) j))->from); } -static int +static int cmputmpfive(const void *i, const void *j) { int type; @@ -371,7 +371,7 @@ cmputmpfive(const void *i, const void *j) } #if 0 -static int +static int cmputmpsex(const void *i, const void *j) { static int ladyfirst[] = {1, 0, 1, 0, 1, 0, 3, 3}; @@ -379,17 +379,17 @@ cmputmpsex(const void *i, const void *j) ladyfirst[(*(userinfo_t **) j)->sex & 07]; } #endif -static int +static int cmputmppid(const void *i, const void *j) { return (*((userinfo_t **) i))->pid - (*((userinfo_t **) j))->pid; } -static int +static int cmputmpuid(const void *i, const void *j) { return (*((userinfo_t **) i))->uid - (*((userinfo_t **) j))->uid; } -void +void sort_utmp() { userinfo_t *uentp; @@ -446,9 +446,10 @@ sort_utmp() SHM->bcache[i].nuser = nusers[i]; } -//Ptt:³o à ä¥[¤Jhash Æ[©À§äªÅªºutmp - void getnewutmpent(userinfo_t * up) - { +/* Ptt:³o¸Ì¥[¤W hash Æ[©À§äªÅªº utmp */ +void +getnewutmpent(userinfo_t * up) +{ register int i, p; register userinfo_t *uentp; for (i = 0, p = StringHash(up->userid) % USHM_SIZE; i < USHM_SIZE; i++, p++) { @@ -465,7 +466,7 @@ sort_utmp() exit(1); } -int +int apply_ulist(int (*fptr) (userinfo_t *)) { register userinfo_t *uentp; @@ -541,7 +542,7 @@ search_ulistn(int uid, int unum) return 0; } -int +int count_logins(int uid, int show) { register int i = 0, j, start = 0, end = SHM->UTMPnumber - 1, count; @@ -575,7 +576,7 @@ count_logins(int uid, int show) } -void +void purge_utmp(userinfo_t * uentp) { logout_friend_online(uentp); @@ -587,14 +588,14 @@ purge_utmp(userinfo_t * uentp) /*-------------------------------------------------------*/ /* .BOARDS cache */ /*-------------------------------------------------------*/ -void +void touchdircache(int bid) { int *i = (int *)&SHM->dircache[bid - 1][0].filename[0]; *i = 0; } -void +void load_fileheader_cache(int bid, char *direct) { int num = getbtotal(bid); @@ -609,7 +610,7 @@ load_fileheader_cache(int bid, char *direct) } } -int +int get_fileheader_cache(int bid, char *direct, fileheader_t * headers, int recbase, int nlines) { @@ -634,18 +635,18 @@ get_fileheader_cache(int bid, char *direct, fileheader_t * headers, memcpy(headers, &(SHM->dircache[bid - 1][n]), sizeof(fileheader_t) * ret); return ret; } -static int +static int cmpboardname(boardheader_t ** brd, boardheader_t ** tmp) { return strcasecmp((*brd)->brdname, (*tmp)->brdname); } -static int +static int cmpboardclass(boardheader_t ** brd, boardheader_t ** tmp) { return (strncmp((*brd)->title, (*tmp)->title, 4) << 8) + strcasecmp((*brd)->brdname, (*tmp)->brdname); } -static void +static void sort_bcache() { int i; @@ -658,7 +659,7 @@ sort_bcache() qsort(SHM->bsorted[1], SHM->Bnumber, sizeof(boardheader_t *), (QCAST) cmpboardclass); } -static void +static void reload_bcache() { if (SHM->Bbusystate) { @@ -689,7 +690,7 @@ reload_bcache() #endif } -void +void resolve_boards() { while (SHM->Buptime < SHM->Btouchtime) { @@ -698,14 +699,14 @@ resolve_boards() numboards = SHM->Bnumber; } -void +void touch_boards() { SHM->Btouchtime = now; numboards = -1; resolve_boards(); } -void +void addbrd_touchcache() { SHM->Bnumber++; @@ -713,7 +714,7 @@ addbrd_touchcache() reset_board(numboards); } #if !defined(_BBS_UTIL_C_) -void +void reset_board(int bid) { /* Ptt: ³o¼Ë´N¤£¥Î¦Ñ¬Otouch board¤F */ int fd, i, nuser; @@ -745,7 +746,7 @@ reset_board(int bid) } } -int +int apply_boards(int (*func) (boardheader_t *)) { register int i; @@ -765,12 +766,12 @@ getbcache(int bid) { /* Ptt§ï¼g */ return bcache + bid - 1; } -int +int getbtotal(int bid) { return SHM->total[bid - 1]; } -void +void setbtotal(int bid) { boardheader_t *bh = getbcache(bid); @@ -798,7 +799,7 @@ setbtotal(int bid) touchdircache(bid); } -void +void touchbpostnum(int bid, int delta) { int *total = &SHM->total[bid - 1]; @@ -807,7 +808,7 @@ touchbpostnum(int bid, int delta) } -int +int getbnum(char *bname) { register int i = 0, j, start = 0, end = SHM->Bnumber - 1; @@ -830,7 +831,7 @@ getbnum(char *bname) } #if !defined(_BBS_UTIL_C_) -int +int haspostperm(char *bname) { register int i; @@ -871,7 +872,7 @@ haspostperm(char *bname) /* PTT cache */ /*-------------------------------------------------------*/ /* cachefor °ÊºA¬ÝªO© */ -void +void reload_pttcache() { if (SHM->Pbusystate) @@ -942,7 +943,7 @@ reload_pttcache() } } -void +void resolve_garbage() { int count = 0; @@ -951,8 +952,8 @@ resolve_garbage() reload_pttcache(); if (count++ > 10 && SHM->Pbusystate) { /* - * Ptt: ³oÃä·|¦³°ÝÃD load¶W¹L10 ¬í·|©Ò¦³¶iloopªºprocess - * tate = 0 ³o¼Ë·|©Ò¦³prcosee³£·|¦bload °ÊºA¬ÝªO ·|³y¦¨load¤j¼W + * Ptt: ³oÃä·|¦³°ÝÃD load¶W¹L10 ¬í·|©Ò¦³¶iloopªºprocess tate = 0 + * ³o¼Ë·|©Ò¦³prcosee³£·|¦bload °ÊºA¬ÝªO ·|³y¦¨load¤j¼W * ¦ý¨S¦³¥Î³oÓfunctionªº¸Ü ¸U¤@load passwdÀɪºprocess¦º¤F * ¤S¨S¦³¤H§â¥L ¸Ñ¶} ¦P¼Ëªº°ÝÃDµo¥Í¦breload passwd */ @@ -968,7 +969,7 @@ resolve_garbage() /* PTT's cache */ /*-------------------------------------------------------*/ /* cachefor from host »P³Ì¦h¤W½u¤H¼Æ */ -static void +static void reload_fcache() { if (SHM->Fbusystate) @@ -1009,14 +1010,14 @@ reload_fcache() } } -void +void resolve_fcache() { while (SHM->Fuptime < SHM->Ftouchtime) reload_fcache(); } -void +void hbflreload(int bid) { int hbfl[MAX_FRIEND + 1], i, num, uid; @@ -1047,7 +1048,7 @@ hbflreload(int bid) memcpy(SHM->hbfl[bid], hbfl, sizeof(hbfl)); } -int +int hbflcheck(int bid, int uid) { int i; @@ -1074,7 +1075,7 @@ cachepath(const char *fpath) return cpath; } -int +int updatemdcache(const char *CPATH, const char *fpath) { /* @@ -1102,7 +1103,7 @@ updatemdcache(const char *CPATH, const char *fpath) return targetfd; } -int +int mdcacheopen(char *fpath) { int fd; diff --git a/mbbsd/cal.c b/mbbsd/cal.c index f423f8e3..fb0c2802 100644 --- a/mbbsd/cal.c +++ b/mbbsd/cal.c @@ -1,8 +1,8 @@ -/* $Id: cal.c,v 1.17 2002/07/21 08:18:41 in2 Exp $ */ +/* $Id: cal.c,v 1.18 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" /* ¨¾°ô Multi play */ -static int +static int count_multiplay(int unmode) { register int i, j; @@ -17,7 +17,7 @@ count_multiplay(int unmode) return j; } -int +int lockutmpmode(int unmode, int state) { int errorno = 0; @@ -45,7 +45,7 @@ lockutmpmode(int unmode, int state) return 0; } -int +int unlockutmpmode() { currutmp->lockmode = 0; @@ -56,7 +56,7 @@ unlockutmpmode() #define VICE_NEW "vice.new" /* Heat:µo²¼ */ -int +int vice(int money, char *item) { char buf[128]; @@ -82,7 +82,7 @@ vice(int money, char *item) #define SONGBOOK "etc/SONGBOOK" #define OSONGPATH "etc/SONGO" -static int +static int osong(char *defaultid) { char destid[IDLEN + 1], buf[200], genbuf[200], filename[256], @@ -239,14 +239,14 @@ osong(char *defaultid) return 1; } -int +int ordersong() { osong(NULL); return 0; } -static int +static int inmailbox(int m) { passwd_query(usernum, &xuser); @@ -258,7 +258,7 @@ inmailbox(int m) #if !HAVE_FREECLOAK /* ªá¿ú¿ï³æ */ -int +int p_cloak() { char buf[4]; @@ -278,7 +278,7 @@ p_cloak() } #endif -int +int p_from() { char ans[4]; @@ -297,7 +297,7 @@ p_from() return 0; } -int +int p_exmail() { char ans[4], buf[200]; @@ -327,7 +327,7 @@ p_exmail() return 0; } -void +void mail_redenvelop(char *from, char *to, int money, char mode) { char genbuf[200]; @@ -355,7 +355,7 @@ mail_redenvelop(char *from, char *to, int money, char mode) } /* pºâÃØ»Pµ| */ -int +int give_tax(int money) { int i, tax = 0; @@ -369,7 +369,7 @@ give_tax(int money) return (tax <= 0) ? 1 : tax; } -int +int p_give() { int money, tax; @@ -398,7 +398,7 @@ p_give() return 0; } -int +int p_sysinfo(void) { char buf[128], *cpuloadstr; @@ -422,7 +422,7 @@ p_sysinfo(void) } /* ¤ppºâ¾÷ */ -static void +static void ccount(float *a, float b, int cmode) { switch (cmode) { @@ -443,7 +443,7 @@ ccount(float *a, float b, int cmode) } } -int +int cal() { float a = 0; diff --git a/mbbsd/calendar.c b/mbbsd/calendar.c index 13a8ed16..03cd84d6 100644 --- a/mbbsd/calendar.c +++ b/mbbsd/calendar.c @@ -1,4 +1,4 @@ -/* $Id: calendar.c,v 1.5 2002/07/21 08:18:41 in2 Exp $ */ +/* $Id: calendar.c,v 1.6 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" typedef struct event_t { @@ -8,7 +8,7 @@ typedef struct event_t { struct event_t *next; } event_t; -static int +static int MonthDay(int m, int leap) { static int day[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; @@ -16,7 +16,7 @@ MonthDay(int m, int leap) return leap && m == 2 ? 29 : day[m - 1]; } -static int +static int IsLeap(int y) { if (y % 400 == 0 || (y % 4 == 0 && y % 100 != 0)) @@ -25,7 +25,7 @@ IsLeap(int y) return 0; } -static int +static int Days(int y, int m, int d) { int i, w; @@ -38,7 +38,7 @@ Days(int y, int m, int d) return w; } -static int +static int ParseDate(char *date, event_t * t) { char *y, *m, *d; @@ -59,7 +59,7 @@ ParseDate(char *date, event_t * t) return 0; } -static int +static int ParseColor(char *color) { struct { @@ -99,7 +99,7 @@ ParseColor(char *color) return 7; } -static void +static void InsertEvent(event_t * head, event_t * t) { event_t *p; @@ -109,7 +109,7 @@ InsertEvent(event_t * head, event_t * t) p->next = t; } -static void +static void FreeEvent(event_t * e) { event_t *n; @@ -173,7 +173,7 @@ AllocCalBuffer(int line, int len) return p; } -static void +static void FreeCalBuffer(char **buf) { free(buf[0]); @@ -185,7 +185,7 @@ FreeCalBuffer(char **buf) #define HEADER_SUNDAY_COLOR "\33[31m" #define HEADER_DAY_COLOR "\33[33m" -static int +static int GenerateCalendar(char **buf, int y, int m, int today, event_t * e) { static char *week_str[7] = {"¤é", "¤@", "¤G", "¤T", "¥|", "¤", "¤»"}; @@ -258,7 +258,7 @@ GenerateCalendar(char **buf, int y, int m, int today, event_t * e) return line + 1; } -int +int calendar() { char **buf; diff --git a/mbbsd/card.c b/mbbsd/card.c index 2b09d9c2..1c457046 100644 --- a/mbbsd/card.c +++ b/mbbsd/card.c @@ -1,7 +1,7 @@ -/* $Id: card.c,v 1.4 2002/07/05 17:10:27 in2 Exp $ */ +/* $Id: card.c,v 1.5 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" -static int +static int card_remain(int cards[]) { int i, temp = 0; @@ -14,20 +14,20 @@ card_remain(int cards[]) } /* 0 Spare , 1 heart , ...3 dimon */ -static int +static int card_flower(int card) { return (card / 13); } /* 1...13 */ -static int +static int card_number(int card) { return (card % 13 + 1); } -static int +static int card_select(int *now) { char *cc[2] = {"\033[44m \033[m", @@ -75,7 +75,7 @@ card_select(int *now) } } -static void +static void card_display(int cline, int number, int flower, int show) { int color = 31; @@ -132,7 +132,7 @@ card_display(int cline, int number, int flower, int show) } } -static void +static void card_show(int cpu[], int c[], int me[], int m[]) { int i, j; @@ -152,25 +152,25 @@ card_show(int cpu[], int c[], int me[], int m[]) card_display(j + 1, card_number(me[i]), card_flower(me[i]), m[i]); } } -static void +static void card_new(int cards[]) { memset(cards, 0, sizeof(int) * 52); } -static int +static int card_give(int cards[]) { int i, error; for (error = 0, i = rand() % 52; cards[i] == 1 && error < 52; error++, i = rand() % 52); if (error == 52) card_new(cards); -//Ptt:³o à 䦳dead lock ° ÝÃD - cards[i] = 1; + /* Ptt: ³oÃ䦳 dead lock ªº°ÝÃD */ + cards[i] = 1; return i; } -static void +static void card_start(char name[]) { clear(); @@ -184,7 +184,7 @@ card_start(char name[]) prints(" \033[1;37;42m ¦Û ¤v \033[m"); } -static int +static int card_99_add(int i, int aom, int count) { if (i == 4 || i == 5 || i == 11) @@ -199,7 +199,7 @@ card_99_add(int i, int aom, int count) return count + i; } -static int +static int card_99_cpu(int cpu[], int *count) { int stop = -1; @@ -256,7 +256,7 @@ card_99_cpu(int cpu[], int *count) } } -int +int card_99() { int i, j, turn; @@ -340,7 +340,7 @@ card_99() #define JACK (10) /* ¶Â³Ç§JªºTicket */ #define NINE99 (99) /* 99 ªºTicket */ -static int +static int game_log(int type, int money) { FILE *fp; @@ -367,7 +367,7 @@ game_log(int type, int money) return 0; } -static int +static int card_double_ask() { char buf[100], buf2[3]; @@ -383,7 +383,7 @@ card_double_ask() return 0; } -static int +static int card_ask() { char buf[100], buf2[3]; @@ -396,7 +396,7 @@ card_ask() return 0; } -static int +static int card_alls_lower(int all[]) { int i, count = 0; @@ -408,7 +408,7 @@ card_alls_lower(int all[]) return count; } -static int +static int card_alls_upper(int all[]) { int i, count; @@ -420,7 +420,7 @@ card_alls_upper(int all[]) return count; } -static int +static int card_jack(int *db) { int i, j; @@ -531,7 +531,7 @@ card_jack(int *db) return 0; } -int +int g_card_jack() { int db; @@ -559,7 +559,7 @@ g_card_jack() return 0; } -static int +static int card_all(int all[]) { int i, count = 0; @@ -572,7 +572,7 @@ card_all(int all[]) return count; } -static int +static int ten_helf() { int i, j; @@ -633,7 +633,7 @@ ten_helf() return 0; } -int +int g_ten_helf() { char buf[3]; diff --git a/mbbsd/chat.c b/mbbsd/chat.c index 5f709bb2..e852fbf2 100644 --- a/mbbsd/chat.c +++ b/mbbsd/chat.c @@ -1,9 +1,9 @@ -/* $Id: chat.c,v 1.7 2002/07/21 08:18:41 in2 Exp $ */ +/* $Id: chat.c,v 1.8 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" static int chatline, stop_line; static FILE *flog; -static void +static void printchatline(char *str) { move(chatline, 0); @@ -23,7 +23,7 @@ printchatline(char *str) fprintf(flog, "%s\n", str); } -static void +static void chat_clear() { for (chatline = 2; chatline < stop_line; chatline++) { @@ -36,7 +36,7 @@ chat_clear() outs("¡÷"); } -static void +static void print_chatid(char *chatid) { move(b_lines - 1, 0); @@ -45,7 +45,7 @@ print_chatid(char *chatid) outc(':'); } -static int +static int chat_send(int fd, char *buf) { int len; @@ -58,7 +58,7 @@ chat_send(int fd, char *buf) static char chatroom[IDLEN];/* Chat-Room Name */ -static int +static int chat_recv(int fd, char *chatid) { static char buf[512]; @@ -114,7 +114,7 @@ chat_recv(int fd, char *chatid) return 0; } -static int +static int printuserent(userinfo_t * uentp) { static char uline[80]; @@ -145,7 +145,7 @@ printuserent(userinfo_t * uentp) return 0; } -static void +static void chathelp(char *cmd, char *desc) { char buf[STRLEN]; @@ -154,7 +154,7 @@ chathelp(char *cmd, char *desc) printchatline(buf); } -static void +static void chat_help(char *arg) { if (strstr(arg, " op")) { @@ -185,7 +185,7 @@ chat_help(char *arg) } } -static void +static void chat_date() { char genbuf[200]; @@ -194,7 +194,7 @@ chat_date() printchatline(genbuf); } -static void +static void chat_pager() { char genbuf[200]; @@ -205,7 +205,7 @@ chat_pager() printchatline(genbuf); } -static void +static void chat_query(char *arg) { char *uid; @@ -239,7 +239,7 @@ chat_query(char *arg) printchatline(err_uid); } -static void +static void chat_users() { printchatline(""); @@ -266,7 +266,7 @@ static chat_command_t chat_cmdtbl[] = { {NULL, NULL} }; -static int +static int chat_cmd_match(char *buf, char *str) { while (*str && *buf && !isspace(*buf)) @@ -275,7 +275,7 @@ chat_cmd_match(char *buf, char *str) return 1; } -static int +static int chat_cmd(char *buf, int fd) { int i; @@ -331,7 +331,7 @@ select_address() #define MAXLASTCMD 6 static int chatid_len = 10; -int +int t_chat() { char inbuf[80], chatid[20], lastcmd[MAXLASTCMD][80], *ptr = ""; diff --git a/mbbsd/chc_draw.c b/mbbsd/chc_draw.c index 9f4091b1..8c7e556b 100644 --- a/mbbsd/chc_draw.c +++ b/mbbsd/chc_draw.c @@ -1,4 +1,4 @@ -/* $Id: chc_draw.c,v 1.3 2002/07/05 17:10:27 in2 Exp $ */ +/* $Id: chc_draw.c,v 1.4 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" #define SIDE_ROW 10 @@ -51,7 +51,7 @@ static char *hint_str[] = { "Enter ¿ï¾Ü/²¾°Ê" }; -void +void chc_movecur(int r, int c) { move(r * 2 + 3, c * 4 + 4); @@ -63,7 +63,7 @@ chc_movecur(int r, int c) #define RED_REVERSE "\033[1;37;41m" #define TURN_COLOR "\033[1;33m" -static void +static void showstep(board_t board) { int turn, fc, tc, eatten; @@ -98,7 +98,7 @@ showstep(board_t board) prints("\033[m"); } -void +void chc_drawline(board_t board, int line) { int i, j; @@ -173,7 +173,7 @@ chc_drawline(board_t board, int line) } } -void +void chc_redraw(board_t board) { int i; diff --git a/mbbsd/chc_net.c b/mbbsd/chc_net.c index ba52bf26..5a8c5169 100644 --- a/mbbsd/chc_net.c +++ b/mbbsd/chc_net.c @@ -1,10 +1,10 @@ -/* $Id: chc_net.c,v 1.3 2002/07/05 17:10:27 in2 Exp $ */ +/* $Id: chc_net.c,v 1.4 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" typedef struct drc_t { rc_t from, to; } drc_t; -int +int chc_recvmove(int s) { drc_t buf; @@ -15,7 +15,7 @@ chc_recvmove(int s) return 0; } -void +void chc_sendmove(int s) { drc_t buf; diff --git a/mbbsd/chc_play.c b/mbbsd/chc_play.c index 53c0ceff..74a9aadb 100644 --- a/mbbsd/chc_play.c +++ b/mbbsd/chc_play.c @@ -1,4 +1,4 @@ -/* $Id: chc_play.c,v 1.5 2002/07/21 08:18:41 in2 Exp $ */ +/* $Id: chc_play.c,v 1.6 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" typedef int (*play_func_t) (int, board_t, board_t); @@ -13,7 +13,7 @@ static int chc_ipass = 0, chc_hepass = 0; #define MYWIN_ROW 17 #define HISWIN_ROW 18 -static int +static int hisplay(int s, board_t board, board_t tmpbrd) { int start_time; @@ -74,7 +74,7 @@ hisplay(int s, board_t board, board_t tmpbrd) return endgame; } -static int +static int myplay(int s, board_t board, board_t tmpbrd) { int ch, start_time; @@ -177,7 +177,7 @@ myplay(int s, board_t board, board_t tmpbrd) return endgame; } -static void +static void mainloop(int s, board_t board) { int endgame; @@ -215,7 +215,7 @@ mainloop(int s, board_t board) oflush(); } -static void +static void chc_init(int s, board_t board) { userinfo_t *my = currutmp; @@ -252,7 +252,7 @@ chc_init(int s, board_t board) chc_redraw(board); } -void +void chc(int s) { board_t board; diff --git a/mbbsd/chc_rule.c b/mbbsd/chc_rule.c index 62996764..df7964a1 100644 --- a/mbbsd/chc_rule.c +++ b/mbbsd/chc_rule.c @@ -1,9 +1,9 @@ -/* $Id: chc_rule.c,v 1.3 2002/07/05 17:10:27 in2 Exp $ */ +/* $Id: chc_rule.c,v 1.4 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" #define CENTER(a, b) (((a) + (b)) >> 1) -void +void chc_init_board(board_t board) { memset(board, 0, sizeof(board_t)); @@ -26,14 +26,14 @@ chc_init_board(board_t board) board[6][6] = board[6][8] = CHE(7, chc_my); /* §L */ } -void +void chc_movechess(board_t board) { board[chc_to.r][chc_to.c] = board[chc_from.r][chc_from.c]; board[chc_from.r][chc_from.c] = 0; } -static int +static int dist(rc_t from, rc_t to, int rowcol) { int d; @@ -42,7 +42,7 @@ dist(rc_t from, rc_t to, int rowcol) return d > 0 ? d : -d; } -static int +static int between(board_t board, rc_t from, rc_t to, int rowcol) { int i, rtv = 0; @@ -63,7 +63,7 @@ between(board_t board, rc_t from, rc_t to, int rowcol) return rtv; } -int +int chc_canmove(board_t board, rc_t from, rc_t to) { int i; @@ -152,7 +152,7 @@ chc_canmove(board_t board, rc_t from, rc_t to) return 1; } -static void +static void findking(board_t board, int turn, rc_t * buf) { int i, r, c; @@ -167,7 +167,7 @@ findking(board_t board, int turn, rc_t * buf) } } -int +int chc_iskfk(board_t board) { rc_t from, to; @@ -179,7 +179,7 @@ chc_iskfk(board_t board) return 0; } -int +int chc_ischeck(board_t board, int turn) { rc_t from, to; diff --git a/mbbsd/chicken.c b/mbbsd/chicken.c index f9420a43..e42a2a5a 100644 --- a/mbbsd/chicken.c +++ b/mbbsd/chicken.c @@ -1,4 +1,4 @@ -/* $Id: chicken.c,v 1.7 2002/07/21 08:18:41 in2 Exp $ */ +/* $Id: chicken.c,v 1.8 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" #define NUM_KINDS 13 /* ¦³¦h¤ÖºØ°Êª« */ @@ -79,7 +79,7 @@ static const int time_change[NUM_KINDS][14] = {1, 1, 147, 2, 10, 10, 85, 20, 4, 25, 25, 5, 145, 95} }; -int +int reload_chicken() { passwd_query(usernum, &xuser); @@ -92,7 +92,7 @@ reload_chicken() #define CHICKENLOG "etc/chicken" -static int +static int new_chicken() { char buf[150]; @@ -151,7 +151,7 @@ new_chicken() return 1; } -int +int show_file(char *filename, int y, int lines, int mode) { FILE *fp; @@ -169,7 +169,7 @@ show_file(char *filename, int y, int lines, int mode) return 1; } -static void +static void show_chicken_stat(chicken_t * thechicken) { struct tm *ptime; @@ -202,7 +202,7 @@ show_chicken_stat(chicken_t * thechicken) #define CHICKEN_PIC "etc/chickens" -void +void show_chicken_data(chicken_t * thechicken, chicken_t * pkchicken) { char buf[1024]; @@ -271,7 +271,7 @@ show_chicken_data(chicken_t * thechicken, chicken_t * pkchicken) } } -static void +static void ch_eat() { if (mychicken->food) { @@ -290,7 +290,7 @@ ch_eat() } } -static void +static void ch_clean() { mychicken->clean = 0; @@ -300,7 +300,7 @@ ch_clean() pressanykey(); } -static void +static void ch_guess() { char *guess[3] = {"°Å¤M", "¥ÛÀY", "¥¬"}, me, ch, win; @@ -325,7 +325,7 @@ ch_guess() pressanykey(); } -static void +static void ch_book() { mychicken->book += time_change[(int)mychicken->type][BOOK]; @@ -334,7 +334,7 @@ ch_book() pressanykey(); } -static void +static void ch_kiss() { mychicken->happy += time_change[(int)mychicken->type][HAPPY]; @@ -345,7 +345,7 @@ ch_kiss() pressanykey(); } -static void +static void ch_hit() { mychicken->attack += time_change[(int)mychicken->type][ATTACK]; @@ -366,7 +366,7 @@ ch_hit() pressanykey(); } -void +void ch_buyitem(int money, char *picture, int *item) { int num = 0; @@ -390,7 +390,7 @@ ch_buyitem(int money, char *picture, int *item) pressanykey(); } -static void +static void ch_eatoo() { if (mychicken->oo > 0) { @@ -403,7 +403,7 @@ ch_eatoo() } } -static void +static void ch_eatmedicine() { if (mychicken->medicine > 0) { @@ -419,7 +419,7 @@ ch_eatmedicine() } } -static void +static void ch_kill() { char buf[150], ans[4]; @@ -439,7 +439,7 @@ ch_kill() } } -static int +static int ch_sell() { /* @@ -503,7 +503,7 @@ ch_sell() return 0; } -static void +static void geting_old(int *hp, int *weight, int diff, int age) { float ex = 0.9; @@ -523,7 +523,7 @@ geting_old(int *hp, int *weight, int diff, int age) } /* ¨Ì®É¶¡Åܰʪº¸ê®Æ */ -void +void time_diff(chicken_t * thechicken) { int diff; @@ -607,7 +607,7 @@ time_diff(chicken_t * thechicken) thechicken->mm = thechicken->mm_max; } -static void +static void check_sick() { /* ż¯fªº */ @@ -624,7 +624,7 @@ check_sick() } } -static int +static int deadtype(chicken_t * thechicken) { int i; @@ -657,7 +657,7 @@ deadtype(chicken_t * thechicken) return i; } -int +int showdeadth(int type) { switch (type) { @@ -683,7 +683,7 @@ showdeadth(int type) return type; } -int +int isdeadth(chicken_t * thechicken) { int i; @@ -693,7 +693,7 @@ isdeadth(chicken_t * thechicken) return showdeadth(i); } -static void +static void ch_changename() { char buf[150], newname[20] = ""; @@ -712,7 +712,7 @@ ch_changename() } } -static int +static int select_menu() { char ch; @@ -800,7 +800,7 @@ select_menu() return 1; } -static int +static int recover_chicken(chicken_t * thechicken) { char buf[200]; @@ -853,7 +853,7 @@ recover_chicken(chicken_t * thechicken) #define lockreturn0(unmode, state) if(lockutmpmode(unmode, state)) return 0 -int +int chicken_main() { lockreturn0(CHICKEN, LOCK_MULTI); @@ -876,7 +876,7 @@ chicken_main() return 0; } -int +int chickenpk(int fd) { char mateid[IDLEN + 1], data[200], buf[200]; diff --git a/mbbsd/dark.c b/mbbsd/dark.c index f464bf11..cd37fd0b 100644 --- a/mbbsd/dark.c +++ b/mbbsd/dark.c @@ -1,4 +1,4 @@ -/* $Id: dark.c,v 1.6 2002/07/21 08:18:41 in2 Exp $ */ +/* $Id: dark.c,v 1.7 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" #define RED 1 @@ -21,11 +21,10 @@ static char *bname[] = {"¨ò", "¥]", "°¨", "¨®", "¶H", "¤h", "±N"}; static sint cury[] = {3, 5, 7, 9}, curx[] = {5, 9, 13, 17, 21, 25, 29, 33}; static sint rcount, bcount, cont, fix; /* cont:¬O§_¥i³s¦Y */ -static sint my = 0, mx = 0, mly = -1, mlx = -1; /* ²¾°Êªº®y¼Ð - * ¼Ð */ +static sint my = 0, mx = 0, mly = -1, mlx = -1; /* ²¾°Êªº®y¼Ð ¼Ð */ static sint cur_eaty, cur_eatx; /* ¦Y±¼¹ï¤è¨ä¤lªº¨q¥X®y¼Ð */ -static void +static void brdswap(sint y, sint x, sint ly, sint lx) { memcpy(&brd[y][x], &brd[ly][lx], sizeof(item)); @@ -34,7 +33,7 @@ brdswap(sint y, sint x, sint ly, sint lx) brd[ly][lx].value = -1; } -static void +static void pprints(sint y, sint x, char *s) { move(y, x); @@ -42,7 +41,7 @@ pprints(sint y, sint x, char *s) prints("%s", s); } -static sint +static sint Is_win(item att, item det, sint y, sint x, sint ly, sint lx) { sint i, c = 0, min, max; @@ -95,7 +94,7 @@ Is_win(item att, item det, sint y, sint x, sint ly, sint lx) return 0; } -static sint +static sint Is_move(sint y, sint x, sint ly, sint lx) { if (brd[y][x].die == 1 && ((abs(ly - y) == 1 && x == lx) || (abs(lx - x) == 1 && ly == y))) @@ -103,7 +102,7 @@ Is_move(sint y, sint x, sint ly, sint lx) return 0; } -static void +static void brd_rand() { sint y, x, index; @@ -128,7 +127,7 @@ brd_rand() } } -static void +static void brd_prints() { clear(); @@ -146,7 +145,7 @@ brd_prints() " "); } -static void +static void draw_line(sint y, sint f) { sint i; @@ -175,7 +174,7 @@ draw_line(sint y, sint f) prints("%s", buf); } -static void +static void redraw() { sint i = 0; @@ -183,7 +182,7 @@ redraw() draw_line(i, -1); } -static sint +static sint playing(sint fd, sint color, sint ch, sint * b, userinfo_t * uin) { curr.end = 0; @@ -354,7 +353,7 @@ playing(sint fd, sint color, sint ch, sint * b, userinfo_t * uin) return 0; } -int +int main_dark(int fd, userinfo_t * uin) { sint end = 0, ch = 1, go_on, i = 0, cont = 0; @@ -362,8 +361,8 @@ main_dark(int fd, userinfo_t * uin) *buf = 0; fix = 0; currutmp->color = '.'; - //'.' ª í¥ÜÁÙ¨S ¨ M © w à C ¦ â - rcount = 16; + /* '.' ªí¥ÜÁÙ¨S¨M©wÃC¦â */ + rcount = 16; bcount = 16; //initialize cur_eaty = 18, cur_eatx = 5; diff --git a/mbbsd/descrypt.c b/mbbsd/descrypt.c index ede4f9f3..30d33b8b 100644 --- a/mbbsd/descrypt.c +++ b/mbbsd/descrypt.c @@ -1,4 +1,4 @@ -/* $Id: descrypt.c,v 1.3 2002/07/05 17:10:27 in2 Exp $ */ +/* $Id: descrypt.c,v 1.4 2002/07/21 09:26:02 in2 Exp $ */ /* * FreeSec: libcrypt for NetBSD @@ -185,7 +185,7 @@ static unsigned char ascii64[] = /* 0000000000111111111122222222223333333333444444444455555555556666 */ /* 0123456789012345678901234567890123456789012345678901234567890123 */ -static int +static int ascii_to_bin(char ch) { if (ch > 'z') @@ -203,7 +203,7 @@ ascii_to_bin(char ch) return 0; } -static void +static void des_init() { int i, j, b, k, inbit, obit; @@ -333,7 +333,7 @@ des_init() des_initialised = 1; } -static void +static void setup_salt(long salt) { unsigned long obit, saltbit; @@ -354,7 +354,7 @@ setup_salt(long salt) } } -static int +static int des_setkey(const char *key) { unsigned long k0, k1, rawkey0, rawkey1; @@ -433,7 +433,7 @@ des_setkey(const char *key) return 0; } -static int +static int do_des(unsigned long l_in, unsigned long r_in, unsigned long *l_out, unsigned long *r_out, int count) { diff --git a/mbbsd/dice.c b/mbbsd/dice.c index 62aeba16..69d7486f 100644 --- a/mbbsd/dice.c +++ b/mbbsd/dice.c @@ -1,4 +1,4 @@ -/* $Id: dice.c,v 1.4 2002/07/05 17:10:27 in2 Exp $ */ +/* $Id: dice.c,v 1.5 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" #define DICE_TXT BBSHOME "/etc/dice.txt" @@ -19,7 +19,7 @@ typedef struct dicedata_t { int mymoney; } dicedata_t; -static void +static void set_bingo(int bet[]) { int i, j = 0, k = 0, m = 0; @@ -64,13 +64,13 @@ set_bingo(int bet[]) } } -static int +static int bingo(int mybet) { return flag[mybet]; } -int +int IsNum(char *a, int n) { int i; @@ -81,7 +81,7 @@ IsNum(char *a, int n) return 1; } -int +int IsSNum(char *a) { int i; @@ -92,7 +92,7 @@ IsSNum(char *a) return 1; } -static void +static void show_data(void) { move(0, 0); @@ -122,7 +122,7 @@ show_data(void) "¢w¢w¢w¢w¢w¢w¢w¢w¢w¢}\033[m\n"); } -static void +static void show_count(int index, int money) { int i = 0, count = 2, j, k; @@ -164,7 +164,7 @@ show_count(int index, int money) prints("[83]:%d", value[83]); } -static int +static int check_index(int index) { int i, tp[] = {1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 14, 15, 16, 23, 24, 25, @@ -177,7 +177,7 @@ check_index(int index) return 0; } -static int +static int del(int total, dicedata_t * table) { int index, money; @@ -220,7 +220,7 @@ del(int total, dicedata_t * table) return 0; } -static int +static int IsLegal(char *data) { int money = atoi(data); @@ -229,7 +229,7 @@ IsLegal(char *data) return 0; } -static void +static void show_output(int bet[]) { int i, j = 10; @@ -326,7 +326,7 @@ show_output(int bet[]) #define lockreturn0(unmode, state) if(lockutmpmode(unmode, state)) return 0 -int +int dice_main(void) { char input[10], data[256], ch; diff --git a/mbbsd/edit.c b/mbbsd/edit.c index d7680380..212f893b 100644 --- a/mbbsd/edit.c +++ b/mbbsd/edit.c @@ -1,4 +1,4 @@ -/* $Id: edit.c,v 1.13 2002/07/21 08:18:41 in2 Exp $ */ +/* $Id: edit.c,v 1.14 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" typedef struct textline_t { struct textline_t *prev; @@ -42,14 +42,14 @@ static int insert_c = ' '; static char fp_bak[] = "bak"; /* °O¾ÐÅéºÞ²z»P½s¿è³B²z */ -static void +static void indigestion(i) { fprintf(stderr, "ÄY«¤º¶Ë %d\n", i); } /* Thor: ansi ®y¼ÐÂà´« for color ½s¿è¼Ò¦¡ */ -static int +static int ansi2n(int ansix, textline_t * line) { register char *data, *tmp; @@ -73,7 +73,7 @@ ansi2n(int ansix, textline_t * line) return tmp - data; } -static int +static int n2ansi(int nx, textline_t * line) { register int ansix = 0; @@ -100,7 +100,7 @@ n2ansi(int nx, textline_t * line) } /* ¿Ã¹õ³B²z¡G»²§U°T®§¡BÅã¥Ü½s¿è¤º®e */ -static void +static void edit_msg() { static char *edit_mode[2] = {"¨ú¥N", "´¡¤J"}; @@ -149,7 +149,7 @@ forward_line(textline_t * pos, int num) return pos; } -static int +static int getlineno() { int cnt = 0; @@ -185,7 +185,7 @@ alloc_line() } /* append p after line in list. keeps up with last line */ -static void +static void append(textline_t * p, textline_t * line) { register textline_t *n; @@ -203,7 +203,7 @@ append(textline_t * p, textline_t * line) * firstline pointers. */ -static void +static void delete_line(textline_t * line) { register textline_t *p = line->prev; @@ -227,7 +227,7 @@ delete_line(textline_t * line) totaln--; } -static int +static int ask(char *prompt) { int ch; @@ -243,7 +243,7 @@ ask(char *prompt) return (ch); } -static int +static int indent_spcs() { textline_t *p; @@ -261,7 +261,7 @@ indent_spcs() } /* split 'line' right before the character pos */ -static void +static void split(textline_t * line, int pos) { if (pos <= line->len) { @@ -292,7 +292,7 @@ split(textline_t * line, int pos) } } -static void +static void insert_char(int ch) { register textline_t *p = currline; @@ -340,7 +340,7 @@ insert_char(int ch) } } -static void +static void insert_string(char *str) { int ch; @@ -357,7 +357,7 @@ insert_string(char *str) } } -static int +static int undelete_line() { textline_t *p = deleted_lines; @@ -389,7 +389,7 @@ undelete_line() * 1) lines were joined and one was deleted 2) lines could not be joined 3) * next line is empty returns false if: 1) Some of the joined line wrapped */ -static int +static int join(textline_t * line) { register textline_t *n; @@ -435,7 +435,7 @@ join(textline_t * line) } } -static void +static void delete_char() { register int len; @@ -454,7 +454,7 @@ delete_char() } } -static void +static void load_file(FILE * fp) { int indent_mode0 = indent_mode; @@ -481,7 +481,7 @@ ask_tmpbuf(int y) return fp_buf; } -static void +static void read_tmpbuf(int n) { FILE *fp; @@ -512,7 +512,7 @@ read_tmpbuf(int n) } } -static void +static void write_tmpbuf() { FILE *fp; @@ -537,7 +537,7 @@ write_tmpbuf() } } -static void +static void erase_tmpbuf() { char fp_tmpbuf[80]; @@ -552,7 +552,7 @@ erase_tmpbuf() } /* ½s¿è¾¹¦Û°Ê³Æ¥÷ */ -void +void auto_backup() { if (currline) { @@ -574,7 +574,7 @@ auto_backup() } } -void +void restore_backup() { char bakfile[80], buf[80]; @@ -593,7 +593,7 @@ restore_backup() } /* ¤Þ¥Î¤å³¹ */ -static int +static int garbage_line(char *str) { int qlevel = 0; @@ -614,7 +614,7 @@ garbage_line(char *str) return (*str == '\n'); } -static void +static void do_quote() { int op; @@ -688,7 +688,7 @@ do_quote() } /* ¼f¬d user ¤Þ¨¥ªº¨Ï¥Î */ -static int +static int check_quote() { register textline_t *p = firstline; @@ -729,7 +729,7 @@ check_quote() } /* Àɮ׳B²z¡GŪÀÉ¡B¦sÀÉ¡B¼ÐÃD¡Bñ¦WÀÉ */ -static void +static void read_file(char *fpath) { FILE *fp; @@ -745,7 +745,7 @@ read_file(char *fpath) load_file(fp); } -void +void write_header(FILE * fp) { @@ -833,7 +833,7 @@ write_header(FILE * fp) fprintf(fp, "¼ÐÃD: %s\n®É¶¡: %s\n", save_title, ctime(&now)); } -void +void addsignature(FILE * fp, int ifuseanony) { FILE *fs; @@ -1034,7 +1034,7 @@ write_file(char *fpath, int saveheader, int *islocal) } -static void +static void display_buffer() { register textline_t *p; @@ -1100,7 +1100,7 @@ display_buffer() edit_msg(); } -static void +static void goto_line(int lino) { char buf[10]; @@ -1158,7 +1158,7 @@ strcasestr(const char *big, const char *little) /* * mode: 0: prompt 1: forward -1: backward */ -static void +static void search_str(int mode) { static char str[65]; @@ -1218,7 +1218,7 @@ search_str(int mode) redraw_everything = YEA; } -static void +static void match_paren() { static char parens[] = "()[]{}"; @@ -1339,7 +1339,7 @@ p_outscan: } } -static void +static void block_del(int hide) { if (blockln < 0) { @@ -1471,7 +1471,7 @@ block_del(int hide) } } -static void +static void block_shift_left() { textline_t *begin, *end, *p; @@ -1499,7 +1499,7 @@ block_shift_left() redraw_everything = YEA; } -static void +static void block_shift_right() { textline_t *begin, *end, *p; @@ -1531,7 +1531,7 @@ block_shift_right() redraw_everything = YEA; } -static void +static void transform_to_color(char *line) { while (line[0] && line[1]) @@ -1542,7 +1542,7 @@ transform_to_color(char *line) ++line; } -static void +static void block_color() { textline_t *begin, *end, *p; @@ -1566,7 +1566,7 @@ block_color() } /* ½s¿è³B²z¡G¥Dµ{¦¡¡BÁä½L³B²z */ -int +int vedit(char *fpath, int saveheader, int *islocal) { FILE *fp1; diff --git a/mbbsd/friend.c b/mbbsd/friend.c index 2753282c..6029bfd8 100644 --- a/mbbsd/friend.c +++ b/mbbsd/friend.c @@ -1,4 +1,4 @@ -/* $Id: friend.c,v 1.10 2002/07/21 08:18:41 in2 Exp $ */ +/* $Id: friend.c,v 1.11 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" /* ------------------------------------- */ @@ -47,7 +47,7 @@ static char *friend_list[8] = { "¬ÝªO¦n¤Í¦W³æ" }; -static void +static void setfriendfile(char *fpath, int type) { if (type <= 4) /* user list Ptt */ @@ -56,7 +56,7 @@ setfriendfile(char *fpath, int type) setbfile(fpath, currboard, friend_file[type]); } -static int +static int friend_count(char *fname) { FILE *fp; @@ -78,7 +78,7 @@ friend_count(char *fname) return count; } -void +void friend_add(char *uident, int type) { char fpath[80]; @@ -107,7 +107,7 @@ friend_add(char *uident, int type) } } -static void +static void friend_special() { char genbuf[70], i, fname[70]; @@ -138,7 +138,7 @@ friend_special() } } -static void +static void friend_append(int type, int count) { char fpath[80], i, j, buf[80], sfile[80]; @@ -201,7 +201,7 @@ friend_append(int type, int count) } } -void +void friend_delete(char *uident, int type) { FILE *fp, *nfp; @@ -223,7 +223,7 @@ friend_delete(char *uident, int type) } } -static void +static void friend_editdesc(char *uident, int type) { FILE *fp, *nfp; @@ -248,7 +248,7 @@ friend_editdesc(char *uident, int type) } } -void +void friend_load() { FILE *fp; @@ -289,7 +289,7 @@ friend_load() login_friend_online(); } -static void +static void friend_water(char *message, int type) { /* ¸sÅé¤ô²y added by Ptt */ char fpath[80], line[80], userid[IDLEN + 1]; @@ -310,7 +310,7 @@ friend_water(char *message, int type) fclose(fp); } -void +void friend_edit(int type) { char fpath[80], line[80], uident[20]; @@ -444,14 +444,14 @@ friend_edit(int type) } } -int +int t_override() { friend_edit(FRIEND_OVERRIDE); return 0; } -int +int t_reject() { friend_edit(FRIEND_REJECT); diff --git a/mbbsd/gamble.c b/mbbsd/gamble.c index 1fa62e13..97961898 100644 --- a/mbbsd/gamble.c +++ b/mbbsd/gamble.c @@ -1,4 +1,4 @@ -/* $Id: gamble.c,v 1.26 2002/07/21 08:18:41 in2 Exp $ */ +/* $Id: gamble.c,v 1.27 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" #ifndef _BBS_UTIL_C_ @@ -9,7 +9,7 @@ static char betname[MAX_ITEM][MAX_ITEM_LEN]; static int currbid; -int +int post_msg(char *bname, char *title, char *msg, char *author) { FILE *fp; @@ -42,7 +42,7 @@ post_msg(char *bname, char *title, char *msg, char *author) return 0; } -int +int post_file(char *bname, char *title, char *filename, char *author) { int size = dashs(filename); @@ -63,7 +63,7 @@ post_file(char *bname, char *title, char *filename, char *author) } -static int +static int load_ticket_record(char *direct, int ticket[]) { char buf[256]; @@ -78,7 +78,7 @@ load_ticket_record(char *direct, int ticket[]) return total; } -static int +static int show_ticket_data(char *direct, int *price, boardheader_t * bh) { int i, count, total = 0, end = 0, ticket[MAX_ITEM] = {0, 0, 0, 0, 0, 0, 0, 0}; @@ -89,7 +89,7 @@ show_ticket_data(char *direct, int *price, boardheader_t * bh) if (bh) { sprintf(genbuf, "%s ½ä½L", bh->brdname); if (bh->endgamble && now < bh->endgamble && bh->endgamble - now < 3600) { - sprintf(t, "«Ê½LË¼Æ %d ¬í", bh->endgamble - now); + sprintf(t, "«Ê½LË¼Æ %d ¬í", (int)(bh->endgamble - now)); showtitle(genbuf, t); } else showtitle(genbuf, BBSNAME); @@ -146,7 +146,7 @@ show_ticket_data(char *direct, int *price, boardheader_t * bh) return count; } -static void +static void append_ticket_record(char *direct, int ch, int n, int count) { FILE *fp; @@ -169,7 +169,7 @@ append_ticket_record(char *direct, int ch, int n, int count) } #define lockreturn0(unmode, state) if(lockutmpmode(unmode, state)) return 0 -int +int ticket(int bid) { int ch, n, price, count, end = 0; @@ -223,7 +223,7 @@ ticket(int bid) return 0; } -int +int openticket(int bid) { char path[128], buf[256], outcome[128]; @@ -256,8 +256,8 @@ openticket(int bid) } while (bet != atoi(buf)); if (fork()) { - //Ptt ¥ Îfork ¨ ¾¤î¤£¥¿±`Â_ ½ u ¬ ~¿ú - move(22, 0); + /* Ptt: ¥Î fork() ¨¾¤î¤£¥¿±`Â_½u¬~¿ú */ + move(22, 0); prints("¨t²Î±N©óµy«á¦Û°Ê§â¤¤¼úµ²ªG¤½§G©ó¬ÝªO Y°Ñ¥[ªÌ¦h·|»Ýn´X¤ÀÄÁ®É¶¡.."); pressanykey(); unlockutmpmode(); @@ -376,7 +376,7 @@ openticket(int bid) return 0; } -int +int ticket_main() { ticket(0); diff --git a/mbbsd/gomo.c b/mbbsd/gomo.c index 49a1694a..c6870e3f 100644 --- a/mbbsd/gomo.c +++ b/mbbsd/gomo.c @@ -1,4 +1,4 @@ -/* $Id: gomo.c,v 1.7 2002/07/21 08:18:41 in2 Exp $ */ +/* $Id: gomo.c,v 1.8 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" static char *chess[] = {"¡´", "¡³"}; @@ -11,7 +11,7 @@ typedef struct { static Horder_t *v, pool[225]; -static void +static void HO_init() { memset(pool, 0, sizeof(pool)); @@ -21,13 +21,13 @@ HO_init() memset(ku, 0, sizeof(ku)); } -static void +static void HO_add(Horder_t * mv) { *v++ = *mv; } -static void +static void HO_undo(Horder_t * mv) { char *str = "¢z¢s¢{¢u¢q¢t¢|¢r¢}"; @@ -42,7 +42,7 @@ HO_undo(Horder_t * mv) prints("%.2s", str + loc); } -static void +static void HO_log(char *user) { int i; @@ -82,7 +82,7 @@ HO_log(char *user) unlink(buf); } -static int +static int countgomo() { Horder_t *ptr; @@ -96,7 +96,7 @@ countgomo() return i; } -static int +static int chkmv(Horder_t * mv, int color, int limit) { char *xtype[] = {"\033[1;31m¸õ¤T\033[m", "\033[1;31m¬¡¤T\033[m", @@ -114,7 +114,7 @@ chkmv(Horder_t * mv, int color, int limit) return chkwin(rule, limit); } -static int +static int gomo_key(int fd, int ch, Horder_t * mv) { if (ch >= 'a' && ch <= 'o') { @@ -157,7 +157,7 @@ gomo_key(int fd, int ch, Horder_t * mv) return 0; } -static int +static int reload_gomo() { passwd_query(usernum, &xuser); @@ -167,7 +167,7 @@ reload_gomo() return 0; } -int +int gomoku(int fd) { Horder_t mv; diff --git a/mbbsd/gomo1.c b/mbbsd/gomo1.c index 462ceb47..260ce88f 100644 --- a/mbbsd/gomo1.c +++ b/mbbsd/gomo1.c @@ -1,18 +1,18 @@ -/* $Id: gomo1.c,v 1.3 2002/07/05 17:10:27 in2 Exp $ */ +/* $Id: gomo1.c,v 1.4 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" #define QCAST int (*)(const void *, const void *) /* pattern and advance map */ -static int +static int intrevcmp(const void *a, const void *b) { return (*(int *)b - *(int *)a); } /* x,y: 0..BRDSIZ-1 ; color: CBLACK,CWHITE ; dx,dy: -1,0,+1 */ -static int +static int gomo_getindex(int x, int y, int color, int dx, int dy) { int i, k, n; @@ -36,7 +36,7 @@ gomo_getindex(int x, int y, int color, int dx, int dy) return n; } -int +int chkwin(int style, int limit) { if (style == 0x0c) @@ -52,7 +52,7 @@ chkwin(int style, int limit) } /* x,y: 0..BRDSIZ-1 ; color: CBLACK,CWHITE ; limit:1,0 ; dx,dy: 0,1 */ -static int +static int dirchk(int x, int y, int color, int limit, int dx, int dy) { int le, ri, loc, style = 0; @@ -100,7 +100,7 @@ dirchk(int x, int y, int color, int limit, int dx, int dy) /* ¥|¤T=7 ¬¡¥|=6 Â_¥|=5 ¦º¥|=4 ¬¡¤T=3 Â_¤T=2 «O¯d=1 µL®Ä=0 */ /* x,y: 0..BRDSIZ-1 ; color: CBLACK,CWHITE ; limit: 1,0 */ -int +int getstyle(int x, int y, int color, int limit) { int i, j, dir[4], style; diff --git a/mbbsd/guess.c b/mbbsd/guess.c index 1f683ce2..654f45dc 100644 --- a/mbbsd/guess.c +++ b/mbbsd/guess.c @@ -1,8 +1,8 @@ -/* $Id: guess.c,v 1.4 2002/07/05 17:10:27 in2 Exp $ */ +/* $Id: guess.c,v 1.5 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" #define LOGPASS BBSHOME "/etc/winguess.log" -static void +static void show_table(char TABLE[], char ifcomputer) { int i; @@ -22,7 +22,7 @@ show_table(char TABLE[], char ifcomputer) prints("\033[33m=================\033[m"); } -static unsigned long int +static unsigned long int get_money(void) { int money, i; @@ -57,7 +57,7 @@ get_money(void) return money; } -static int +static int check_data(char *str) { int i, j; @@ -86,7 +86,7 @@ get_data(int count) return data; } -static int +static int guess_play(char *data, char *answer, int count) { int A_num = 0, B_num = 0; @@ -110,7 +110,7 @@ guess_play(char *data, char *answer, int count) return 0; } -static int +static int result(int correct, int number) { char a = 0, b = 0, i, j; @@ -130,7 +130,7 @@ result(int correct, int number) return 10 * a + b; } -static int +static int legal(int number) { char i, j; @@ -144,7 +144,7 @@ legal(int number) return 1; } -static void +static void initcomputer(char flag[]) { int i; @@ -156,7 +156,7 @@ initcomputer(char flag[]) flag[i] = 0; } -static int +static int computer(int correct, int total, char flag[], int n[]) { int guess; @@ -192,7 +192,7 @@ computer(int correct, int total, char flag[], int n[]) return 0; } -static void +static void Diff_Random(char *answer) { register int i = 0, j, k; @@ -212,7 +212,7 @@ Diff_Random(char *answer) #define lockreturn0(unmode, state) if(lockutmpmode(unmode, state)) return 0 -int +int guess_main() { unsigned long int money; diff --git a/mbbsd/indict.c b/mbbsd/indict.c index 6e44c612..13030880 100644 --- a/mbbsd/indict.c +++ b/mbbsd/indict.c @@ -1,9 +1,9 @@ -/* $Id: indict.c,v 1.6 2002/07/21 08:18:41 in2 Exp $ */ +/* $Id: indict.c,v 1.7 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" #define REFER "etc/dicts" -static void +static void addword(char word[]) { char buf[150], temp[150], a[3]; @@ -33,7 +33,7 @@ addword(char word[]) clear(); } -static int +static int choose_dict(void) { int c; @@ -80,7 +80,7 @@ lower(char str[]) return temp; } -int +int use_dict() { FILE *fp; @@ -177,7 +177,7 @@ use_dict() } } -int +int x_dict() { if (choose_dict()) @@ -1,4 +1,4 @@ -/* $Id: io.c,v 1.19 2002/07/21 08:18:41 in2 Exp $ */ +/* $Id: io.c,v 1.20 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" #if defined(linux) @@ -17,7 +17,7 @@ static int icurrchar = 0; /* output routines */ /* ----------------------------------------------------- */ -void +void oflush() { if (obufsize) { @@ -26,13 +26,13 @@ oflush() } } -void +void init_buf() { memset(inbuf, 0, IBUFSIZE); } -void +void output(char *s, int len) { /* Invalid if len >= OBUFSIZE */ @@ -45,7 +45,7 @@ output(char *s, int len) obufsize += len; } -int +int ochar(int c) { if (obufsize > OBUFSIZE - 1) { @@ -64,7 +64,7 @@ static int i_newfd = 0; static struct timeval i_to, *i_top = NULL; static int (*flushf) () = NULL; -void +void add_io(int fd, int timeout) { i_newfd = fd; @@ -77,7 +77,7 @@ add_io(int fd, int timeout) i_top = NULL; } -int +int num_in_buf() { return icurrchar - ibufsize; @@ -89,7 +89,7 @@ num_in_buf() * be inconsistent. We try to not segfault here... */ -static int +static int dogetch() { int len; @@ -147,7 +147,7 @@ dogetch() } static int water_which_flag = 0; -int +int igetch() { register int ch; @@ -301,7 +301,7 @@ igetch() return 0; } -int +int oldgetdata(int line, int col, char *prompt, char *buf, int len, int echo) { register int ch, i; @@ -481,7 +481,7 @@ oldgetdata(int line, int col, char *prompt, char *buf, int len, int echo) } /* Ptt */ -int +int getdata_buf(int line, int col, char *prompt, char *buf, int len, int echo) { return oldgetdata(line, col, prompt, buf, len, echo); @@ -496,7 +496,7 @@ getans(char *prompt) return ans[0]; } -int +int getdata_str(int line, int col, char *prompt, char *buf, int len, int echo, char *defaultstr) { strncpy(buf, defaultstr, len); @@ -505,7 +505,7 @@ getdata_str(int line, int col, char *prompt, char *buf, int len, int echo, char return oldgetdata(line, col, prompt, buf, len, echo); } -int +int getdata(int line, int col, char *prompt, char *buf, int len, int echo) { buf[0] = 0; @@ -530,7 +530,7 @@ rget(int x, char *prompt) } -int +int igetkey() { int mode; diff --git a/mbbsd/kaede.c b/mbbsd/kaede.c index e1ccd1b5..252984be 100644 --- a/mbbsd/kaede.c +++ b/mbbsd/kaede.c @@ -1,4 +1,4 @@ -/* $Id: kaede.c,v 1.9 2002/07/20 13:40:12 in2 Exp $ */ +/* $Id: kaede.c,v 1.10 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" char * @@ -55,7 +55,7 @@ Ptt_prints(char *str, int mode) return str; } -int +int Rename(char *src, char *dst) { char buf[256]; @@ -70,7 +70,7 @@ Rename(char *src, char *dst) return -1; } -int +int Link(char *src, char *dst) { char cmd[200]; diff --git a/mbbsd/lovepaper.c b/mbbsd/lovepaper.c index 1bd4a125..0ab78aa4 100644 --- a/mbbsd/lovepaper.c +++ b/mbbsd/lovepaper.c @@ -1,8 +1,8 @@ -/* $Id: lovepaper.c,v 1.8 2002/07/21 08:18:41 in2 Exp $ */ +/* $Id: lovepaper.c,v 1.9 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" #define DATA "etc/lovepaper.dat" -int +int x_love() { char buf1[200], save_title[TTLEN + 1]; diff --git a/mbbsd/mail.c b/mbbsd/mail.c index f8b1ebe3..d5426163 100644 --- a/mbbsd/mail.c +++ b/mbbsd/mail.c @@ -1,4 +1,4 @@ -/* $Id: mail.c,v 1.20 2002/07/21 08:18:41 in2 Exp $ */ +/* $Id: mail.c,v 1.21 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" char currmaildir[32]; static char msg_cc[] = "\033[32m[¸s²Õ¦W³æ]\033[m\n"; @@ -6,7 +6,7 @@ static char listfile[] = "list.0"; static int mailkeep = 0, mailsum = 0; static int mailsumlimit = 0, mailmaxkeep = 0; -int +int setforward() { char buf[80], ip[50] = "", yn[4]; @@ -41,7 +41,7 @@ setforward() return 0; } -int +int built_mail_index() { char genbuf[128]; @@ -61,7 +61,7 @@ built_mail_index() return 0; } -int +int mailalert(char *userid) { userinfo_t *uentp = NULL; @@ -77,14 +77,14 @@ mailalert(char *userid) return 0; } -int +int mail_muser(userec_t muser, char *title, char *filename) { return mail_id(muser.userid, title, filename, cuser.userid); } /* Heat: ¥Îid¨Ó±H«H,¤º®e«hlink·Ç³Æ¦nªºÀÉ®× */ -int +int mail_id(char *id, char *title, char *filename, char *owner) { fileheader_t mhdr; @@ -102,7 +102,7 @@ mail_id(char *id, char *title, char *filename, char *owner) return 0; } -int +int invalidaddr(char *addr) { if (*addr == '\0') @@ -115,7 +115,7 @@ invalidaddr(char *addr) return 0; } -int +int m_internet() { char receiver[60]; @@ -132,13 +132,13 @@ m_internet() return 0; } -void +void m_init() { sethomedir(currmaildir, cuser.userid); } -int +int chkmailbox() { if (!HAVE_PERM(PERM_SYSOP) && !HAVE_PERM(PERM_MAILLIMIT)) { @@ -185,7 +185,7 @@ chkmailbox() return 0; } -static void +static void do_hold_mail(char *fpath, char *receiver, char *holder) { char buf[80], title[128]; @@ -211,7 +211,7 @@ do_hold_mail(char *fpath, char *receiver, char *holder) do_append(title, &mymail, sizeof(mymail)); } -void +void hold_mail(char *fpath, char *receiver) { char buf[4]; @@ -223,7 +223,7 @@ hold_mail(char *fpath, char *receiver) do_hold_mail(fpath, receiver, cuser.userid); } -int +int do_send(char *userid, char *title) { fileheader_t mhdr; @@ -297,8 +297,7 @@ do_send(char *userid, char *title) i = belong(fpath, cuser.userid); sethomefile(fpath, userid, FN_REJECT); - if (i || !belong(fpath, cuser.userid)) /* Ptt: ¥Îbelong¦³ÂI°Q¹½ */ - { + if (i || !belong(fpath, cuser.userid)) { /* Ptt: ¥Îbelong¦³ÂI°Q¹½ */ sethomedir(fpath, userid); if (append_record(fpath, &mhdr, sizeof(mhdr)) == -1) return -1; @@ -309,7 +308,7 @@ do_send(char *userid, char *title) } } -void +void my_send(char *uident) { switch (do_send(uident, NULL)) { @@ -326,7 +325,7 @@ my_send(char *uident) pressanykey(); } -int +int m_send() { char uident[40]; @@ -340,7 +339,7 @@ m_send() } /* ¸s²Õ±H«H¡B¦^«H : multi_send, multi_reply */ -static void +static void multi_list(int *reciper) { char uid[16]; @@ -418,7 +417,7 @@ multi_list(int *reciper) } } -static void +static void multi_send(char *title) { FILE *fp; @@ -536,7 +535,7 @@ multi_send(char *title) pressanykey(); } -static int +static int multi_reply(int ent, fileheader_t * fhdr, char *direct) { if (!(fhdr->filemode & FILE_MULTI)) @@ -549,7 +548,7 @@ multi_reply(int ent, fileheader_t * fhdr, char *direct) return 0; } -int +int mail_list() { stand_title("¸s²Õ§@·~"); @@ -557,7 +556,7 @@ mail_list() return 0; } -int +int mail_all() { FILE *fp; @@ -636,7 +635,7 @@ mail_all() return 0; } -int +int mail_mbox() { char cmd[100]; @@ -648,7 +647,7 @@ mail_mbox() return 0; } -static int +static int m_forward(int ent, fileheader_t * fhdr, char *direct) { char uid[STRLEN]; @@ -684,7 +683,7 @@ static int delmsgs[128]; static int delcnt; static int mrd; -static int +static int read_new_mail(fileheader_t * fptr) { static int idc; @@ -775,7 +774,7 @@ read_new_mail(fileheader_t * fptr) return 0; } -int +int m_new() { clear(); @@ -800,7 +799,7 @@ m_new() return -1; } -static void +static void mailtitle() { char buf[256] = ""; @@ -820,7 +819,7 @@ mailtitle() outs(buf); } -static void +static void maildoent(int num, fileheader_t * ent) { char *title, *mark, color, type = "+ Mm"[(ent->filemode & 3)]; @@ -845,14 +844,14 @@ maildoent(int num, fileheader_t * ent) ent->date, ent->owner, color, mark, title); } -static int +static int m_idle(int ent, fileheader_t * fhdr, char *direct) { t_idle(); return FULLUPDATE; } -static int +static int mail_del(int ent, fileheader_t * fhdr, char *direct) { char genbuf[200]; @@ -878,7 +877,7 @@ mail_del(int ent, fileheader_t * fhdr, char *direct) return FULLUPDATE; } -static int +static int mail_read(int ent, fileheader_t * fhdr, char *direct) { char buf[64]; @@ -970,7 +969,7 @@ mail_read(int ent, fileheader_t * fhdr, char *direct) } /* in boards/mail ¦^«Hµ¹ì§@ªÌ¡AÂà«H¯¸¥ç¥i */ -int +int mail_reply(int ent, fileheader_t * fhdr, char *direct) { char uid[STRLEN]; @@ -1027,7 +1026,7 @@ mail_reply(int ent, fileheader_t * fhdr, char *direct) return FULLUPDATE; } -static int +static int mail_edit(int ent, fileheader_t * fhdr, char *direct) { char genbuf[200]; @@ -1042,7 +1041,7 @@ mail_edit(int ent, fileheader_t * fhdr, char *direct) return FULLUPDATE; } -static int +static int mail_nooutmail(int ent, fileheader_t * fhdr, char *direct) { cuser.userlevel ^= PERM_NOOUTMAIL; @@ -1051,7 +1050,7 @@ mail_nooutmail(int ent, fileheader_t * fhdr, char *direct) } -static int +static int mail_mark(int ent, fileheader_t * fhdr, char *direct) { fhdr->filemode ^= FILE_MARKED; @@ -1093,14 +1092,14 @@ static char *mail_help[] = { NULL }; -static int +static int m_help() { show_help(mail_help); return FULLUPDATE; } -static int +static int mail_cross_post(int ent, fileheader_t * fhdr, char *direct) { char xboard[20], fname[80], xfpath[80], xtitle[80], inputbuf[10]; @@ -1194,7 +1193,7 @@ mail_cross_post(int ent, fileheader_t * fhdr, char *direct) return FULLUPDATE; } -int +int mail_man() { char buf[64], buf1[64]; @@ -1212,7 +1211,7 @@ mail_man() return DONOTHING; } -static int +static int mail_cite(int ent, fileheader_t * fhdr, char *direct) { char fpath[256]; @@ -1257,7 +1256,7 @@ mail_cite(int ent, fileheader_t * fhdr, char *direct) } } -static int +static int mail_save(int ent, fileheader_t * fhdr, char *direct) { char fpath[256]; @@ -1277,7 +1276,7 @@ mail_save(int ent, fileheader_t * fhdr, char *direct) } #ifdef OUTJOBSPOOL -static int +static int mail_waterball(int ent, fileheader_t * fhdr, char *direct) { static char address[60], cmode = 1; @@ -1367,7 +1366,7 @@ static struct onekey_t mail_comms[] = { {'\0', NULL} }; -int +int m_read() { if (get_num_records(currmaildir, sizeof(fileheader_t))) { @@ -1384,7 +1383,7 @@ m_read() } /* ±H¯¸¤º«H */ -static int +static int send_inner_mail(char *fpath, char *title, char *receiver) { char genbuf[256]; @@ -1411,7 +1410,7 @@ send_inner_mail(char *fpath, char *title, char *receiver) #include <time.h> #ifndef USE_BSMTP -static int +static int bbs_sendmail(char *fpath, char *title, char *receiver) { static int configured = 0; @@ -1490,7 +1489,7 @@ bbs_sendmail(char *fpath, char *title, char *receiver) } #else /* USE_BSMTP */ -int +int bsmtp(char *fpath, char *title, char *rcpt, int method) { char buf[80], *ptr; @@ -1539,7 +1538,7 @@ bsmtp(char *fpath, char *title, char *rcpt, int method) } #endif /* USE_BSMTP */ -int +int doforward(char *direct, fileheader_t * fh, int mode) { static char address[60]; @@ -1630,7 +1629,7 @@ doforward(char *direct, fileheader_t * fh, int mode) return (return_no); } -int +int load_mailalert(char *userid) { struct stat st; @@ -1665,7 +1664,7 @@ load_mailalert(char *userid) } #ifdef EMAIL_JUSTIFY -static void +static void mail_justify(userec_t muser) { fileheader_t mhdr; diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index 954cac82..012974ec 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -1,4 +1,4 @@ -/* $Id: mbbsd.c,v 1.41 2002/07/21 08:18:41 in2 Exp $ */ +/* $Id: mbbsd.c,v 1.42 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" #define SOCKET_QLEN 4 @@ -305,9 +305,7 @@ show_call_in(int save, int which) static int add_history_water(water_t * w, msgque_t * msg) { - //mode:1:all data(including userid, pid); -//0: only last_call_in Ptt:¥ý§ï¦^¨Ó¬Ù¤£¦h ¶ i ¶ ¥·|¦³°ÝÃD - memcpy(&w->msg[w->top], msg, sizeof(msgque_t)); + memcpy(&w->msg[w->top], msg, sizeof(msgque_t)); w->top++; w->top %= WATERMODE(WATER_OFO) ? 5 : MAX_REVIEW; diff --git a/mbbsd/menu.c b/mbbsd/menu.c index c7570620..d51dd01e 100644 --- a/mbbsd/menu.c +++ b/mbbsd/menu.c @@ -1,4 +1,4 @@ -/* $Id: menu.c,v 1.14 2002/07/20 08:52:24 in2 Exp $ */ +/* $Id: menu.c,v 1.15 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" /* help & menu processring */ @@ -6,7 +6,7 @@ static int refscreen = NA; extern char *boardprefix; extern struct utmpfile_t *utmpshm; -int +int egetch() { int rval; @@ -28,7 +28,7 @@ extern userec_t cuser; extern char *fn_board; extern char board_hidden_status; -void +void showtitle(char *title, char *mid) { char buf[40], numreg[50]; @@ -94,14 +94,14 @@ static unsigned char menu_row = 12; static unsigned char menu_column = 20; static char mystatus[160]; -static int +static int u_movie() { cuser.uflag ^= MOVIE_FLAG; return 0; } -void +void movie(int i) { static short history[MAX_HISTORY]; @@ -152,7 +152,7 @@ movie(int i) refresh(); } -static int +static int show_menu(commands_t * p) { register int n = 0; @@ -174,7 +174,7 @@ show_menu(commands_t * p) return n - 1; } -void +void domenu(int cmdmode, char *cmdtitle, int cmd, commands_t cmdtable[]) { int lastcmdptr; @@ -583,3 +583,7 @@ int Name_Menu() } + + + + diff --git a/mbbsd/more.c b/mbbsd/more.c index 90b22ab1..33c6e1b3 100644 --- a/mbbsd/more.c +++ b/mbbsd/more.c @@ -1,4 +1,4 @@ -/* $Id: more.c,v 1.16 2002/07/20 10:53:58 kcwu Exp $ */ +/* $Id: more.c,v 1.17 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" #define MORE_BUFSIZE 4096 #define MORE_WINSIZE 4096 @@ -127,7 +127,7 @@ more_readln(int fd, unsigned char *buf) * len++; buf[i++] = ch; } } buf[i] = '\0'; return bytes; } */ -int +int more(char *fpath, int promptend) { static char *head[4] = {"§@ªÌ", "¼ÐÃD", "®É¶¡", "Âà«H"}; @@ -583,4 +583,3 @@ more(char *fpath, int promptend) outs(reset_color); return 0; } - diff --git a/mbbsd/name.c b/mbbsd/name.c index 949afaf2..446a136f 100644 --- a/mbbsd/name.c +++ b/mbbsd/name.c @@ -1,4 +1,4 @@ -/* $Id: name.c,v 1.11 2002/07/21 08:18:41 in2 Exp $ */ +/* $Id: name.c,v 1.12 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" static word_t *current = NULL; @@ -7,7 +7,7 @@ static char *msg_more = "\033[7m-- More --\033[m"; typedef char (*arrptr)[]; /* name complete for user ID */ -static int +static int UserMaxLen(char cwlist[][IDLEN + 1], int cwnum, int morenum, int count) { @@ -21,7 +21,7 @@ UserMaxLen(char cwlist[][IDLEN + 1], int cwnum, int morenum, return max; } -static int +static int UserSubArray(char cwbuf[][IDLEN + 1], char cwlist[][IDLEN + 1], int cwnum, int key, int pos) { @@ -42,7 +42,7 @@ UserSubArray(char cwbuf[][IDLEN + 1], char cwlist[][IDLEN + 1], return num; } -static void +static void FreeNameList() { word_t *p, *temp; @@ -54,7 +54,7 @@ FreeNameList() } } -void +void CreateNameList() { if (toplev) @@ -62,7 +62,7 @@ CreateNameList() toplev = current = NULL; } -void +void AddNameList(char *name) { word_t *node; @@ -78,7 +78,7 @@ AddNameList(char *name) current = toplev = node; } -int +int RemoveNameList(char *name) { word_t *curr, *prev = NULL; @@ -101,7 +101,7 @@ RemoveNameList(char *name) return 0; } -int +int InNameList(char *name) { word_t *p; @@ -112,7 +112,7 @@ InNameList(char *name) return 0; } -void +void ShowNameList(int row, int column, char *prompt) { word_t *p; @@ -135,7 +135,7 @@ ShowNameList(int row, int column, char *prompt) } } -void +void ToggleNameList(int *reciper, char *listfile, char *msg) { FILE *fp; @@ -157,7 +157,7 @@ ToggleNameList(int *reciper, char *listfile, char *msg) } } -static int +static int NumInList(word_t * list) { register int i; @@ -167,7 +167,7 @@ NumInList(word_t * list) return i; } -int +int chkstr(char *otag, char *tag, char *name) { char ch, *oname = name; @@ -213,7 +213,7 @@ GetSubList(char *tag, word_t * list) return wlist; } -static void +static void ClearSubList(word_t * list) { struct word_t *tmp_list; @@ -225,7 +225,7 @@ ClearSubList(word_t * list) } } -static int +static int MaxLen(word_t * list, int count) { int len = strlen(list->word); @@ -240,7 +240,7 @@ MaxLen(word_t * list, int count) return len; } -void +void namecomplete(char *prompt, char *data) { char *temp; @@ -368,7 +368,7 @@ namecomplete(char *prompt, char *data) } } -void +void usercomplete(char *prompt, char *data) { char *temp; @@ -490,7 +490,7 @@ usercomplete(char *prompt, char *data) } } -int +int gnc_findbound(char *str, int *START, int *END, size_t nmemb, int (*compar) (int, char *, int)) { @@ -506,186 +506,200 @@ gnc_findbound(char *str, int *START, int *END, start = mid; } ++start; - //if (strncasecmp(brdshm->sorted[0][start]->brdname, str, strl) != 0) { - if (compar(start, str, strl) != 0) { - *START = *END = -1; - return -1; - } - *START = start; - - end = nmemb - 1; - while (start != end && ((mid = (start + end) / 2) != start)) { - cmp = compar(mid, str, strl); - //cmp = strncasecmp(brdshm->sorted[0][mid]->brdname, str, strl); - if (cmp <= 0) - start = mid; - else - end = mid; - } - *END = start; - return 0; + if (compar(start, str, strl) != 0) { + *START = *END = -1; + return -1; } - int gnc_completeone(char *data, int start, int end, - int (*permission) (int), char *(*getname) (int)){ - int i, count, at; - if (start < 0 || end < 0) - return -1; - for (i = start, at = count = 0; i <= end && count < 2; ++i) - if (permission(i)) { - at = i; - ++count; - } - if (count == 1) { - strcpy(data, getname(at)); - return at; - } + *START = start; + + end = nmemb - 1; + while (start != end && ((mid = (start + end) / 2) != start)) { + cmp = compar(mid, str, strl); + //cmp = strncasecmp(brdshm->sorted[0][mid]->brdname, str, strl); + if (cmp <= 0) + start = mid; + else + end = mid; + } + *END = start; + return 0; +} +int +gnc_completeone(char *data, int start, int end, + int (*permission) (int), char *(*getname) (int)) +{ + int i, count, at; + if (start < 0 || end < 0) return -1; + for (i = start, at = count = 0; i <= end && count < 2; ++i) + if (permission(i)) { + at = i; + ++count; + } + if (count == 1) { + strcpy(data, getname(at)); + return at; } + return -1; +} - int generalnamecomplete(char *prompt, char *data, int len, size_t nmemb, - int (*compar) (int, char *, int), - int (*permission) (int), char *(*getname) (int)){ - int x, y, origx, origy, ch, i, morelist = -1, col, - ret = -1; - int start, end, ptr; - int clearbot = NA; - - outs(prompt); - clrtoeol(); - getyx(&y, &x); - getyx(&origy, &origx); - standout(); - prints("%*s", IDLEN + 1, ""); - standend(); - move(y, x); - refresh(); - ptr = 0; - data[ptr] = 0; - - while ((ch = igetch()) != EOF) { - if (ch == '\n' || ch == '\r') { - data[ptr] = 0; - outc('\n'); - if (ptr != 0) { - gnc_findbound(data, &start, &end, nmemb, compar); - ret = gnc_completeone(data, start, end, permission, getname); - } else - ptr = -1; - break; - } else if (ch == ' ') { - if (ptr == 0) - continue; +int +generalnamecomplete(char *prompt, char *data, int len, size_t nmemb, + int (*compar) (int, char *, int), + int (*permission) (int), char *(*getname) (int)) +{ + int x, y, origx, origy, ch, i, morelist = -1, col, ret = -1; + int start, end, ptr; + int clearbot = NA; - if (morelist == -1) { - if (gnc_findbound(data, &start, &end, nmemb, compar) == -1) - continue; - if (gnc_completeone(data, start, end, - permission, getname) >= 0) { - move(origy, origx); - outs(data); - ptr = strlen(data); - getyx(&y, &x); - continue; - } - morelist = start; - } else if (morelist > end) - continue; - clearbot = YEA; - move(2, 0); - clrtobot(); - printdash("¬ÛÃö¸ê°T¤@Äýªí"); - - col = 0; - while (len + col < 79) { - for (i = 0; morelist <= end && i < p_lines; ++morelist) { - if (permission(morelist)) { - move(3 + i, col); - prints("%s ", getname(morelist)); - ++i; - } - } + outs(prompt); + clrtoeol(); + getyx(&y, &x); + getyx(&origy, &origx); + standout(); + prints("%*s", IDLEN + 1, ""); + standend(); + move(y, x); + refresh(); + ptr = 0; + data[ptr] = 0; - col += len + 2; - } - if (morelist != end + 1) { - move(b_lines, 0); - outs(msg_more); - } - move(y, x); + while ((ch = igetch()) != EOF) { + if (ch == '\n' || ch == '\r') { + data[ptr] = 0; + outc('\n'); + if (ptr != 0) { + gnc_findbound(data, &start, &end, nmemb, compar); + ret = gnc_completeone(data, start, end, permission, getname); + } else + ptr = -1; + break; + } else if (ch == ' ') { + if (ptr == 0) continue; - } else if (ch == '\177' || ch == '\010') { /* backspace */ - if (ptr == 0) + if (morelist == -1) { + if (gnc_findbound(data, &start, &end, nmemb, compar) == -1) continue; - morelist = -1; - --ptr; - --x; - data[ptr] = 0; - move(y, x); - outc(' '); - move(y, x); + if (gnc_completeone(data, start, end, + permission, getname) >= 0) { + move(origy, origx); + outs(data); + ptr = strlen(data); + getyx(&y, &x); + continue; + } + morelist = start; + } else if (morelist > end) continue; - } else if (isprint(ch) && ptr <= (len - 2)) { - morelist = -1; - data[ptr] = ch; - ++ptr; - data[ptr] = 0; - if (gnc_findbound(data, &start, &end, nmemb, compar) < 0) + clearbot = YEA; + move(2, 0); + clrtobot(); + printdash("¬ÛÃö¸ê°T¤@Äýªí"); + + col = 0; + while (len + col < 79) { + for (i = 0; morelist <= end && i < p_lines; ++morelist) { + if (permission(morelist)) { + move(3 + i, col); + prints("%s ", getname(morelist)); + ++i; + } + } + + col += len + 2; + } + if (morelist != end + 1) { + move(b_lines, 0); + outs(msg_more); + } + move(y, x); + continue; + + } else if (ch == '\177' || ch == '\010') { /* backspace */ + if (ptr == 0) + continue; + morelist = -1; + --ptr; + --x; + data[ptr] = 0; + move(y, x); + outc(' '); + move(y, x); + continue; + } else if (isprint(ch) && ptr <= (len - 2)) { + morelist = -1; + data[ptr] = ch; + ++ptr; + data[ptr] = 0; + if (gnc_findbound(data, &start, &end, nmemb, compar) < 0) + data[--ptr] = 0; + else { + for (i = start; i <= end; ++i) + if (permission(i)) + break; + if (i == end + 1) data[--ptr] = 0; else { - for (i = start; i <= end; ++i) - if (permission(i)) - break; - if (i == end + 1) - data[--ptr] = 0; - else { - move(y, x); - outc(ch); - x++; - } + move(y, x); + outc(ch); + x++; } } } + } + outc('\n'); + refresh(); + if (clearbot) { + move(2, 0); + clrtobot(); + } + if (*data) { + move(origy, origx); + outs(data); outc('\n'); - refresh(); - if (clearbot) { - move(2, 0); - clrtobot(); - } - if (*data) { - move(origy, origx); - outs(data); - outc('\n'); - } - return ret; } + return ret; +} - /* general complete functions (brdshm) */ - int completeboard_compar(int where, char *str, int len){ - return strncasecmp(SHM->bsorted[0][where]->brdname, str, len); - } +/* general complete functions (brdshm) */ +int +completeboard_compar(int where, char *str, int len) +{ + return strncasecmp(SHM->bsorted[0][where]->brdname, str, len); +} - int completeboard_permission(int where){ - return Ben_Perm(SHM->bsorted[0][where]); - } +int +completeboard_permission(int where) +{ + return Ben_Perm(SHM->bsorted[0][where]); +} - char *completeboard_getname(int where){ - return SHM->bsorted[0][where]->brdname; - } +char * +completeboard_getname(int where) +{ + return SHM->bsorted[0][where]->brdname; +} - /* general complete functions (utmpshm) */ - int completeutmp_compar(int where, char *str, int len){ - return strncasecmp(SHM->sorted[SHM->currsorted][0][where]->userid, - str, len); - } +/* general complete functions (utmpshm) */ +int +completeutmp_compar(int where, char *str, int len) +{ + return strncasecmp(SHM->sorted[SHM->currsorted][0][where]->userid, + str, len); +} - int completeutmp_permission(int where){ - return (HAS_PERM(PERM_SYSOP) || HAS_PERM(PERM_SEECLOAK) || - !SHM->sorted[SHM->currsorted][0][where]->invisible); - } +int +completeutmp_permission(int where) +{ + return (HAS_PERM(PERM_SYSOP) || HAS_PERM(PERM_SEECLOAK) || + !SHM->sorted[SHM->currsorted][0][where]->invisible); +} - char *completeutmp_getname(int where){ - return SHM->sorted[SHM->currsorted][0][where]->userid; - } +char * +completeutmp_getname(int where) +{ + return SHM->sorted[SHM->currsorted][0][where]->userid; +} diff --git a/mbbsd/osdep.c b/mbbsd/osdep.c index d99395c7..f1b65242 100644 --- a/mbbsd/osdep.c +++ b/mbbsd/osdep.c @@ -1,11 +1,11 @@ -/* $Id: osdep.c,v 1.4 2002/07/05 17:10:27 in2 Exp $ */ +/* $Id: osdep.c,v 1.5 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" #if __FreeBSD__ #include <kvm.h> -int +int cpuload(char *str) { double l[3] = {-1, -1, -1}; @@ -21,7 +21,7 @@ cpuload(char *str) return (int)l[0]; } -double +double swapused(long *total, long *used) { double percent = -1; @@ -44,7 +44,7 @@ swapused(long *total, long *used) } #else -int +int cpuload(char *str) { double l[3] = {-1, -1, -1}; @@ -64,7 +64,7 @@ cpuload(char *str) return (int)l[0]; } -double +double swapused(long *total, long *used) { double percent = -1; diff --git a/mbbsd/othello.c b/mbbsd/othello.c index 76cd2f8c..6f6d69ab 100644 --- a/mbbsd/othello.c +++ b/mbbsd/othello.c @@ -1,4 +1,4 @@ -/* $Id: othello.c,v 1.4 2002/07/05 17:10:27 in2 Exp $ */ +/* $Id: othello.c,v 1.5 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" #define LOGFILE "etc/othello.log" @@ -62,7 +62,7 @@ static char init_table[NR_TABLE + 1][5][5] = { }; static char table[NR_TABLE + 1][10][10]; -static void +static void print_chess(int x, int y, char chess) { move(STARTX - 1 + x * 2, STARTY - 2 + y * 4); @@ -73,7 +73,7 @@ print_chess(int x, int y, char chess) refresh(); } -static void +static void printboard() { int i; @@ -118,7 +118,7 @@ printboard() prints("¥k:¡÷, l"); } -static int +static int get_key(char nowx, char nowy) { int ch; @@ -133,7 +133,7 @@ get_key(char nowx, char nowy) return ch; } -static int +static int eatline(int i, int j, char color, int dir, char chessboard[][10]) { int tmpx, tmpy; @@ -168,7 +168,7 @@ eatline(int i, int j, char color, int dir, char chessboard[][10]) return false; } -static int +static int if_can_put(int x, int y, char color, char chessboard[][10]) { int i, temp, checkx, checky; @@ -188,7 +188,7 @@ if_can_put(int x, int y, char color, char chessboard[][10]) return false; } -static int +static int get_hint(char color) { int i, j, temp = 0; @@ -206,7 +206,7 @@ get_hint(char color) return temp; } -static void +static void eat(int x, int y, int color, char chessboard[][10]) { int k; @@ -215,7 +215,7 @@ eat(int x, int y, int color, char chessboard[][10]) eatline(x, y, color, k, chessboard); } -static void +static void end_of_game(int quit) { FILE *fp, *fp1; @@ -277,7 +277,7 @@ end_of_game(int quit) igetkey(); } -static void +static void othello_redraw() { int i, j; @@ -287,7 +287,7 @@ othello_redraw() print_chess(i, j, nowboard[i][j]); } -static int +static int player(char color) { int ch; @@ -359,7 +359,7 @@ player(char color) return 0; } -static void +static void init() { int i, j, i1, j1; @@ -381,7 +381,7 @@ init() nowboard[4][5] = nowboard[5][4] = BLACK; } -static void +static void report() { int i, j; @@ -401,7 +401,7 @@ report() prints("¹q¸£ : %02d", number[1]); } -static int +static int EVL(char chessboard[][10], int color, int table_number) { int points = 0, a, b; @@ -416,7 +416,7 @@ EVL(char chessboard[][10], int color, int table_number) return ((color == BLACK) ? points : -points); } -static int +static int alphabeta(int alpha, int beta, int level, char chessboard[][10], int thinkstep, int color, int table) { @@ -448,7 +448,7 @@ alphabeta(int alpha, int beta, int level, char chessboard[][10], return ((level & 1) ? alpha : beta); } -static int +static int Computer(int thinkstep, int table) { int i, j, maxi = 0, maxj = 0, level = 1; @@ -492,7 +492,7 @@ Computer(int thinkstep, int table) return true; } -static int +static int choose() { char thinkstep[2]; @@ -524,7 +524,7 @@ choose() #define lockreturn0(unmode, state) if(lockutmpmode(unmode, state)) return 0 -int +int othello_main() { lockreturn0(OTHELLO, LOCK_MULTI); diff --git a/mbbsd/page.c b/mbbsd/page.c index a3e11466..988b222b 100644 --- a/mbbsd/page.c +++ b/mbbsd/page.c @@ -1,8 +1,8 @@ -/* $Id: page.c,v 1.7 2002/07/21 08:18:41 in2 Exp $ */ +/* $Id: page.c,v 1.8 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" #define hpressanykey(a) {move(22, 0); prints(a); pressanykey();} -static void +static void filt_railway(char *fpath) { char buf[256], tmppath[32]; @@ -24,7 +24,7 @@ filt_railway(char *fpath) unlink(tmppath); } -int +int main_railway() { fileheader_t mhdr; diff --git a/mbbsd/passwd.c b/mbbsd/passwd.c index 9c129dc0..a9b32f0c 100644 --- a/mbbsd/passwd.c +++ b/mbbsd/passwd.c @@ -1,4 +1,4 @@ -/* $Id: passwd.c,v 1.7 2002/07/05 17:10:28 in2 Exp $ */ +/* $Id: passwd.c,v 1.8 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" static int semid = -1; @@ -20,7 +20,7 @@ union semun { }; #endif -int +int passwd_init() { semid = semget(PASSWDSEM_KEY, 1, SEM_R | SEM_A | IPC_CREAT | IPC_EXCL); @@ -48,7 +48,7 @@ passwd_init() return 0; } -int +int passwd_update_money(int num) { userec_t user; @@ -61,7 +61,7 @@ passwd_update_money(int num) return 0; } -int +int passwd_update(int num, userec_t * buf) { int pwdfd; @@ -76,7 +76,7 @@ passwd_update(int num, userec_t * buf) return 0; } -int +int passwd_query(int num, userec_t * buf) { int pwdfd; @@ -90,7 +90,7 @@ passwd_query(int num, userec_t * buf) return 0; } -int +int passwd_apply(int (*fptr) (userec_t *)) { int i; @@ -103,7 +103,7 @@ passwd_apply(int (*fptr) (userec_t *)) return 0; } -void +void passwd_lock() { struct sembuf buf = {0, -1, SEM_UNDO}; @@ -114,7 +114,7 @@ passwd_lock() } } -void +void passwd_unlock() { struct sembuf buf = {0, 1, SEM_UNDO}; diff --git a/mbbsd/read.c b/mbbsd/read.c index 4ef38169..5a915d3b 100644 --- a/mbbsd/read.c +++ b/mbbsd/read.c @@ -1,4 +1,4 @@ -/* $Id: read.c,v 1.9 2002/07/21 08:18:41 in2 Exp $ */ +/* $Id: read.c,v 1.10 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" #define MAXPATHLEN 256 @@ -209,7 +209,7 @@ getkeep(char *s, int def_topline, int def_cursline) return (keeplist = p); } -void +void fixkeep(char *s, int first) { keeploc_t *k; @@ -222,7 +222,7 @@ fixkeep(char *s, int first) } /* calc cursor pos and show cursor correctly */ -static int +static int cursor_pos(keeploc_t * locmem, int val, int from_top) { int top; @@ -249,7 +249,7 @@ cursor_pos(keeploc_t * locmem, int val, int from_top) return PARTUPDATE; } -static int +static int move_cursor_line(keeploc_t * locmem, int mode) { int top, crs; @@ -283,7 +283,7 @@ move_cursor_line(keeploc_t * locmem, int mode) return reload; } -static int +static int thread(keeploc_t * locmem, int stype) { static char a_ans[32], t_ans[32]; @@ -418,7 +418,7 @@ thread(keeploc_t * locmem, int stype) #ifdef INTERNET_EMAIL -static void +static void mail_forward(fileheader_t * fhdr, char *direct, int mode) { int i; @@ -446,7 +446,7 @@ mail_forward(fileheader_t * fhdr, char *direct, int mode) } #endif -static int +static int select_read(keeploc_t * locmem, int sr_mode) { register char *tag, *query, *temp; @@ -541,7 +541,7 @@ select_read(keeploc_t * locmem, int sr_mode) return st.st_size; } -static int +static int i_read_key(onekey_t * rcmdlist, keeploc_t * locmem, int ch, int bid) { int i, mode = DONOTHING; @@ -728,7 +728,8 @@ i_read_key(onekey_t * rcmdlist, keeploc_t * locmem, int ch, int bid) return mode; } -void i_read(int cmdmode, char *direct, void (*dotitle) (), void (*doentry) (), onekey_t * rcmdlist, int bidcache){ +void + i_read(int cmdmode, char *direct, void (*dotitle) (), void (*doentry) (), onekey_t * rcmdlist, int bidcache){ keeploc_t *locmem = NULL; int recbase = 0, mode, ch; int num = 0, entries = 0; @@ -742,8 +743,8 @@ void i_read(int cmdmode, char *direct, void (*dotitle) (), void (*doe strlcpy(currdirect0, currdirect, sizeof(currdirect0)); #define FHSZ sizeof(fileheader_t) -//Ptt:³o à äheaders ¥ i ¥ H ° w ¹ ï¬ÝªO ª º³Ì«á60 ½ g ° µcache - headers = (fileheader_t *) calloc(p_lines, FHSZ); + /* Ptt: ³oÃä headers ¥i¥H°w¹ï¬ÝªOªº³Ì«á 60 ½g°µ cache */ + headers = (fileheader_t *) calloc(p_lines, FHSZ); strlcpy(currdirect, direct, sizeof(currdirect)); mode = NEWDIRECT; diff --git a/mbbsd/record.c b/mbbsd/record.c index 79dd1801..d8ce7aa2 100644 --- a/mbbsd/record.c +++ b/mbbsd/record.c @@ -1,10 +1,10 @@ -/* $Id: record.c,v 1.8 2002/07/21 08:18:41 in2 Exp $ */ +/* $Id: record.c,v 1.9 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" #undef HAVE_MMAP #define BUFSIZE 512 -static void +static void PttLock(int fd, int size, int mode) { static struct flock lock_it; @@ -20,7 +20,7 @@ PttLock(int fd, int size, int mode) #define safewrite write -int +int get_num_records(char *fpath, int size) { struct stat st; @@ -29,7 +29,7 @@ get_num_records(char *fpath, int size) return st.st_size / size; } -int +int get_sum_records(char *fpath, int size) { struct stat st; @@ -53,7 +53,7 @@ get_sum_records(char *fpath, int size) return ans / 1024; } -int +int get_record(char *fpath, void *rptr, int size, int id) { int fd = -1; @@ -70,7 +70,7 @@ get_record(char *fpath, void *rptr, int size, int id) return -1; } -int +int get_records(char *fpath, void *rptr, int size, int id, int number) { int fd; @@ -90,7 +90,7 @@ get_records(char *fpath, void *rptr, int size, int id, int number) return id / size; } -int +int substitute_record(char *fpath, void *rptr, int size, int id) { int fd; @@ -133,7 +133,7 @@ typedef struct nol_t { char lockfn[256]; } nol_t; -static void +static void nolfilename(nol_t * n, char *fpath) { sprintf(n->newfn, "%s.new", fpath); @@ -141,7 +141,7 @@ nolfilename(nol_t * n, char *fpath) sprintf(n->lockfn, "%s.lock", fpath); } -int +int delete_record(char fpath[], int size, int id) { nol_t my; @@ -207,7 +207,7 @@ title_body(char *title) } #endif -int +int delete_range(char *fpath, int id1, int id2) { fileheader_t fhdr; @@ -275,7 +275,7 @@ delete_range(char *fpath, int id1, int id2) return 0; } -int +int search_rec(char *dirname, int (*filecheck) ()) { fileheader_t fhdr; @@ -343,7 +343,7 @@ int delete_files(char *dirname, int (*filecheck) (), int record){ return ans; } -int +int delete_file(char *dirname, int size, int ent, int (*filecheck) ()) { char abuf[BUFSIZE]; @@ -422,7 +422,7 @@ int apply_record(char *fpath, int (*fptr) (), int size){ } /* mail / post ®É¡A¨Ì¾Ú®É¶¡«Ø¥ßÀɮסA¥[¤W¶lÂW */ -int +int stampfile(char *fpath, fileheader_t * fh) { register char *ip = fpath; @@ -448,7 +448,7 @@ stampfile(char *fpath, fileheader_t * fh) return 0; } -void +void stampdir(char *fpath, fileheader_t * fh) { register char *ip = fpath; @@ -469,7 +469,7 @@ stampdir(char *fpath, fileheader_t * fh) sprintf(fh->date, "%2d/%02d", ptime->tm_mon + 1, ptime->tm_mday); } -void +void stamplink(char *fpath, fileheader_t * fh) { register char *ip = fpath; @@ -490,7 +490,7 @@ stamplink(char *fpath, fileheader_t * fh) sprintf(fh->date, "%2d/%02d", ptime->tm_mon + 1, ptime->tm_mday); } -int +int do_append(char *fpath, fileheader_t * record, int size) { int fd; @@ -509,7 +509,7 @@ do_append(char *fpath, fileheader_t * record, int size) return 0; } -int +int append_record(char *fpath, fileheader_t * record, int size) { #if !defined(_BBS_UTIL_C_) diff --git a/mbbsd/register.c b/mbbsd/register.c index 3cb92cab..26204ce8 100644 --- a/mbbsd/register.c +++ b/mbbsd/register.c @@ -1,4 +1,4 @@ -/* $Id: register.c,v 1.7 2002/07/21 08:18:41 in2 Exp $ */ +/* $Id: register.c,v 1.8 2002/07/21 09:26:02 in2 Exp $ */ #define _XOPEN_SOURCE #include "bbs.h" @@ -30,7 +30,7 @@ genpasswd(char *pw) return ""; } -int +int checkpasswd(char *passwd, char *test) { char *pw; @@ -41,7 +41,7 @@ checkpasswd(char *passwd, char *test) } /* Àˬd user µù¥U±¡ªp */ -int +int bad_user_id(char *userid) { int len, i; @@ -53,8 +53,8 @@ bad_user_id(char *userid) if (not_alpha(userid[0])) return 1; for (i = 1; i < len; i++) -//DickG:×¥¿¤F ¥ u ¤ ñ¸ûuserid ² Ĥ@Ó¦r ¤ ¸ªºbug - if (not_alnum(userid[i])) + /* DickG: ×¥¿¤F¥u¤ñ¸û userid ²Ä¤@Ó¦r¤¸ªº bug */ + if (not_alnum(userid[i])) return 1; if (strcasecmp(userid, str_new) == 0) @@ -71,7 +71,7 @@ bad_user_id(char *userid) /* (a) is the worst user currently */ /* (b) is the object to be compared */ /* -------------------------------- */ -static int +static int compute_user_value(userec_t * urec, time_t clock) { int value; @@ -97,7 +97,7 @@ compute_user_value(userec_t * urec, time_t clock) return (urec->userlevel & PERM_LOGINOK ? 120 : 15) * 24 * 60 - value; } -int +int check_and_expire_account(int uid, userec_t * urec) { userec_t zerorec; @@ -130,7 +130,7 @@ check_and_expire_account(int uid, userec_t * urec) } -int +int getnewuserid() { char genbuf[50]; @@ -185,7 +185,7 @@ getnewuserid() return i; } -void +void new_register() { userec_t newuser; @@ -269,7 +269,7 @@ new_register() } -void +void check_register() { char *ptr = NULL; @@ -297,8 +297,8 @@ check_register() * if(!strchr(cuser.email, '@')) { bell(); move(t_lines - 4, 0); prints(" * ±zªºÅv¯q¡A½Ð¶ñ¼g¯u¹êªº E-mail address¡A" "¥H¸ê½T»{»Õ¤U¨¥÷¡A\n" " * 033[44muser@domain_name\033[0m ©Î \033[44muser" - * "@\\[ip_number\\]\033[0m¡C\n\n" "¡° ¦pªG±z¯uªº¨S¦³ E-mail¡A - * turn] §Y¥i¡C"); + * "@\\[ip_number\\]\033[0m¡C\n\n" "¡° ¦pªG±z¯uªº¨S¦³ E-mail¡A turn] + * §Y¥i¡C"); * * do { getdata(8, 0, "¹q¤l«H½c¡G", cuser.email, sizeof(cuser.email), * DOECHO); if(!cuser.email[0]) sprintf(cuser.email, "%s%s", diff --git a/mbbsd/screen.c b/mbbsd/screen.c index a5cbea77..2650f5f9 100644 --- a/mbbsd/screen.c +++ b/mbbsd/screen.c @@ -1,4 +1,4 @@ -/* $Id: screen.c,v 1.5 2002/07/21 08:18:41 in2 Exp $ */ +/* $Id: screen.c,v 1.6 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" #ifdef SUPPORT_GB @@ -23,7 +23,7 @@ static int scrollcnt, tc_col, tc_line; int tputs(const char *str, int affcnt, int (*putc) (int)); -void +void initscr() { if (!big_picture) { @@ -35,21 +35,21 @@ initscr() } } -void +void move(int y, int x) { cur_col = x; cur_ln = y; } -void +void getyx(int *y, int *x) { *y = cur_ln; *x = cur_col; } -static void +static void rel_move(int was_col, int was_ln, int new_col, int new_ln) { if (new_ln >= t_lines || new_col >= t_columns) @@ -81,7 +81,7 @@ rel_move(int was_col, int was_ln, int new_col, int new_ln) do_move(new_col, new_ln); } -static void +static void standoutput(char *buf, int ds, int de, int sso, int eso) { int st_start, st_end; @@ -101,7 +101,7 @@ standoutput(char *buf, int ds, int de, int sso, int eso) } } -void +void redoscr() { register screenline_t *bp; @@ -138,7 +138,7 @@ redoscr() oflush(); } -void +void refresh() { register screenline_t *bp = big_picture; @@ -204,7 +204,7 @@ refresh() oflush(); } -void +void clear() { register screenline_t *slp; @@ -219,7 +219,7 @@ clear() } while (++i < scr_lns); } -void +void clrtoeol() { register screenline_t *slp; @@ -243,7 +243,7 @@ clrtoeol() slp->len = cur_col; } -void +void clrtoline(int line) { register screenline_t *slp; @@ -259,13 +259,13 @@ clrtoline(int line) } } -void +void clrtobot() { clrtoline(scr_lns); } -void +void outch(unsigned char c) { register screenline_t *slp; @@ -319,7 +319,7 @@ outch(unsigned char c) } } -static void +static void parsecolor(char *buf) { char *val; @@ -343,7 +343,7 @@ parsecolor(char *buf) #define ESCAPE (01) #define VTKEYS (02) -void +void outc(unsigned char ch) { if (showansi) @@ -392,7 +392,7 @@ outc(unsigned char ch) } } -static void +static void do_outs(char *str) { while (*str) { @@ -400,7 +400,7 @@ do_outs(char *str) } } #ifdef SUPPORT_GB -static void +static void gb_init() { if (current_font_type == TYPE_GB) { @@ -409,13 +409,13 @@ gb_init() gbinited = 1; } -static void +static void gb_outs(char *str) { do_outs(hc_convert_str(str, HC_BIGtoGB, HC_DO_SINGLE)); } #endif -int +int edit_outs(char *text) { register int column = 0; @@ -430,7 +430,7 @@ edit_outs(char *text) return 0; } -void +void outs(char *str) { #ifdef SUPPORT_GB @@ -448,7 +448,7 @@ outs(char *str) /* Jaky */ -void +void Jaky_outs(char *str, int line) { #ifdef SUPPORT_GB @@ -463,7 +463,7 @@ Jaky_outs(char *str, int line) } } -void +void outmsg(char *msg) { move(b_lines, 0); @@ -476,7 +476,7 @@ outmsg(char *msg) outc(*msg++); } -void +void prints(char *fmt,...) { va_list args; @@ -488,7 +488,7 @@ prints(char *fmt,...) outs(buff); } -void +void mprints(int y, int x, char *str) { move(y, x); @@ -496,7 +496,7 @@ mprints(int y, int x, char *str) prints(str); } -void +void scroll() { scrollcnt++; @@ -506,7 +506,7 @@ scroll() clrtoeol(); } -void +void rscroll() { scrollcnt--; @@ -516,7 +516,7 @@ rscroll() clrtoeol(); } -void +void region_scroll_up(int top, int bottom) { int i; @@ -542,7 +542,7 @@ region_scroll_up(int top, int bottom) refresh(); } -void +void standout() { if (!standing && strtstandoutlen) { @@ -555,7 +555,7 @@ standout() } } -void +void standend() { if (standing && strtstandoutlen) { diff --git a/mbbsd/stuff.c b/mbbsd/stuff.c index 98c38e19..d3297eda 100644 --- a/mbbsd/stuff.c +++ b/mbbsd/stuff.c @@ -1,4 +1,4 @@ -/* $Id: stuff.c,v 1.7 2002/07/05 17:10:28 in2 Exp $ */ +/* $Id: stuff.c,v 1.8 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" /* ----------------------------------------------------- */ @@ -10,61 +10,61 @@ static char *str_board_file = "boards/%c/%s/%s"; #define STR_DOTDIR ".DIR" static char *str_dotdir = STR_DOTDIR; -void +void setcalfile(char *buf, char *userid) { sprintf(buf, "home/%c/%s/calendar", userid[0], userid); } -void +void sethomepath(char *buf, char *userid) { sprintf(buf, "home/%c/%s", userid[0], userid); } -void +void sethomedir(char *buf, char *userid) { sprintf(buf, str_home_file, userid[0], userid, str_dotdir); } -void +void sethomeman(char *buf, char *userid) { sprintf(buf, str_home_file, userid[0], userid, "man"); } -void +void sethomefile(char *buf, char *userid, char *fname) { sprintf(buf, str_home_file, userid[0], userid, fname); } -void +void setuserfile(char *buf, char *fname) { sprintf(buf, str_home_file, cuser.userid[0], cuser.userid, fname); } -void +void setapath(char *buf, char *boardname) { sprintf(buf, "man/boards/%c/%s", boardname[0], boardname); } -void +void setadir(char *buf, char *path) { sprintf(buf, "%s/%s", path, str_dotdir); } -void +void setbpath(char *buf, char *boardname) { sprintf(buf, "boards/%c/%s", boardname[0], boardname); } -void +void setbdir(char *buf, char *boardname) { sprintf(buf, str_board_file, boardname[0], boardname, @@ -72,13 +72,13 @@ setbdir(char *buf, char *boardname) (currmode & MODE_DIGEST ? fn_mandex : str_dotdir)); } -void +void setbfile(char *buf, char *boardname, char *fname) { sprintf(buf, str_board_file, boardname[0], boardname, fname); } -void +void setdirpath(char *buf, char *direct, char *fname) { strcpy(buf, direct); @@ -100,7 +100,7 @@ subject(char *title) /* ----------------------------------------------------- */ /* ¦r¦êÂà´«Àˬd¨ç¼Æ */ /* ----------------------------------------------------- */ -int +int str_checksum(char *str) { int n = 1; @@ -111,7 +111,7 @@ str_checksum(char *str) return n; } -void +void str_lower(char *t, char *s) { register unsigned char ch; @@ -122,7 +122,7 @@ str_lower(char *t, char *s) } while (ch); } -int +int strstr_lower(char *str, char *tag) { char buf[STRLEN]; @@ -131,7 +131,7 @@ strstr_lower(char *str, char *tag) return (int)strstr(buf, tag); } -void +void trim(char *buf) { /* remove trailing space */ char *p = buf; @@ -149,27 +149,27 @@ trim(char *buf) /* ----------------------------------------------------- */ /* ¦r¦êÀˬd¨ç¼Æ¡G^¤å¡B¼Æ¦r¡BÀɦW¡BE-mail address */ /* ----------------------------------------------------- */ -int +int isprint2(char ch) { return ((ch & 0x80) ? 1 : isprint(ch)); //return 1; } -int +int not_alpha(char ch) { return (ch < 'A' || (ch > 'Z' && ch < 'a') || ch > 'z'); } -int +int not_alnum(char ch) { return (ch < '0' || (ch > '9' && ch < 'A') || (ch > 'Z' && ch < 'a') || ch > 'z'); } -int +int invalid_pname(char *str) { char *p1, *p2, *p3; @@ -188,7 +188,7 @@ invalid_pname(char *str) return 0; } -int +int valid_ident(char *ident) { static char *invalid[] = {"unknown@", "root@", "gopher@", "bbs@", @@ -203,7 +203,7 @@ valid_ident(char *ident) return 1; } -int +int is_uBM(char *list, char *id) { register int len; @@ -228,7 +228,7 @@ is_uBM(char *list, char *id) return 0; } -int +int is_BM(char *list) { if (is_uBM(list, cuser.userid)) { @@ -238,7 +238,7 @@ is_BM(char *list) return 0; } -int +int userid_is_BM(char *userid, char *list) { register int ch, len; @@ -264,7 +264,7 @@ userid_is_BM(char *userid, char *list) /* ----------------------------------------------------- */ /* ÀÉ®×Àˬd¨ç¼Æ¡GÀɮסB¥Ø¿ý¡BÄÝ©ó */ /* ----------------------------------------------------- */ -off_t +off_t dashs(char *fname) { struct stat st; @@ -275,7 +275,7 @@ dashs(char *fname) return -1; } -long +long dasht(char *fname) { struct stat st; @@ -286,7 +286,7 @@ dasht(char *fname) return -1; } -int +int dashl(char *fname) { struct stat st; @@ -294,7 +294,7 @@ dashl(char *fname) return (lstat(fname, &st) == 0 && S_ISLNK(st.st_mode)); } -int +int dashf(char *fname) { struct stat st; @@ -302,7 +302,7 @@ dashf(char *fname) return (stat(fname, &st) == 0 && S_ISREG(st.st_mode)); } -int +int dashd(char *fname) { struct stat st; @@ -310,7 +310,7 @@ dashd(char *fname) return (stat(fname, &st) == 0 && S_ISDIR(st.st_mode)); } -int +int belong(char *filelist, char *key) { FILE *fp; @@ -330,7 +330,7 @@ belong(char *filelist, char *key) return rc; } -time_t +time_t gettime(int line, time_t dt) { char yn[7]; @@ -385,7 +385,7 @@ Cdatedate(time_t * clock) return foo; } -static void +static void capture_screen() { char fname[200]; @@ -405,7 +405,7 @@ capture_screen() } } -void +void pressanykey() { int ch; @@ -426,7 +426,7 @@ pressanykey() refresh(); } -int +int vmsg(const char *fmt,...) { va_list ap; @@ -463,7 +463,7 @@ vmsg(const char *fmt,...) return ch; } -void +void bell() { char c; @@ -472,7 +472,7 @@ bell() write(1, &c, 1); } -int +int search_num(int ch, int max) { int clen = 1; @@ -524,14 +524,14 @@ search_num(int ch, int max) return clen - 1; } -void +void stand_title(char *title) { clear(); prints("\033[1;37;46m¡i %s ¡j\033[m\n", title); } -void +void cursor_show(int row, int column) { move(row, column); @@ -539,14 +539,14 @@ cursor_show(int row, int column) move(row, column + 1); } -void +void cursor_clear(int row, int column) { move(row, column); outs(STR_UNCUR); } -int +int cursor_key(int row, int column) { int ch; @@ -558,7 +558,7 @@ cursor_key(int row, int column) return ch; } -void +void printdash(char *mesg) { int head = 0, tail; @@ -581,7 +581,7 @@ printdash(char *mesg) outch('\n'); } -int +int log_file(char *filename, char *buf) { FILE *fp; @@ -596,7 +596,7 @@ log_file(char *filename, char *buf) return -1; } -void +void show_help(char *helptext[]) { char *str; diff --git a/mbbsd/syspost.c b/mbbsd/syspost.c index 6439a735..965ce93b 100644 --- a/mbbsd/syspost.c +++ b/mbbsd/syspost.c @@ -1,7 +1,7 @@ -/* $Id: syspost.c,v 1.13 2002/07/21 08:18:41 in2 Exp $ */ +/* $Id: syspost.c,v 1.14 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" -void +void post_change_perm(int oldperm, int newperm, char *sysopid, char *userid) { FILE *fp; @@ -43,7 +43,7 @@ post_change_perm(int oldperm, int newperm, char *sysopid, char *userid) } } -void +void post_violatelaw(char *crime, char *police, char *reason, char *result) { char genbuf[200]; @@ -82,7 +82,7 @@ post_violatelaw(char *crime, char *police, char *reason, char *result) } -void +void post_newboard(char *bgroup, char *bname, char *bms) { char genbuf[256], title[128]; @@ -92,7 +92,7 @@ post_newboard(char *bgroup, char *bname, char *bms) post_msg("Record", title, genbuf, "[¨t²Î]"); } -void +void give_money_post(char *userid, int money) { FILE *fp; diff --git a/mbbsd/talk.c b/mbbsd/talk.c index c0fdbb12..c78eb24e 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -1,4 +1,4 @@ -/* $Id: talk.c,v 1.79 2002/07/21 08:18:41 in2 Exp $ */ +/* $Id: talk.c,v 1.80 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" #define QCAST int (*)(const void *, const void *) @@ -31,8 +31,7 @@ typedef struct pickup_t { /* °O¿ý friend ªº user number */ // -#define PICKUP_WAYS 7 //Ãö±¼¤k¤hÀu¥ý -//#define PICKUP_WAYS 6 +#define PICKUP_WAYS 6 static char *fcolor[11] = { "", "\033[36m", "\033[32m", "\033[1;32m", @@ -44,7 +43,7 @@ static char page_requestor[40]; static char description[30]; static FILE *flog; -int +int iswritable_stat(userinfo_t * uentp, int fri_stat) { if (uentp == currutmp) @@ -59,7 +58,7 @@ iswritable_stat(userinfo_t * uentp, int fri_stat) return (uentp->pager != 3 && (fri_stat & HFM || uentp->pager != 4)); } -int +int isvisible_stat(userinfo_t * me, userinfo_t * uentp, int fri_stat) { if (uentp->userid[0] == 0) @@ -150,7 +149,7 @@ modestring(userinfo_t * uentp, int simple) return (modestr); } -int +int set_friend_bit(userinfo_t * me, userinfo_t * ui) { int unum, *myfriends, hit = 0, n; @@ -196,7 +195,7 @@ set_friend_bit(userinfo_t * me, userinfo_t * ui) return hit; } -int +int reverse_friend_stat(int stat) { int stat1 = 0; @@ -213,7 +212,7 @@ reverse_friend_stat(int stat) return stat1; } -int +int login_friend_online(void) { userinfo_t *uentp; @@ -236,7 +235,7 @@ login_friend_online(void) return 0; } -int +int logout_friend_online(userinfo_t * utmp) { int i, j, k; @@ -263,7 +262,7 @@ logout_friend_online(userinfo_t * utmp) } -int +int friend_stat(userinfo_t * me, userinfo_t * ui) { int i, j, hit = 0; @@ -283,7 +282,7 @@ friend_stat(userinfo_t * me, userinfo_t * ui) return hit; } -int +int isvisible_uid(int tuid) { userinfo_t *uentp; @@ -294,7 +293,7 @@ isvisible_uid(int tuid) } /* ¯u¹ê°Ê§@ */ -static void +static void my_kick(userinfo_t * uentp) { char genbuf[200]; @@ -312,7 +311,7 @@ my_kick(userinfo_t * uentp) pressanykey(); } -static void +static void chicken_query(char *userid) { char buf[100]; @@ -335,7 +334,7 @@ chicken_query(char *userid) } } -int +int my_query(char *uident) { userec_t muser; @@ -399,7 +398,7 @@ my_query(char *uident) static char t_last_write[200] = ""; -void +void water_scr(water_t * tw, int which, char type) { if (type == 1) { @@ -445,7 +444,7 @@ water_scr(water_t * tw, int which, char type) } } -void +void my_write2(void) { int i, ch, currstat0; @@ -552,7 +551,7 @@ my_write2(void) * flag = 1 (pre-edit) 5. ¥á¤ô²y flag = 0 6. my_write2 flag = 4 * (pre-edit) but confirm */ -int +int my_write(pid_t pid, char *prompt, char *id, int flag, userinfo_t * puin) { int len, currstat0 = currstat, fri_stat; @@ -663,7 +662,7 @@ my_write(pid_t pid, char *prompt, char *id, int flag, userinfo_t * puin) strlcpy(uin->msgs[uin->msgcount].userid, cuser.userid, sizeof(uin->msgs[uin->msgcount].userid)); strlcpy(uin->msgs[uin->msgcount++].last_call_in, msg, - sizeof(uin->msgs[uin->msgcount++].last_call_in)); + sizeof(uin->msgs[uin->msgcount++].last_call_in)); uin->pager = pager0; } else if (flag != 2) outmsg("\033[1;33;41mÁV¿|! ¹ï¤è¤£¦æ¤F! (¦¬¨ì¤Ó¦h¤ô²y) \033[37m@_@\033[m"); @@ -685,7 +684,7 @@ my_write(pid_t pid, char *prompt, char *id, int flag, userinfo_t * puin) return 1; } -void +void t_display_new(void) { static int t_display_new_flag = 0; @@ -771,7 +770,7 @@ t_display_new(void) t_display_new_flag = 0; } -int +int t_display(void) { char genbuf[200], ans[4]; @@ -807,7 +806,7 @@ t_display(void) return DONOTHING; } -static void +static void do_talk_nextline(talkwin_t * twin) { twin->curcol = 0; @@ -818,7 +817,7 @@ do_talk_nextline(talkwin_t * twin) move(twin->curln, twin->curcol); } -static void +static void do_talk_char(talkwin_t * twin, int ch) { screenline_t *line; @@ -951,7 +950,7 @@ do_talk_char(talkwin_t * twin, int ch) (ch == Ctrl('P')) ? "\033[37;45m(Up)\033[m" : "\033[m"); } -static void +static void do_talk(int fd) { struct talkwin_t mywin, itswin; @@ -1091,7 +1090,7 @@ do_talk(int fd) #define lockreturn(unmode, state) if(lockutmpmode(unmode, state)) return -static void +static void my_talk(userinfo_t * uin, int fri_stat) { int sock, msgsock, length, ch, error = 0; @@ -1343,7 +1342,7 @@ my_talk(userinfo_t * uin, int fri_stat) #define US_ACTION 1232 #define US_REDRAW 1231 -static void +static void t_showhelp() { clear(); @@ -1452,7 +1451,7 @@ descript(int show_mode, userinfo_t * uentp, time_t diff) } #define MAXPICKUP 20 -static int +static int sort_cmpfriend(const void *a, const void *b) { if (((((pickup_t *) a)->friend) & ST_FRIEND) == @@ -1464,7 +1463,7 @@ sort_cmpfriend(const void *a, const void *b) (((pickup_t *) a)->friend & ST_FRIEND); } -int +int pickup_maxpages(int pickupway, int nfriends) { int number; @@ -1476,7 +1475,7 @@ pickup_maxpages(int pickupway, int nfriends) return (number - 1) / MAXPICKUP + 1; } -static int +static int pickup_myfriend(pickup_t * friends, int *myfriend, int *friendme) { @@ -1508,7 +1507,7 @@ pickup_myfriend(pickup_t * friends, return ngets; } -static int +static int pickup_bfriend(pickup_t * friends, int base) { userinfo_t *uentp; @@ -1527,7 +1526,7 @@ pickup_bfriend(pickup_t * friends, int base) return ngets; } -static void +static void pickup(pickup_t * currpickup, int pickup_way, int *page, int *nfriend, int *myfriend, int *friendme, int *bfriend) { @@ -1559,8 +1558,8 @@ pickup(pickup_t * currpickup, int pickup_way, int *page, *nfriend += *bfriend; which = *page * MAXPICKUP; if (*nfriend > which) { - //Ptt: ¥u ¦ ³¦b n ¨ q ¥ X ¤ ~¦³¥²n sort - qsort(friends, *nfriend, sizeof(pickup_t), sort_cmpfriend); + /* ¥u¦³¦bn¨q¥X¤~¦³¥²n sort */ + qsort(friends, *nfriend, sizeof(pickup_t), sort_cmpfriend); size = *nfriend - which; if (size > MAXPICKUP) size = MAXPICKUP; @@ -1599,7 +1598,7 @@ pickup(pickup_t * currpickup, int pickup_way, int *page, currpickup[size].ui = 0; } -static void +static void draw_pickup(int drawall, pickup_t * pickup, int pickup_way, int page, int show_mode, int show_uid, int show_board, int show_pid, int real_name, @@ -1739,7 +1738,7 @@ draw_pickup(int drawall, pickup_t * pickup, int pickup_way, } } -int +int call_in(userinfo_t * uentp, int fri_stat) { if (iswritable_stat(uentp, fri_stat)) { @@ -1751,7 +1750,7 @@ call_in(userinfo_t * uentp, int fri_stat) return 0; } -static void +static void userlist(void) { /* @@ -2276,7 +2275,7 @@ userlist(void) } } -int +int t_users(void) { int destuid0 = currutmp->destuid; @@ -2291,14 +2290,14 @@ t_users(void) return 0; } -int +int t_pager(void) { currutmp->pager = (currutmp->pager + 1) % 5; return 0; } -int +int t_idle(void) { int destuid0 = currutmp->destuid; @@ -2344,7 +2343,7 @@ t_idle(void) return 0; } -int +int t_qchicken(void) { char uident[STRLEN]; @@ -2356,7 +2355,7 @@ t_qchicken(void) return 0; } -int +int t_query(void) { char uident[STRLEN]; @@ -2368,7 +2367,7 @@ t_query(void) return 0; } -int +int t_talk() { char uident[16]; @@ -2417,7 +2416,7 @@ t_talk() /* ¦³¤H¨Ó¦êªù¤l¤F¡A¦^À³©I¥s¾¹ */ static userinfo_t *uip; -void +void talkreply(void) { struct hostent *h; diff --git a/mbbsd/term.c b/mbbsd/term.c index aa310212..ced6b1c4 100644 --- a/mbbsd/term.c +++ b/mbbsd/term.c @@ -1,4 +1,4 @@ -/* $Id: term.c,v 1.4 2002/07/05 17:10:28 in2 Exp $ */ +/* $Id: term.c,v 1.5 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" int tgetent(const char *bp, char *name); @@ -14,7 +14,7 @@ static struct termios tty_state, tty_new; /* ----------------------------------------------------- */ /* basic tty control */ /* ----------------------------------------------------- */ -void +void init_tty() { if (tcgetattr(1, &tty_state) < 0) { @@ -41,7 +41,7 @@ init_tty() static char *outp; static int *outlp; -static int +static int outcf(int ch) { if (*outlp < TERMCOMSIZE) { @@ -52,7 +52,7 @@ outcf(int ch) } #endif -static void +static void term_resize(int sig) { struct winsize newsize; @@ -77,7 +77,7 @@ term_resize(int sig) signal(SIGWINCH, term_resize); } -int +int term_init() { signal(SIGWINCH, term_resize); @@ -86,7 +86,7 @@ term_init() char term_buf[32]; -void +void do_move(int destcol, int destline) { char buf[16], *p; @@ -96,21 +96,21 @@ do_move(int destcol, int destline) ochar(*p); } -void +void save_cursor() { ochar('\33'); ochar('7'); } -void +void restore_cursor() { ochar('\33'); ochar('8'); } -void +void change_scroll_range(int top, int bottom) { char buf[16], *p; @@ -120,7 +120,7 @@ change_scroll_range(int top, int bottom) ochar(*p); } -void +void scroll_forward() { ochar('\33'); diff --git a/mbbsd/toolkit.c b/mbbsd/toolkit.c index 9623c578..99f80e0b 100644 --- a/mbbsd/toolkit.c +++ b/mbbsd/toolkit.c @@ -1,7 +1,7 @@ -/* $Id: toolkit.c,v 1.3 2002/07/05 17:10:28 in2 Exp $ */ +/* $Id: toolkit.c,v 1.4 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" -unsigned +unsigned StringHash(unsigned char *s) { unsigned int v = 0; diff --git a/mbbsd/topsong.c b/mbbsd/topsong.c index 277ef85f..a745b4a5 100644 --- a/mbbsd/topsong.c +++ b/mbbsd/topsong.c @@ -1,4 +1,4 @@ -/* $Id: topsong.c,v 1.4 2002/07/21 08:18:42 in2 Exp $ */ +/* $Id: topsong.c,v 1.5 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" #define MAX_SONGS 300 @@ -12,20 +12,20 @@ typedef struct songcmp_t { static long int totalcount = 0; -static int +static int count_cmp(songcmp_t * b, songcmp_t * a) { return (a->count - b->count); } -int +int topsong() { more(FN_TOPSONG, YEA); return 0; } -static int +static int strip_blank(char *cbuf, char *buf) { for (; *buf; buf++) @@ -35,7 +35,7 @@ strip_blank(char *cbuf, char *buf) return 0; } -void +void sortsong() { FILE *fo, *fp = fopen(BBSHOME "/" FN_USSONG, "r"); diff --git a/mbbsd/user.c b/mbbsd/user.c index 97c9690d..60b51b1f 100644 --- a/mbbsd/user.c +++ b/mbbsd/user.c @@ -1,4 +1,4 @@ -/* $Id: user.c,v 1.30 2002/07/21 08:18:42 in2 Exp $ */ +/* $Id: user.c,v 1.31 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" static char *sex[8] = { @@ -6,7 +6,7 @@ static char *sex[8] = { MSG_MAN, MSG_WOMAN, MSG_PLANT, MSG_MIME }; -int +int u_loginview() { int i; @@ -39,7 +39,7 @@ u_loginview() return 0; } -void +void user_display(userec_t * u, int real) { int diff = 0; @@ -116,7 +116,7 @@ user_display(userec_t * u, int real) #endif } -void +void mail_violatelaw(char *crime, char *police, char *reason, char *result) { char genbuf[200]; @@ -140,7 +140,7 @@ mail_violatelaw(char *crime, char *police, char *reason, char *result) append_record(genbuf, &fhdr, sizeof(fhdr)); } -static void +static void violate_law(userec_t * u, int unum) { char ans[4], ans2[4]; @@ -196,7 +196,7 @@ violate_law(userec_t * u, int unum) } -void +void uinfo_query(userec_t * u, int real, int unum) { userec_t x; @@ -529,7 +529,7 @@ uinfo_query(userec_t * u, int real, int unum) } } -int +int u_info() { move(2, 0); @@ -540,7 +540,7 @@ u_info() return 0; } -int +int u_ansi() { showansi ^= 1; @@ -549,14 +549,14 @@ u_ansi() return 0; } -int +int u_cloak() { outs((currutmp->invisible ^= 1) ? MSG_CLOAKED : MSG_UNCLOAK); return XEASY; } -int +int u_switchproverb() { /* char *state[4]={"¥Î¥\\«¬","¦w¶h«¬","¦Û©w«¬","SHUTUP"}; */ @@ -574,7 +574,7 @@ u_switchproverb() return 0; } -int +int u_editproverb() { char buf[100]; @@ -591,7 +591,7 @@ u_editproverb() return 0; } -void +void showplans(char *uid) { char genbuf[200]; @@ -601,7 +601,7 @@ showplans(char *uid) prints("¡mÓ¤H¦W¤ù¡n%s ¥Ø«e¨S¦³¦W¤ù", uid); } -int +int showsignature(char *fname) { FILE *fp; @@ -625,7 +625,7 @@ showsignature(char *fname) return j; } -int +int u_editsig() { int aborted; @@ -664,7 +664,7 @@ u_editsig() return 0; } -int +int u_editplan() { char genbuf[200]; @@ -690,7 +690,7 @@ u_editplan() return 0; } -int +int u_editcalendar() { char genbuf[200]; @@ -717,7 +717,7 @@ u_editcalendar() } /* ¨Ï¥ÎªÌ¶ñ¼gµù¥Uªí®æ */ -static void +static void getfield(int line, char *info, char *desc, char *buf, int len) { char prompt[STRLEN]; @@ -734,7 +734,7 @@ getfield(int line, char *info, char *desc, char *buf, int len) clrtoeol(); } -static int +static int removespace(char *s) { int i, index; @@ -747,7 +747,7 @@ removespace(char *s) return index; } -static int +static int ispersonalid(char *inid) { char *lst = "ABCDEFGHJKLMNPQRSTUVWXYZIO", id[20]; @@ -782,7 +782,7 @@ getregcode(char *buf) return buf; } -static int +static int isvaildemail(char *email) { FILE *fp; @@ -810,7 +810,7 @@ isvaildemail(char *email) return 1; } -static void +static void toregister(char *email, char *genbuf, char *phone, char *career, char *ident, char *rname, char *addr, char *mobile) { @@ -924,7 +924,7 @@ toregister(char *email, char *genbuf, char *phone, char *career, } } -int +int u_register(void) { char rname[21], addr[51], ident[12], mobile[21]; @@ -1045,12 +1045,12 @@ u_register(void) while (1) { getfield(7, "¾Ç®Õ(§t\033[1;33m¨t©Ò¦~¯Å\033[m)©Î³æ¦ì¾ºÙ", "ªA°È³æ¦ì", career, 40); - if(!(removespace(career) && career[0] < 0 && strlen(career) >= 4)){ + if (!(removespace(career) && career[0] < 0 && strlen(career) >= 4)) { vmsg("±zªº¿é¤J¤£¥¿½T"); continue; } - if( strcmp(&career[strlen(career) - 2], "¤j") == 0 || - strcmp(&career[strlen(career) - 4], "¤j¾Ç") == 0 ){ + if (strcmp(&career[strlen(career) - 2], "¤j") == 0 || + strcmp(&career[strlen(career) - 4], "¤j¾Ç") == 0) { vmsg("³Â·Ð½Ð¥[¨t©Ò"); continue; } @@ -1060,15 +1060,15 @@ u_register(void) getfield(9, "§t\033[1;33m¿¤¥«\033[m¤Îªù¹ì¸¹½X" "(¥x¥_½Ð¥[\033[1;33m¦æ¬F°Ï\033[m)", "¥Ø«e¦í§}", addr, 50); - if( !removespace(addr) || addr[0] > 0 || strlen(addr) < 15 ){ + if (!removespace(addr) || addr[0] > 0 || strlen(addr) < 15) { vmsg("³oÓ¦a§}¨Ã¤£¦Xªk"); continue; } - if( strstr(addr, "«H½c") != NULL || strstr(addr, "¶l¬F") != NULL ){ + if (strstr(addr, "«H½c") != NULL || strstr(addr, "¶l¬F") != NULL) { vmsg("©êºp§Ṳ́£±µ¨ü¶l¬F«H½c"); continue; } - if( strstr(addr, "¥«") == NULL && strstr(addr, "¿¤") == NULL ){ + if (strstr(addr, "¥«") == NULL && strstr(addr, "¿¤") == NULL) { vmsg("³oÓ¦a§}¨Ã¤£¦Xªk"); continue; } @@ -1076,8 +1076,8 @@ u_register(void) } while (1) { getfield(11, "¤£¥[-(), ¥]¬Aªø³~°Ï¸¹", "³sµ¸¹q¸Ü", phone, 11); - if( !removespace(phone) || phone[0] != '0' || - strlen(phone) < 9 || phone[1] == '0' ){ + if (!removespace(phone) || phone[0] != '0' || + strlen(phone) < 9 || phone[1] == '0') { vmsg("³oÓ¹q¸Ü¸¹½X¨Ã¤£¦Xªk"); continue; } @@ -1147,7 +1147,7 @@ u_register(void) static int usercounter, totalusers, showrealname; static ushort u_list_special; -static int +static int u_list_CB(userec_t * uentp) { static int i; @@ -1217,7 +1217,7 @@ u_list_CB(userec_t * uentp) return 0; } -int +int u_list() { char genbuf[3]; diff --git a/mbbsd/var.c b/mbbsd/var.c index 221c9cb4..2cca1e11 100644 --- a/mbbsd/var.c +++ b/mbbsd/var.c @@ -1,4 +1,4 @@ -/* $Id: var.c,v 1.10 2002/07/05 17:10:28 in2 Exp $ */ +/* $Id: var.c,v 1.11 2002/07/21 09:26:02 in2 Exp $ */ #define INCLUDE_VAR_H #include "bbs.h" @@ -290,9 +290,9 @@ int KEY_ESC_arg; int watermode = -1; int wmofo = -1; /* - * WATERMODE(WATER_ORIG) | WATERMODE(WATER_NEW): Ptt ¤ô²y¦^ÅU - * e = -1 ¨S¦b¦^¤ô²y = 0 ¦b¦^¤W¤@Áû¤ô²y (Ctrl-R) > 0 ¦b¦^«e n Áû¤ô²y - * (Ctrl-R Ctrl-R) + * WATERMODE(WATER_ORIG) | WATERMODE(WATER_NEW): Ptt ¤ô²y¦^ÅU e = -1 + * ¨S¦b¦^¤ô²y = 0 ¦b¦^¤W¤@Áû¤ô²y (Ctrl-R) > 0 ¦b¦^«e n Áû¤ô²y (Ctrl-R + * Ctrl-R) * * WATERMODE(WATER_OFO) by in2 wmofo = -1 ¨S¦b¦^¤ô²y = 0 ¥¿¦b¦^¤ô²y = 1 * ¦^¤ô²y¶¡¤S±µ¨ì¤ô²y wmofo >=0 ®É¦¬¨ì¤ô²y±N¥uÅã¥Ü, ¤£·|¨ìwater[]¸Ì, diff --git a/mbbsd/vice.c b/mbbsd/vice.c index d52f12ad..35a5641f 100644 --- a/mbbsd/vice.c +++ b/mbbsd/vice.c @@ -1,4 +1,4 @@ -/* $Id: vice.c,v 1.4 2002/07/05 17:10:28 in2 Exp $ */ +/* $Id: vice.c,v 1.5 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" #define VICE_PLAY BBSHOME "/etc/vice/vice.play" @@ -14,7 +14,7 @@ #define MAX_LOST_PICTURE 3 #define MAX_END_PICTURE 5 -static int +static int vice_load(char tbingo[6][15]) { FILE *fb = fopen(VICE_BINGO, "r"); @@ -32,7 +32,7 @@ vice_load(char tbingo[6][15]) return 0; } -static int +static int check(char tbingo[6][15], char *data) { int i = 0, j; @@ -46,8 +46,8 @@ check(char tbingo[6][15], char *data) return j - 1; return 0; } -//Ptt:showfile ran_showfile more ¤ T ª Ìn ¾ ã¦X -static int +/* Ptt:showfile ran_showfile more ¤TªÌn¦X */ +static int ran_showfile(int y, int x, char *filename, int maxnum) { FILE *fs; @@ -69,7 +69,7 @@ ran_showfile(int y, int x, char *filename, int maxnum) return 1; } -static int +static int ran_showmfile(char *filename, int maxnum) { char buf[256]; @@ -79,7 +79,7 @@ ran_showmfile(char *filename, int maxnum) } -int +int vice_main() { FILE *fd; diff --git a/mbbsd/vote.c b/mbbsd/vote.c index 8f51ee3a..f2af6047 100644 --- a/mbbsd/vote.c +++ b/mbbsd/vote.c @@ -1,4 +1,4 @@ -/* $Id: vote.c,v 1.11 2002/07/21 08:18:42 in2 Exp $ */ +/* $Id: vote.c,v 1.12 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" static int total; @@ -21,7 +21,7 @@ static char STR_new_comments[] = "comments0\0"; /* §ë²¼ªÌªº«Ø·N */ static char STR_new_limited[] = "limited0\0"; /* ¨p¤H§ë²¼ */ static char STR_new_title[] = "vtitle0\0"; -int +int strip_ansi(char *buf, char *str, int mode) { register int ansi, count = 0; @@ -55,7 +55,7 @@ strip_ansi(char *buf, char *str, int mode) return count; } -void +void b_suckinfile(FILE * fp, char *fname) { FILE *sfp; @@ -69,7 +69,7 @@ b_suckinfile(FILE * fp, char *fname) } } -static void +static void b_count(char *buf, int counts[]) { char inchar; @@ -89,7 +89,7 @@ b_count(char *buf, int counts[]) } -static int +static int b_nonzeroNum(char *buf) { int i = 0; @@ -105,7 +105,7 @@ b_nonzeroNum(char *buf) return i; } -static void +static void vote_report(char *bname, char *fname, char *fpath) { register char *ip; @@ -157,7 +157,7 @@ vote_report(char *bname, char *fname, char *fpath) } } -static void +static void b_result_one(boardheader_t * fh, int ind) { FILE *cfp, *tfp, *frp, *xfp; @@ -276,7 +276,7 @@ b_result_one(boardheader_t * fh, int ind) Rename(b_newresults, buf); } -static void +static void b_result(boardheader_t * fh) { FILE *cfp; @@ -303,7 +303,7 @@ b_result(boardheader_t * fh) } } -static int +static int b_close(boardheader_t * fh) { @@ -318,7 +318,7 @@ b_close(boardheader_t * fh) return 1; } -int +int b_closepolls() { static char *fn_vote_polling = ".polling"; @@ -356,7 +356,7 @@ b_closepolls() return 0; } -static int +static int vote_view(char *bname, int index) { boardheader_t *fhp; @@ -466,7 +466,7 @@ vote_view(char *bname, int index) return FULLUPDATE; } -static int +static int vote_view_all(char *bname) { int i; @@ -534,7 +534,7 @@ vote_view_all(char *bname) return FULLUPDATE; } -static int +static int vote_maintain(char *bname) { FILE *fp = NULL; @@ -727,7 +727,7 @@ vote_maintain(char *bname) return FULLUPDATE; } -static int +static int vote_flag(char *bname, int index, char val) { char buf[256], flag; @@ -758,7 +758,7 @@ vote_flag(char *bname, int index, char val) return flag; } -static int +static int same(char compare, char list[], int num) { int n; @@ -773,7 +773,7 @@ same(char compare, char list[], int num) return rep; } -static int +static int user_vote_one(char *bname, int ind) { FILE *cfp, *fcm; @@ -943,7 +943,7 @@ user_vote_one(char *bname, int ind) return FULLUPDATE; } -static int +static int user_vote(char *bname) { int pos; @@ -1033,7 +1033,7 @@ user_vote(char *bname) return FULLUPDATE; } -static int +static int vote_results(char *bname) { char buf[STRLEN]; @@ -1044,19 +1044,19 @@ vote_results(char *bname) return FULLUPDATE; } -int +int b_vote_maintain() { return vote_maintain(currboard); } -int +int b_vote() { return user_vote(currboard); } -int +int b_results() { return vote_results(currboard); diff --git a/mbbsd/voteboard.c b/mbbsd/voteboard.c index 1aa05ee9..6a7d7b87 100644 --- a/mbbsd/voteboard.c +++ b/mbbsd/voteboard.c @@ -1,9 +1,9 @@ -/* $Id: voteboard.c,v 1.11 2002/07/21 08:18:42 in2 Exp $ */ +/* $Id: voteboard.c,v 1.12 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" #define VOTEBOARD "NewBoard" -void +void do_voteboardreply(fileheader_t * fhdr) { char genbuf[1024]; @@ -175,7 +175,7 @@ do_voteboardreply(fileheader_t * fhdr) #endif } -int +int do_voteboard() { fileheader_t votefile; diff --git a/mbbsd/xyz.c b/mbbsd/xyz.c index 21701df8..e277421d 100644 --- a/mbbsd/xyz.c +++ b/mbbsd/xyz.c @@ -1,9 +1,9 @@ -/* $Id: xyz.c,v 1.10 2002/07/05 17:10:28 in2 Exp $ */ +/* $Id: xyz.c,v 1.11 2002/07/21 09:26:02 in2 Exp $ */ #include "bbs.h" /* ¦UºØ²Îp¤Î¬ÛÃö¸ê°T¦Cªí */ /* Ptt90¦~«×¤j¾ÇÁp©Û¬dº]¨t²Î */ -int +int x_90() { strcpy(dict, "(90)ã¦ÒÃÒ¸¹/©m¦W/¾Ç®Õ/¬ì¨t/Ãþ²Õ"); @@ -13,7 +13,7 @@ x_90() } /* Ptt89¦~«×¤j¾ÇÁp©Û¬dº]¨t²Î */ -int +int x_89() { strcpy(dict, "(89)ã¦ÒÃÒ¸¹/©m¦W/¾Ç®Õ/¬ì¨t/Ãþ²Õ"); @@ -22,7 +22,7 @@ x_89() return 0; } /* Ptt88¦~«×¤j¾ÇÁp©Û¬dº]¨t²Î */ -int +int x_88() { strcpy(dict, "(88)ã¦ÒÃÒ¸¹/©m¦W/¾Ç®Õ/¬ì¨t/Ãþ²Õ"); @@ -31,7 +31,7 @@ x_88() return 0; } /* Ptt87¦~«×¤j¾ÇÁp©Û¬dº]¨t²Î */ -int +int x_87() { strcpy(dict, "(87)ã¦ÒÃÒ¸¹/©m¦W/¾Ç®Õ/¬ì¨t"); @@ -41,7 +41,7 @@ x_87() } /* Ptt86¦~«×¤j¾ÇÁp©Û¬dº]¨t²Î */ -int +int x_86() { strcpy(dict, "(86)ã¦ÒÃÒ¸¹/©m¦W/¾Ç®Õ/¬ì¨t"); @@ -50,21 +50,21 @@ x_86() return 0; } -int +int x_boardman() { more("etc/topboardman", YEA); return 0; } -int +int x_user100() { more("etc/topusr100", YEA); return 0; } -int +int x_history() { more("etc/history", YEA); @@ -72,7 +72,7 @@ x_history() } #ifdef HAVE_X_BOARDS -static int +static int x_boards() { more("etc/topboard.tmp", YEA); @@ -80,63 +80,63 @@ x_boards() } #endif -int +int x_birth() { more("etc/birth.today", YEA); return 0; } -int +int x_weather() { more("etc/weather.tmp", YEA); return 0; } -int +int x_stock() { more("etc/stock.tmp", YEA); return 0; } -int +int x_note() { more(fn_note_ans, YEA); return 0; } -int +int x_issue() { more("etc/day", YEA); return 0; } -int +int x_week() { more("etc/week", YEA); return 0; } -int +int x_today() { more("etc/today", YEA); return 0; } -int +int x_yesterday() { more("etc/yesterday", YEA); return 0; } -int +int x_login() { more("etc/Welcome_login.0", YEA); @@ -144,7 +144,7 @@ x_login() } #ifdef HAVE_INFO -static int +static int x_program() { more("etc/version", YEA); @@ -153,7 +153,7 @@ x_program() #endif #ifdef HAVE_LICENSE -static int +static int x_gpl() { more("etc/GPL", YEA); @@ -161,7 +161,7 @@ x_gpl() } #endif -int +int note() { static char *fn_note_tmp = "note.tmp"; @@ -273,7 +273,7 @@ note() return 0; } -static void +static void mail_sysop() { FILE *fp; @@ -324,7 +324,7 @@ mail_sysop() } } -int +int m_sysop() { setutmpmode(MSYSOP); @@ -332,7 +332,7 @@ m_sysop() return 0; } -int +int Goodbye() { char genbuf[100]; @@ -378,7 +378,7 @@ Goodbye() #define MAXPATHLEN 256 #ifdef HAVE_TIN -static int +static int x_tin() { clear(); @@ -387,7 +387,7 @@ x_tin() #endif #ifdef HAVE_GOPHER -static int +static int x_gopher() { clear(); @@ -396,7 +396,7 @@ x_gopher() #endif #ifdef HAVE_WWW -static int +static int x_www() { return exec_cmd(WWW, NA, "bin/www.sh", "WWW"); @@ -404,7 +404,7 @@ x_www() #endif #ifdef HAVE_IRC -static int +static int x_irc() { return exec_cmd(XMODE, NA, "bin/irc.sh", "IRC"); @@ -412,7 +412,7 @@ x_irc() #endif #ifdef HAVE_ARCHIE -static int +static int x_archie() { char buf[STRLEN], ans[4]; |