aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.c13
-rw-r--r--src/tdo.c15
-rw-r--r--src/tdo.h8
3 files changed, 25 insertions, 11 deletions
diff --git a/src/main.c b/src/main.c
index bc6b673..e50b7ae 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2,7 +2,9 @@
#include <stdio.h> // for input/output
#include <stdlib.h> // for STD macros
#include <getopt.h> // for getopt
+#include "tdo.h"
+// for debugging
void print_args(int argc, char* argv[]) {
printf("There are %i arguments\n",argc);
printf("Those arguments are:\n");
@@ -11,17 +13,6 @@ void print_args(int argc, char* argv[]) {
}
}
-void new_tdo(int argc, char** argv) {
- printf("New todo: ");
- // just in case not using quotes
- for (int i=2; i<argc; ++i) printf("%s ",argv[i]);
- printf("\n");
-}
-
-void print_version() {
- printf("tdo version 0.0.1\n");
-}
-
int main(int argc, char* argv[]) {
char* valid_opts = "nv";
int opt;
diff --git a/src/tdo.c b/src/tdo.c
new file mode 100644
index 0000000..7b3ff0e
--- /dev/null
+++ b/src/tdo.c
@@ -0,0 +1,15 @@
+#include <stdio.h>
+#include "tdo.h"
+
+void print_version() {
+ printf("tdo version 0.0.1\n");
+}
+
+void new_tdo(int argc, char** argv) {
+ printf("New todo: ");
+ // just in case not using quotes
+ for (int i=2; i<argc; ++i) printf("%s ",argv[i]);
+ printf("\n");
+}
+
+
diff --git a/src/tdo.h b/src/tdo.h
new file mode 100644
index 0000000..4af5e14
--- /dev/null
+++ b/src/tdo.h
@@ -0,0 +1,8 @@
+#include <stdio.h>
+
+// Print version
+void print_version();
+
+// Create a new todo item
+void new_tdo(int argc, char** argv);
+