summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
3c887fd)
By simply specifying the names of the files to test on the command line.
#include <sys/types.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/time.h>
#include <unistd.h>
#include <dirent.h>
#include <errno.h>
#include <unistd.h>
#include <dirent.h>
#include <errno.h>
char *path;
category_t *category;
int i;
char *path;
category_t *category;
int i;
path = xmalloc (strlen (mnemon->dir_name) + 1 + strlen (name) + 1);
sprintf (path, "%s/%s", mnemon->dir_name, name);
path = xmalloc (strlen (mnemon->dir_name) + 1 + strlen (name) + 1);
sprintf (path, "%s/%s", mnemon->dir_name, name);
+ fstat (fileno(file), &st);
+ if (! S_ISREG(st.st_mode)) {
+ fprintf (stderr, "Error: File %s is not a regular file.\n", path);
+ exit (1);
+ }
+
category = mnemon_get_category (mnemon, name);
#define READ_LINE do { \
category = mnemon_get_category (mnemon, name);
#define READ_LINE do { \
mnemon_t mnemon;
char *response;
mnemon_t mnemon;
char *response;
+ void _load_categories()
+ {
+ if (argc > 1) {
+ int i;
+ for (i = 1; i < argc; i++)
+ mnemon_load_category (&mnemon, argv[i]);
+ } else {
+ mnemon_load (&mnemon);
+ }
+ }
+
srand (time (NULL));
mnemon_init (&mnemon);
srand (time (NULL));
mnemon_init (&mnemon);
mnemon_do_challenges (&mnemon);
mnemon_do_challenges (&mnemon);
mnemon_fini (&mnemon);
mnemon_init (&mnemon);
mnemon_fini (&mnemon);
mnemon_init (&mnemon);
printf ("Great job.\nHere are your current results:\n");
mnemon_print_histogram (&mnemon, NULL, 0);
printf ("Great job.\nHere are your current results:\n");
mnemon_print_histogram (&mnemon, NULL, 0);