summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-08-09 02:29:35 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-08-09 02:29:35 +0800
commita8d6240a1db56b86073d284ee5abf433e8d283d5 (patch)
tree3459c1419519484db49948c62743150c1f3cc729 /util
parent16f546e4f25f6d286fcaf0ba5727ff6cebe257a6 (diff)
downloadpttbbs-a8d6240a1db56b86073d284ee5abf433e8d283d5.tar
pttbbs-a8d6240a1db56b86073d284ee5abf433e8d283d5.tar.gz
pttbbs-a8d6240a1db56b86073d284ee5abf433e8d283d5.tar.bz2
pttbbs-a8d6240a1db56b86073d284ee5abf433e8d283d5.tar.lz
pttbbs-a8d6240a1db56b86073d284ee5abf433e8d283d5.tar.xz
pttbbs-a8d6240a1db56b86073d284ee5abf433e8d283d5.tar.zst
pttbbs-a8d6240a1db56b86073d284ee5abf433e8d283d5.zip
util to know the amount of tickets for ticket.data
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3016 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util')
-rw-r--r--util/Makefile2
-rw-r--r--util/gamble_fix.c26
2 files changed, 27 insertions, 1 deletions
diff --git a/util/Makefile b/util/Makefile
index 4f7e19a4..e16b1ac4 100644
--- a/util/Makefile
+++ b/util/Makefile
@@ -33,7 +33,7 @@ CPROG_WITHOUT_UTIL= \
uhash_loader showboard \
countalldice webgrep bbsrf initbbs \
userlist merge_passwd \
- merge_board bbsmail
+ merge_board bbsmail gamble_fix
# 下面這些程式會被 install
PROGS= ${CPROG_WITH_UTIL} ${CPROG_WITHOUT_UTIL} \
diff --git a/util/gamble_fix.c b/util/gamble_fix.c
new file mode 100644
index 00000000..05d536e5
--- /dev/null
+++ b/util/gamble_fix.c
@@ -0,0 +1,26 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+int main(int argc, char *argv[])
+{
+ FILE *fp;
+ char buf[100];
+ int i, j, count[8]={0,0,0,0,0,0,0,0};
+ if(argc<2)
+ {
+ printf("useage example:%s ticket.user\n", argv[0]);
+ return 0;
+ }
+ fp=fopen(argv[1], "r");
+ if(!fp) return 0;
+ while(fscanf(fp,"%s %d %d", buf, &i, &j)!=EOF )
+ {
+ count[i]+=j;
+ }
+ for(i=0; i<8; i++)
+ {
+ printf("%d) %d\n",i+1, count[i]);
+ }
+ return 0;
+}
+