#include <string.h>
#include <ncurses.h>
-#include "screen.h"
+#include "date.h"
+#include "cal.h"
+#include "view.h"
/* Static data */
static FILE *debug_fd = NULL;
debug_fd = fopen("/tmp/lackey.log", "w+");
}
-/* Misc functions */
-char *sdup(const char *str)
+/* String functions */
+void strsub(char *str, char find, char repl)
{
- if (str == NULL)
- return NULL;
- int len = strlen(str);
- char *dup = malloc(len+1);
- memcpy(dup, str, len+1);
- return dup;
+ for (char *cur = str; *cur; cur++)
+ if (*cur == find)
+ *cur = repl;
}
/* Debugging functions */