commit - 532092a832a02f924a07b3e7c809ceda702d9843
commit + 5c4a6b62ac2496fb8a925b635faaa358f9c48365
blob - 40179d1c90d936b4afb8b8297703478cfa9cf53e
blob + 9dce098ed4f59d72cffbe96f627892db288c11d1
--- rover.c
+++ rover.c
int marked;
} row_t;
+/* Dynamic array of marked entries. */
typedef struct {
char dirpath[FILENAME_MAX];
int bulk;
marks->entries = (char **) calloc(marks->bulk, sizeof(char *));
}
+/* Unmark all entries. */
static void
mark_none(marks_t *marks)
{
update_view();
}
+/* Recursively process a source directory using CWD as destination root.
+ * For each node (i.e. directory), do the following:
+ * 1. call pre(destination);
+ * 2. call proc() on every child leaf (i.e. files);
+ * 3. recurse into every child node;
+ * 4. call pos(source).
+ * E.g. to move directory /src/ (and all its contents) inside /dst/:
+ * strcpy(CWD, "/dst/");
+ * process_dir(adddir, movfile, deldir, "/src/");
+ */
static void
process_dir(PROCESS pre, PROCESS proc, PROCESS pos, const char *path)
{
if (pos) pos(path);
}
+/* Process all marked entries using CWD as destination root.
+ * All marked entries that are directories will be recursively processed.
+ * See process_dir() for details on the parameters.
+ */
static void
process_marked(PROCESS pre, PROCESS proc, PROCESS pos)
{
return 1;
}
+/* Update line input on the screen. */
static void
update_input(char *prompt, color_t color)
{
color_set(DEFAULT, NULL);
}
+/* Show a message and wait for any keypress. */
static void
message(const char *msg, color_t color)
{