summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-04-15 21:57:20 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-04-15 21:57:20 +0800
commit08666c93cbcadc1787ed05093992630b891ff498 (patch)
treea1449055e1f4fd98e4420c6bea8572206ffc6ac5 /util
parent1a77a39f25006a3f73b36365220c3168c59f9fd2 (diff)
downloadpttbbs-08666c93cbcadc1787ed05093992630b891ff498.tar
pttbbs-08666c93cbcadc1787ed05093992630b891ff498.tar.gz
pttbbs-08666c93cbcadc1787ed05093992630b891ff498.tar.bz2
pttbbs-08666c93cbcadc1787ed05093992630b891ff498.tar.lz
pttbbs-08666c93cbcadc1787ed05093992630b891ff498.tar.xz
pttbbs-08666c93cbcadc1787ed05093992630b891ff498.tar.zst
pttbbs-08666c93cbcadc1787ed05093992630b891ff498.zip
GLOBE support
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@104 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util')
-rw-r--r--util/shmctl.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/util/shmctl.c b/util/shmctl.c
index 1453126a..d6818344 100644
--- a/util/shmctl.c
+++ b/util/shmctl.c
@@ -13,6 +13,7 @@
#include "proto.h"
extern struct utmpfile_t *utmpshm;
+extern struct pttcache_t *ptt;
int logout_friend_online(userinfo_t *utmp)
{
@@ -240,6 +241,29 @@ int utmpnum(int argc, char **argv)
return 0;
}
+int showglobe(int argc, char **argv)
+{
+ int i;
+ for( i = 0 ; i < 10 ; ++i )
+ printf("GLOBE[%d] = %d\n", i, ptt->GLOBE[i]);
+ return 0;
+}
+
+int setglobe(int argc, char **argv)
+{
+ int where;
+ if( argc != 2 )
+ return 1;
+ where = atoi(argv[0]);
+ if( !(0 <= where && where <= 9) ){
+ puts("only GLOBE[0] ~ GLOBE[9]");
+ return 1;
+ }
+ printf("GLOBE[%d] = %d -> ", where, ptt->GLOBE[where]);
+ printf("%d\n", ptt->GLOBE[where] = atoi(argv[1]));
+ return 0;
+}
+
struct {
int (*func)(int, char **);
char *cmd, *descript;
@@ -250,6 +274,8 @@ struct {
{utmpsort, "utmpsort", "sort ulist"},
{utmpwatch, "utmpwatch", "to see if busystate is always 1 then fix it"},
{utmpnum, "utmpnum", "print utmpshm->number for snmpd"},
+ {showglobe, "showglobe", "show GLOBE"},
+ {setglobe, "setglobe", "set GLOBE"},
{NULL, NULL, NULL} };
int main(int argc, char **argv)
@@ -267,7 +293,7 @@ int main(int argc, char **argv)
chdir(BBSHOME);
resolve_utmp();
resolve_boards();
- //resolve_garbage();
+ resolve_garbage();
resolve_fcache();
for( i = 0 ; cmd[i].func != NULL ; ++i )
if( strcmp(cmd[i].cmd, argv[1]) == 0 ){