#include <glib.h> /* g_strdup_printf */
+#define unused(x) x __attribute__ ((unused))
+
/* There's no point in continuing when we've detected that we've done
* something wrong internally (as opposed to the user passing in a
* bogus value).
}
/* Compute the number of seconds elapsed from start to end. */
-double
+static double
tv_elapsed (struct timeval start, struct timeval end)
{
return ((end.tv_sec - start.tv_sec) +
(end.tv_usec - start.tv_usec) / 1e6);
}
-void
+static void
print_formatted_seconds (double seconds)
{
int hours;
printf ("%ds", (int) seconds);
}
-void
+static void
add_files_print_progress (add_files_state_t *state)
{
struct timeval tv_now;
* The 'struct stat *st' must point to a structure that has already
* been initialized for 'path' by calling stat().
*/
-notmuch_status_t
+static notmuch_status_t
add_files_recursive (notmuch_database_t *notmuch,
const char *path,
struct stat *st,
break;
/* Fatal issues. Don't process anymore. */
case NOTMUCH_STATUS_XAPIAN_EXCEPTION:
- fprintf (stderr, "A Xapian error was encountered. Halting processing.\n");
+ case NOTMUCH_STATUS_OUT_OF_MEMORY:
+ fprintf (stderr, "Error: %s. Halting processing.\n",
+ notmuch_status_to_string (status));
ret = status;
goto DONE;
default:
+ case NOTMUCH_STATUS_FILE_ERROR:
+ case NOTMUCH_STATUS_NULL_POINTER:
+ case NOTMUCH_STATUS_TAG_TOO_LONG:
+ case NOTMUCH_STATUS_LAST_STATUS:
INTERNAL_ERROR ("add_message returned unexpected value: %d", status);
goto DONE;
}
* of path. The result is added to *count (which should be
* initialized to zero by the top-level caller before calling
* count_files). */
-void
+static void
count_files (const char *path, int *count)
{
DIR *dir;
closedir (dir);
}
-int
-setup_command (int argc, char *argv[])
+static int
+setup_command (unused (int argc), unused (char *argv[]))
{
notmuch_database_t *notmuch = NULL;
char *default_path, *mail_directory = NULL;
return ret;
}
-int
-new_command (int argc, char *argv[])
+static int
+new_command (unused (int argc), unused (char *argv[]))
{
notmuch_database_t *notmuch;
const char *mail_directory;
return ret;
}
-int
+static int
search_command (int argc, char *argv[])
{
void *local = talloc_new (NULL);
return ret;
}
-int
-show_command (int argc, char *argv[])
+static int
+show_command (unused (int argc), unused (char *argv[]))
{
fprintf (stderr, "Error: show is not implemented yet.\n");
return 1;
}
-int
+static int
dump_command (int argc, char *argv[])
{
FILE *output;
return ret;
}
-int
+static int
restore_command (int argc, char *argv[])
{
FILE *input;
"\t\tRestore the tags from the given dump file (see 'dump')." }
};
-void
+static void
usage (void)
{
command_t *command;