#include <sys/types.h>
#include <sys/time.h>
+#include <unistd.h>
#include <dirent.h>
#include <errno.h>
#include <string.h>
category_print (category, file);
+ fsync (fileno (file));
fclose (file);
err = rename (lock_filename, filename);
} while (mnemon->to_introduce ||
mnemon->unlearned ||
mnemon->to_master > 0);
-
- printf ("Great job.\nHere are your current results:\n");
- mnemon_print_histogram (mnemon, NULL, 0);
- response = readline ("Press enter to quit.\n");
- free (response);
}
int
main (int argc, char *argv[])
{
mnemon_t mnemon;
+ char *response;
srand (time (NULL));
mnemon_fini (&mnemon);
+ mnemon_init (&mnemon);
+ mnemon_load (&mnemon);
+
+ printf ("Great job.\nHere are your current results:\n");
+ mnemon_print_histogram (&mnemon, NULL, 0);
+ response = readline ("Press enter to quit.\n");
+ free (response);
+
+ mnemon_fini (&mnemon);
+
return 0;
}