X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=sql-edition%2Fconvert.c;fp=sql-edition%2Fconvert.c;h=0000000000000000000000000000000000000000;hb=e423f11f190d685156cb557319b169d2b79b752f;hp=bac3b866db84fcc423660778e43fc9e95cc619a4;hpb=9ac8ba25e1fabd0edd0c90850bf8fa7532048224;p=uccvend-vendserver.git diff --git a/sql-edition/convert.c b/sql-edition/convert.c deleted file mode 100644 index bac3b86..0000000 --- a/sql-edition/convert.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Prints a list of all usernames with useable coke balances - * delimited by newlines. - * - * - Bernard Blackham - */ - - -#include -#include "ucc.h" - -int main(int argc, char* argv[]) { - char username[30]; - int32 balance; - - if (argc != 1) { - fprintf(stderr, "Usage: %s\n", argv[0]); - return 1; - } - - SetCokebankToSocks(); - - cokebank_open(); - printf("DELETE from users;\n"); - printf("COPY users (user_name, user_balance_cents, user_balance_bytes) FROM stdin;\n"); - while (cokebank_get_next(username, &balance, 0)) { - printf("%s\t%d\t%d\n", username, cokebank_get(username), cokebank_get_bytes(username)); - } - printf("\\.\n"); - cokebank_close(); - return 0; -}