summaryrefslogtreecommitdiffstats
path: root/mbbsd/cal.c
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-04-26 23:28:24 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-04-26 23:28:24 +0800
commit4b502e05397babe1c8050adb99c2f3e1ebcce641 (patch)
tree728b6c056cdbb67dc8579b5d789a967c1ad9858e /mbbsd/cal.c
parentc144625766bb0db3b3f0bc5718fbe55d356e449f (diff)
parenta08baf738de7959e912f5b12314da85eaea5a3c9 (diff)
downloadpttbbs-4b502e05397babe1c8050adb99c2f3e1ebcce641.tar
pttbbs-4b502e05397babe1c8050adb99c2f3e1ebcce641.tar.gz
pttbbs-4b502e05397babe1c8050adb99c2f3e1ebcce641.tar.bz2
pttbbs-4b502e05397babe1c8050adb99c2f3e1ebcce641.tar.lz
pttbbs-4b502e05397babe1c8050adb99c2f3e1ebcce641.tar.xz
pttbbs-4b502e05397babe1c8050adb99c2f3e1ebcce641.tar.zst
pttbbs-4b502e05397babe1c8050adb99c2f3e1ebcce641.zip
simplify thread() i_read() git-svn-id: http://opensvn.csie.org/pttbbs/branches/Ptt.read@1862 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/cal.c')
-rw-r--r--mbbsd/cal.c54
1 files changed, 7 insertions, 47 deletions
diff --git a/mbbsd/cal.c b/mbbsd/cal.c
index dca13c4d..3430ae75 100644
--- a/mbbsd/cal.c
+++ b/mbbsd/cal.c
@@ -96,18 +96,13 @@ osong(char *defaultid)
/* Jaky �@�H�@���I�@�� */
if (!strcmp(buf, Cdatedate(&cuser.lastsong)) && !HAS_PERM(PERM_SYSOP)) {
move(22, 0);
- outs("�A���Ѥw�g�I�L�o�A���ѦA�I�a....");
- refresh();
- pressanykey();
-
+ vmsg("�A���Ѥw�g�I�L�o�A���ѦA�I�a....");
unlockutmpmode();
return 0;
}
if (cuser.money < 200) {
move(22, 0);
- outs("�I�q�n200�ȭ�!....");
- refresh();
- pressanykey();
+ vmsg("�I�q�n200�ȭ�!....");
unlockutmpmode();
return 0;
}
@@ -262,18 +257,12 @@ inmailbox(int m)
int
p_cloak()
{
- char buf[4];
- getdata(b_lines - 1, 0,
- currutmp->invisible ? "�T�w�n�{��?[y/N]" : "�T�w�n����?[y/N]",
- buf, sizeof(buf), LCECHO);
- if (buf[0] != 'y')
+ if (getans(currutmp->invisible ? "�T�w�n�{��?[y/N]" : "�T�w�n����?[y/N]") != 'y')
return 0;
if (cuser.money >= 19) {
vice(19, "�I�O����");
currutmp->invisible %= 2;
- outs((currutmp->invisible ^= 1) ? MSG_CLOAKED : MSG_UNCLOAK);
- refresh();
- safe_sleep(1);
+ vmsg((currutmp->invisible ^= 1) ? MSG_CLOAKED : MSG_UNCLOAK);
}
return 0;
}
@@ -282,10 +271,7 @@ p_cloak()
int
p_from()
{
- char ans[4];
-
- getdata(b_lines - 2, 0, "�T�w�n��G�m?[y/N]", ans, sizeof(ans), LCECHO);
- if (ans[0] != 'y')
+ if (getans("�T�w�n��G�m?[y/N]") != 'y')
return 0;
reload_money();
if (cuser.money < 49)
@@ -305,8 +291,7 @@ p_exmail()
int n;
if (cuser.exmailbox >= MAX_EXKEEPMAIL) {
- prints("�e�q�̦h�W�[ %d �ʡA����A�R�F�C", MAX_EXKEEPMAIL);
- refresh();
+ vmsg("�e�q�̦h�W�[ %d �ʡA����A�R�F�C", MAX_EXKEEPMAIL);
return 0;
}
snprintf(buf, sizeof(buf),
@@ -393,9 +378,7 @@ p_give()
snprintf(genbuf, sizeof(genbuf), "%s\t��%s\t%d\t%s",
cuser.userid, id, money - tax, ctime(&now));
log_file(FN_MONEY, genbuf, 1);
- genbuf[0] = 'n';
- getdata(3, 0, "�n�ۦ�Ѽg���]�U�ܡH[y/N]", genbuf, 2, LCECHO);
- mail_redenvelop(cuser.userid, id, money - tax, genbuf[0]);
+ mail_redenvelop(cuser.userid, id, money - tax, getans("�n�ۦ�Ѽg���]�U�ܡH[y/N]"));
}
return 0;
}
@@ -444,26 +427,3 @@ p_sysinfo(void)
return 0;
}
-/* �p�p��� */
-#if 0
-static void
-ccount(float *a, float b, int cmode)
-{
- switch (cmode) {
- case 0:
- case 1:
- case 2:
- *a += b;
- break;
- case 3:
- *a -= b;
- break;
- case 4:
- *a *= b;
- break;
- case 5:
- *a /= b;
- break;
- }
-}
-#endif