--- /dev/null
+/* Prints a list of all usernames with useable coke balances
+ * delimited by newlines.
+ *
+ */
+
+
+#include <stdio.h>
+#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;
+}