about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2022-03-02 20:42:00 -0500
committerJune McEnroe <june@causal.agency>2022-03-02 20:42:00 -0500
commitce54b769a3eb6eab8cc61804fdcef0c26993b0fb (patch)
tree9c3ca1178c791b2941883b4e0b31c2f6054b7f37
parentSpecify commands which depend on caps (diff)
downloadcatgirl-ce54b769a3eb6eab8cc61804fdcef0c26993b0fb.tar.gz
catgirl-ce54b769a3eb6eab8cc61804fdcef0c26993b0fb.zip
Add empty enroll program
Diffstat (limited to '')
-rw-r--r--.gitignore1
-rw-r--r--Makefile12
-rwxr-xr-xconfigure4
-rw-r--r--enroll.c36
4 files changed, 50 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index b31d1c5..bfe7bd9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
 *.o
 *.t
 catgirl
+catgirl-enroll
 chroot.tar
 config.mk
 root/
diff --git a/Makefile b/Makefile
index 3abba03..96bd086 100644
--- a/Makefile
+++ b/Makefile
@@ -7,11 +7,16 @@ CFLAGS += -std=c11 -Wall -Wextra -Wpedantic -Wmissing-prototypes
 CFLAGS += ${CEXTS:%=-Wno-%}
 LDADD.libtls = -ltls
 LDADD.ncursesw = -lncursesw
+LDADD.resolv =
 
 -include config.mk
 
 LDLIBS = ${LDADD.libtls} ${LDADD.ncursesw}
+LDLIBS.enroll = ${LDADD.libtls} ${LDADD.resolv}
 
+OBJS.compat =
+
+OBJS += ${OBJS.compat}
 OBJS += buffer.o
 OBJS += chat.o
 OBJS += command.o
@@ -32,11 +37,14 @@ TESTS += edit.t
 
 dev: tags all check
 
-all: catgirl
+all: catgirl catgirl-enroll
 
 catgirl: ${OBJS}
 	${CC} ${LDFLAGS} ${OBJS} ${LDLIBS} -o $@
 
+catgirl-enroll: enroll.o ${OBJS.compat}
+	${CC} ${LDFLAGS} enroll.o ${OBJS.compat} ${LDLIBS.enroll} -o $@
+
 ${OBJS}: chat.h
 
 edit.o edit.t input.o: edit.h
@@ -53,7 +61,7 @@ tags: *.[ch]
 	ctags -w *.[ch]
 
 clean:
-	rm -f catgirl ${OBJS} ${TESTS} tags
+	rm -f catgirl catgirl-enroll ${OBJS} enroll.o ${TESTS} tags
 
 install: catgirl catgirl.1
 	install -d ${DESTDIR}${BINDIR} ${DESTDIR}${MANDIR}/man1
diff --git a/configure b/configure
index 9465b77..f569f80 100755
--- a/configure
+++ b/configure
@@ -44,13 +44,15 @@ case "$(uname)" in
 	(Linux)
 		cflags -Wno-pedantic -D_GNU_SOURCE
 		config libtls ncursesw
+		ldadd resolv -lresolv
 		defvar OPENSSL_BIN openssl exec_prefix /bin/openssl
-		echo 'OBJS += compat_readpassphrase.o'
+		echo 'OBJS.compat += compat_readpassphrase.o'
 		;;
 	(Darwin)
 		cflags -D__STDC_WANT_LIB_EXT1__=1
 		cflags "-D'explicit_bzero(b,l)=memset_s((b),(l),0,(l))'"
 		config libtls ncursesw
+		ldadd resolv -lresolv
 		defvar OPENSSL_BIN openssl exec_prefix /bin/openssl
 		;;
 	(*)
diff --git a/enroll.c b/enroll.c
new file mode 100644
index 0000000..dea1951
--- /dev/null
+++ b/enroll.c
@@ -0,0 +1,36 @@
+/* Copyright (C) 2022  June McEnroe <june@causal.agency>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
+ * Additional permission under GNU GPL version 3 section 7:
+ *
+ * If you modify this Program, or any covered work, by linking or
+ * combining it with OpenSSL (or a modified version of that library),
+ * containing parts covered by the terms of the OpenSSL License and the
+ * original SSLeay license, the licensors of this Program grant you
+ * additional permission to convey the resulting work. Corresponding
+ * Source for a non-source form of such a combination shall include the
+ * source code for the parts of OpenSSL used as well as that of the
+ * covered work.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <err.h>
+#include <sysexits.h>
+
+char *readpassphrase(const char *prompt, char *buf, size_t bufsiz, int flags);
+
+int main(int argc, char *argv[]) {
+}