summaryrefslogtreecommitdiffstats
path: root/mbbsd/bbs.c
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd/bbs.c')
-rw-r--r--mbbsd/bbs.c2055
1 files changed, 1064 insertions, 991 deletions
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©w­n±ÀÂËÂ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©w­n±ÀÂË, ½Ð¥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©w­n±ÀÂËÂ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©w­n±ÀÂË, ½Ð¥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("©p­n¬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("©p­n¬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