summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-08-04 11:28:03 +0800
committerwens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-08-04 11:28:03 +0800
commit3cfbc9d6e1b548904c323e8c9a782ca0e82e1c4f (patch)
tree0f02d2f3430a3a4c83e065be714911e6692973a2
parent0e2472de4ee9255a0c26b8cffdbeedb886d57c68 (diff)
downloadpttbbs-3cfbc9d6e1b548904c323e8c9a782ca0e82e1c4f.tar
pttbbs-3cfbc9d6e1b548904c323e8c9a782ca0e82e1c4f.tar.gz
pttbbs-3cfbc9d6e1b548904c323e8c9a782ca0e82e1c4f.tar.bz2
pttbbs-3cfbc9d6e1b548904c323e8c9a782ca0e82e1c4f.tar.lz
pttbbs-3cfbc9d6e1b548904c323e8c9a782ca0e82e1c4f.tar.xz
pttbbs-3cfbc9d6e1b548904c323e8c9a782ca0e82e1c4f.tar.zst
pttbbs-3cfbc9d6e1b548904c323e8c9a782ca0e82e1c4f.zip
Use file_exist_record directly
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4392 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--common/bbs/Makefile2
-rw-r--r--common/bbs/file.c9
-rw-r--r--include/cmbbs.h3
-rw-r--r--mbbsd/cache.c2
-rw-r--r--mbbsd/friend.c4
-rw-r--r--mbbsd/mail.c12
-rw-r--r--mbbsd/vote.c2
7 files changed, 11 insertions, 23 deletions
diff --git a/common/bbs/Makefile b/common/bbs/Makefile
index 458a01e6..d06df6a3 100644
--- a/common/bbs/Makefile
+++ b/common/bbs/Makefile
@@ -5,7 +5,7 @@ MKPIC:=no
SRCROOT:= ../..
.include "$(SRCROOT)/pttbbs.mk"
-SRCS:= log.c file.c money.c names.c path.c time.c string.c fhdr_stamp.c
+SRCS:= log.c money.c names.c path.c time.c string.c fhdr_stamp.c
LIB:= cmbbs
install:
diff --git a/common/bbs/file.c b/common/bbs/file.c
deleted file mode 100644
index 8222d1f6..00000000
--- a/common/bbs/file.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include "cmsys.h"
-#include "cmbbs.h"
-
-int
-belong(const char *filelist, const char *key)
-{
- return file_exist_record(filelist, key);
-}
-
diff --git a/include/cmbbs.h b/include/cmbbs.h
index 830d2064..6683975e 100644
--- a/include/cmbbs.h
+++ b/include/cmbbs.h
@@ -21,9 +21,6 @@ extern void sethomefile(char *buf, const char *userid, const char *fname);
// setbdir
// setuserfile
-/* file.c */
-extern int belong(const char *filelist, const char *key);
-
/* money.c */
extern int give_tax(int money);
extern const char* money_level(int money);
diff --git a/mbbsd/cache.c b/mbbsd/cache.c
index 882204ad..38f4a0b0 100644
--- a/mbbsd/cache.c
+++ b/mbbsd/cache.c
@@ -727,7 +727,7 @@ postperm_msg(const char *bname)
return NULL;
setbfile(buf, bname, fn_water);
- if (belong(buf, cuser.userid))
+ if (file_exist_record(buf, cuser.userid))
return "使用者水桶中";
if (!strcasecmp(bname, DEFAULT_BOARD))
diff --git a/mbbsd/friend.c b/mbbsd/friend.c
index abb736c7..1d63335e 100644
--- a/mbbsd/friend.c
+++ b/mbbsd/friend.c
@@ -74,7 +74,7 @@ friend_add(const char *uident, int type, const char* des)
if (friend_count(fpath) > friend_max[type])
return;
- if ((uident[0] > ' ') && !belong(fpath, uident)) {
+ if ((uident[0] > ' ') && !file_exist_record(fpath, uident)) {
char buf[MAX_DESCLEN] = "", buf2[STRLEN];
char t_uident[IDLEN + 1];
@@ -635,7 +635,7 @@ t_fix_aloha()
// xid in my override list?
setuserfile(fn, "alohaed");
- if (belong(fn, xid))
+ if (file_exist_record(fn, xid))
{
prints(ANSI_COLOR(1;32) "[%s] 確實在你的上站通知名單內。"
"請編輯 [上站通知名單]。" ANSI_RESET "\n", xid);
diff --git a/mbbsd/mail.c b/mbbsd/mail.c
index 019f4695..d598c9a7 100644
--- a/mbbsd/mail.c
+++ b/mbbsd/mail.c
@@ -411,10 +411,10 @@ do_innersend(const char *userid, char *mfpath, const char *title)
strlcpy(mhdr.title, save_title, sizeof(mhdr.title));
sethomefile(fpath, userid, FN_OVERRIDES);
- i = belong(fpath, cuser.userid);
+ i = file_exist_record(fpath, cuser.userid);
sethomefile(fpath, userid, FN_REJECT);
- if (i || !belong(fpath, cuser.userid)) {/* Ptt: 用belong有點討厭 */
+ if (i || !file_exist_record(fpath, cuser.userid)) {/* Ptt: 用belong有點討厭 */
sethomedir(fpath, userid);
if (append_record_forward(fpath, &mhdr, sizeof(mhdr), userid) == -1)
{
@@ -713,9 +713,9 @@ multi_send(char *title)
// searchuser modifies it
if (searchuser(p, p) && strcmp(STR_GUEST, p)) {
sethomefile(genbuf, p, FN_OVERRIDES);
- if (!belong(genbuf, cuser.userid)) { // not friend, check if rejected
+ if (!file_exist_record(genbuf, cuser.userid)) { // not friend, check if rejected
sethomefile(genbuf, p, FN_REJECT);
- if (belong(genbuf, cuser.userid))
+ if (file_exist_record(genbuf, cuser.userid))
continue;
}
sethomepath(genbuf, p);
@@ -2100,10 +2100,10 @@ doforward(const char *direct, const fileheader_t * fh, int mode)
break;
sethomefile(fpath, xid, FN_OVERRIDES);
- i = belong(fpath, cuser.userid);
+ i = file_exist_record(fpath, cuser.userid);
sethomefile(fpath, xid, FN_REJECT);
// TODO 該 return 哪種值?
- if (!i && belong(fpath, cuser.userid))
+ if (!i && file_exist_record(fpath, cuser.userid))
return -1;
} while (0);
diff --git a/mbbsd/vote.c b/mbbsd/vote.c
index ff6cbb96..f64a6f7e 100644
--- a/mbbsd/vote.c
+++ b/mbbsd/vote.c
@@ -789,7 +789,7 @@ user_vote_one(vote_buffer_t *vbuf, const char *bname, int ind)
setbfile(buf, bname, vbuf->limited); /* Ptt */
if (dashf(buf)) {
setbfile(buf, bname, FN_CANVOTE);
- if (!belong(buf, cuser.userid)) {
+ if (!file_exist_record(buf, cuser.userid)) {
fclose(cfp);
vmsg("對不起! 這是私人投票..你並沒有受邀唷!");
return FULLUPDATE;