diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-10-23 14:42:44 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-10-23 14:42:44 +0800 |
commit | 0482940e2095ae2a6b095c78c8b8fc116803cda1 (patch) | |
tree | 5b840a4c72c0a465ce7991d05cebdae15a380dbf | |
parent | 96d78c8fa46d2464eaa2cd309e7415b9f159f92d (diff) | |
download | pttbbs-0482940e2095ae2a6b095c78c8b8fc116803cda1.tar pttbbs-0482940e2095ae2a6b095c78c8b8fc116803cda1.tar.gz pttbbs-0482940e2095ae2a6b095c78c8b8fc116803cda1.tar.bz2 pttbbs-0482940e2095ae2a6b095c78c8b8fc116803cda1.tar.lz pttbbs-0482940e2095ae2a6b095c78c8b8fc116803cda1.tar.xz pttbbs-0482940e2095ae2a6b095c78c8b8fc116803cda1.tar.zst pttbbs-0482940e2095ae2a6b095c78c8b8fc116803cda1.zip |
usermode
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1261 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | util/shmctl.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/util/shmctl.c b/util/shmctl.c index 9f656f17..357b24a1 100644 --- a/util/shmctl.c +++ b/util/shmctl.c @@ -600,6 +600,19 @@ int hotboard(int argc, char **argv) return 0; } +int usermode(int argc, char **argv) +{ + int i, modes[MAX_MODES]; + memset(modes, 0, sizeof(modes)); + for( i = 0 ; i < MAX_ACTIVE ; ++i ) + if( SHM->uinfo[i].userid[0] ) + ++modes[ (int)SHM->uinfo[i].mode ]; + + for( i = 0 ; i < MAX_MODES ; ++i ) + printf("%03d|%05d|%s\n", i, modes[i], ModeTypeTable[i]); + return 0; +} + struct { int (*func)(int, char **); char *cmd, *descript; @@ -620,6 +633,7 @@ struct { {bBMC, "bBMC", "build BM cache"}, {SHMinit, "SHMinit", "initialize SHM (including uhash_loader)"}, {hotboard, "hotboard", "list boards of most bfriends"}, + {usermode, "usermode", "list #users in the same mode"}, {NULL, NULL, NULL} }; extern char ** environ; |