summaryrefslogtreecommitdiffstats
path: root/mbbsd/kaede.c
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-07-06 01:10:28 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-07-06 01:10:28 +0800
commit1603deaec5d0a94c9a8201b0ba286e8e492a3602 (patch)
treee6405cfd39f8ac166ab7d00752ed6cfa3ac0a928 /mbbsd/kaede.c
parent10bda3e57cad194ac33ccdcd01aee2d935f1544a (diff)
downloadpttbbs-1603deaec5d0a94c9a8201b0ba286e8e492a3602.tar
pttbbs-1603deaec5d0a94c9a8201b0ba286e8e492a3602.tar.gz
pttbbs-1603deaec5d0a94c9a8201b0ba286e8e492a3602.tar.bz2
pttbbs-1603deaec5d0a94c9a8201b0ba286e8e492a3602.tar.lz
pttbbs-1603deaec5d0a94c9a8201b0ba286e8e492a3602.tar.xz
pttbbs-1603deaec5d0a94c9a8201b0ba286e8e492a3602.tar.zst
pttbbs-1603deaec5d0a94c9a8201b0ba286e8e492a3602.zip
indent
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@415 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/kaede.c')
-rw-r--r--mbbsd/kaede.c77
1 files changed, 43 insertions, 34 deletions
diff --git a/mbbsd/kaede.c b/mbbsd/kaede.c
index e529aa3d..e3fd1b62 100644
--- a/mbbsd/kaede.c
+++ b/mbbsd/kaede.c
@@ -1,89 +1,98 @@
-/* $Id: kaede.c,v 1.7 2002/06/26 08:39:07 ptt Exp $ */
+/* $Id: kaede.c,v 1.8 2002/07/05 17:10:27 in2 Exp $ */
#include "bbs.h"
-char *Ptt_prints(char *str, int mode) {
- char *po , strbuf[256];
+char *
+Ptt_prints(char *str, int mode)
+{
+ char *po, strbuf[256];
- while((po = strstr(str, "\033*s"))) {
+ while ((po = strstr(str, "\033*s"))) {
po[0] = 0;
sprintf(strbuf, "%s%s%s", str, cuser.userid, po + 3);
strcpy(str, strbuf);
}
- while((po = strstr(str, "\033*t"))) {
+ while ((po = strstr(str, "\033*t"))) {
po[0] = 0;
sprintf(strbuf, "%s%s", str, Cdate(&now));
- str[strlen(strbuf)-1] = 0;
+ str[strlen(strbuf) - 1] = 0;
strcat(strbuf, po + 3);
strcpy(str, strbuf);
}
- while((po = strstr(str, "\033*u"))) {
- int attempts;
+ while ((po = strstr(str, "\033*u"))) {
+ int attempts;
attempts = SHM->UTMPnumber;
po[0] = 0;
sprintf(strbuf, "%s%d%s", str, attempts, po + 3);
strcpy(str, strbuf);
}
- while((po = strstr(str, "\033*b"))) {
+ while ((po = strstr(str, "\033*b"))) {
po[0] = 0;
sprintf(strbuf, "%s%d/%d%s", str, cuser.month, cuser.day, po + 3);
strcpy(str, strbuf);
}
- while((po = strstr(str, "\033*l"))) {
+ while ((po = strstr(str, "\033*l"))) {
po[0] = 0;
sprintf(strbuf, "%s%d%s", str, cuser.numlogins, po + 3);
strcpy(str, strbuf);
}
- while((po = strstr(str, "\033*p"))) {
+ while ((po = strstr(str, "\033*p"))) {
po[0] = 0;
sprintf(strbuf, "%s%d%s", str, cuser.numposts, po + 3);
strcpy(str, strbuf);
}
- while((po = strstr(str, "\033*n"))) {
+ while ((po = strstr(str, "\033*n"))) {
po[0] = 0;
sprintf(strbuf, "%s%s%s", str, cuser.username, po + 3);
strcpy(str, strbuf);
}
- while((po = strstr(str, "\033*m"))) {
+ while ((po = strstr(str, "\033*m"))) {
po[0] = 0;
sprintf(strbuf, "%s%d%s", str, cuser.money, po + 3);
strcpy(str, strbuf);
}
- strip_ansi(str, str ,mode);
+ strip_ansi(str, str, mode);
return str;
}
-int Rename(char* src, char* dst) {
- char buf[256];
- if(rename(src, dst) == 0)
- return 0;
- if(!strchr(src,';') && !strchr(dst,';')) // Ptt ¨¾¤£¥¿±`«ü¥O
- {
- sprintf(buf,"/bin/mv %s %s",src,dst);
- system(buf);
- }
+int
+Rename(char *src, char *dst)
+{
+ char buf[256];
+ if (rename(src, dst) == 0)
+ return 0;
+ if (!strchr(src, ';') && !strchr(dst, ';'))
+ //Ptt ¨ ¾¤£¥¿±`«ü¥O
+ {
+ sprintf(buf, "/bin/mv %s %s", src, dst);
+ system(buf);
+ }
return -1;
}
-int Link(char* src, char* dst) {
- char cmd[200];
-
- if(strcmp(src, BBSHOME "/home") == 0)
- return 1;
- if(symlink(dst, src) == 0)
+int
+Link(char *src, char *dst)
+{
+ char cmd[200];
+
+ if (strcmp(src, BBSHOME "/home") == 0)
+ return 1;
+ if (symlink(dst, src) == 0)
return 0;
-
+
sprintf(cmd, "/bin/cp -R %s %s", src, dst);
return system(cmd);
}
-char *my_ctime(const time_t *t) {
- struct tm *tp;
- static char ans[100];
+char *
+my_ctime(const time_t * t)
+{
+ struct tm *tp;
+ static char ans[100];
tp = localtime(t);
sprintf(ans, "%02d/%02d/%02d %02d:%02d:%02d", (tp->tm_year % 100),
- tp->tm_mon + 1,tp->tm_mday, tp->tm_hour, tp->tm_min, tp->tm_sec);
+ tp->tm_mon + 1, tp->tm_mday, tp->tm_hour, tp->tm_min, tp->tm_sec);
return ans;
}