summaryrefslogtreecommitdiffstats
path: root/util/userlist.c
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-08-06 17:02:50 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-08-06 17:02:50 +0800
commit243b8fa1bcadfb312cc334fdd83322a043d97a41 (patch)
tree695ef854c84e0e7abfc1c2b1b34881bd52e48fc8 /util/userlist.c
parent1f6dede4cd2f7f35a2a768ec4c1f75aba51b71dd (diff)
downloadpttbbs-243b8fa1bcadfb312cc334fdd83322a043d97a41.tar
pttbbs-243b8fa1bcadfb312cc334fdd83322a043d97a41.tar.gz
pttbbs-243b8fa1bcadfb312cc334fdd83322a043d97a41.tar.bz2
pttbbs-243b8fa1bcadfb312cc334fdd83322a043d97a41.tar.lz
pttbbs-243b8fa1bcadfb312cc334fdd83322a043d97a41.tar.xz
pttbbs-243b8fa1bcadfb312cc334fdd83322a043d97a41.tar.zst
pttbbs-243b8fa1bcadfb312cc334fdd83322a043d97a41.zip
Revision 3000
- sync with ptt1 local modified source git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3000 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util/userlist.c')
-rw-r--r--util/userlist.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/util/userlist.c b/util/userlist.c
index 3faf5364..12f6b3d9 100644
--- a/util/userlist.c
+++ b/util/userlist.c
@@ -20,11 +20,28 @@ int main(int argc, char **argv) {
perror("shmat");
exit(0);
}
-
- if(argc > 1) {
+
+ if(argc == 2) {
+ /* list specific id */
+ for (i = 0; i < USHM_SIZE; i++)
+ {
+ userinfo_t *f = &SHM->uinfo[i];
+ if(!f->pid)
+ continue;
+ if(strcmp(f->userid, argv[1]) != 0)
+ continue;
+ printf(
+ "id=%s money=%d\n",
+ f->userid, SHM->money[f->uid - 1]);
+ }
+ }
+ else if(argc > 1)
+ {
for(i = 1; i < argc; i++)
SHM->uinfo[atoi(argv[i])].pid = 0;
- } else {
+ }
+ else
+ {
for(i = counter = 0; i < USHM_SIZE; i++)
if(SHM->uinfo[i].pid) {
userinfo_t *f;