From 8c0607dacc71d9406f6cfb36e105a76828703cea Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 15 Apr 2021 18:44:28 +0200 Subject: First commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- .gitignore | 6 ++++++ LICENSE | 15 +++++++++++++++ Makefile | 35 +++++++++++++++++++++++++++++++++++ README | 6 ++++++ TODO | 3 +++ addressbook.c | 22 ++++++++++++++++++++++ config.mk | 8 ++++++++ 7 files changed, 95 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 Makefile create mode 100644 README create mode 100644 TODO create mode 100644 addressbook.c create mode 100644 config.mk 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 + +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 +#include +#include +#include + + +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 -- cgit v1.2.3-70-g09d2