/* noavatars.c - Clean up the avatar cache * ============================================================ * Under CC0, as its a rather useful example of a Parsee tool. * See LICENSE for more information about Parsee's licensing. */ #include #include #include #include #include int Main(Array *args, HashMap *env) { char *db_path, *exec; Db *parsee; exec = ArrayGet(args, 0); if (ArraySize(args) < 2) { Log(LOG_ERR, "Usage: %s [DB path]", exec); return EXIT_FAILURE; } db_path = ArrayGet(args, 1); parsee = DbOpenLMDB(db_path, 8 * 1024 * 1024); if (parsee) { DbDelete(parsee, 1, "avatars"); DbClose(parsee); return EXIT_SUCCESS; } Log(LOG_ERR, "%s: couldn't open DB '%s'", exec, db_path); return EXIT_FAILURE; }