aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore6
-rw-r--r--LICENSE15
-rw-r--r--Makefile35
-rw-r--r--README6
-rw-r--r--TODO3
-rw-r--r--addressbook.c22
-rw-r--r--config.mk8
7 files changed, 95 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..187eac0
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
+*\#*
+*~
+*.o
+*.a
+*.su
+/addressbook
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..c44b2d9
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,15 @@
+ISC License
+
+© 2021 Mattias Andrée <maandree@kth.se>
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..d93205d
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,35 @@
+.POSIX:
+
+CONFIGFILE = config.mk
+include $(CONFIGFILE)
+
+
+OBJ =\
+ addressbook.o
+
+HDR =
+
+
+all: addressbook
+$(OBJ): $(@:.o=.c) $(HDR)
+
+.c.o:
+ $(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS)
+
+addressbook: $(OBJ)
+ $(CC) -o $@ $(OBJ) $(LDFLAGS)
+
+install: addressbook
+ mkdir -p -- "$(DESTDIR)$(PREFIX)/bin/"
+ cp -- addressbook "$(DESTDIR)$(PREFIX)/bin/"
+
+uninstall:
+ -rm -f -- "$(DESTDIR)$(PREFIX)/bin/addressbook"
+
+clean:
+ -rm -f -- *.o *.a *.su $(OBJ) addressbook
+
+.SUFFIXES:
+.SUFFIXES: .c .o
+
+.PHONY: all install uninstall clean
diff --git a/README b/README
new file mode 100644
index 0000000..9261330
--- /dev/null
+++ b/README
@@ -0,0 +1,6 @@
+NAME
+ addressbook - A visual address book application
+
+DESCRIPTION
+ addressbook is a visual address book application for the
+ terminal using libcontacts.
diff --git a/TODO b/TODO
new file mode 100644
index 0000000..0e37430
--- /dev/null
+++ b/TODO
@@ -0,0 +1,3 @@
+Add cmdline options and operands for running specific parts of the application
+Add man page
+Add tests
diff --git a/addressbook.c b/addressbook.c
new file mode 100644
index 0000000..beef1c4
--- /dev/null
+++ b/addressbook.c
@@ -0,0 +1,22 @@
+/* See LICENSE file for copyright and license details. */
+#include <libcontacts.h>
+#include <libsimple.h>
+#include <libsimple-arg.h>
+#include <libterminput.h>
+
+
+USAGE("");
+
+
+int
+main(int argc, char *argv[])
+{
+ ARGBEGIN {
+ default:
+ usage();
+ } ARGEND;
+ if (argc)
+ usage();
+
+ return 0;
+}
diff --git a/config.mk b/config.mk
new file mode 100644
index 0000000..6823d2b
--- /dev/null
+++ b/config.mk
@@ -0,0 +1,8 @@
+PREFIX = /usr
+MANPREFIX = $(PREFIX)/share/man
+
+CC = cc
+
+CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700
+CFLAGS = -std=c99 -Wall -Os
+LDFLAGS = -lcontacts -lsimple -lterminput -s