diff --git a/Makefile b/Makefile index f16bdc4..9ff6784 100644 --- a/Makefile +++ b/Makefile @@ -17,11 +17,13 @@ INSTDIR := /usr/local/bin REFACTOR := refactor.h -TESTCFLAGS:= $(shell pkg-config --cflags criterion) -TESTLIBS := $(shell pkg-config --libs criterion) +TESTCFLAGS:= #$(shell pkg-config --cflags ) +TESTLIBS := #$(shell pkg-config --libs ) TESTDIR := $(SRCDIR)/test TESTOD := $(OBJDIR)/test +LIBRARIES := libnotify libcrypto + HEADERS := $(wildcard $(INCDIR)/*.h) MAINS := $(wildcard $(MAINDIR)/*.c) @@ -40,10 +42,10 @@ SOURCES := $(wildcard $(SRCDIR)/*.c) OBJECTS := $(patsubst $(SRCDIR)/%.c, $(OBJDIR)/%.o, $(SOURCES)) CPPFLAGS := -I$(abspath $(INCDIR)) -MMD -MP -DUSE_LIBNOTIFY -DUSE_SYSLOG -CFLAGS := -Wall -Werror -Wpedantic $(shell pkg-config --cflags libnotify) -ggdb +CFLAGS := -Wall -Werror -Wpedantic $(shell pkg-config --cflags $(LIBRARIES)) -ggdb LDFLAGS := #-Lmath or whatever -LDLIBS := $(shell pkg-config --libs libnotify libcrypto) #-lm or whatever +LDLIBS := $(shell pkg-config --libs $(LIBRARIES)) #-lm or whatever define MANGLE = $(dir $(1))$(PREFIX)$(notdir $(1))$(SUFFIX) @@ -60,12 +62,14 @@ refactor: $(UNITTESTS): $(OBJECTS) $(TESTOBJS) | $(BINDIR) $(OBJDIR) $(TESTOD) @echo "Linking unit tests..." @echo "Object files for tests is " $(TESTOBJS) - $(CC) $(LDFLAGS) $(OBJECTS) $(patsubst $(BINDIR)/%, $(TESTOD)/%.o, $@) $(LDLIBS) $(TESTLIBS) -o $(dir $@)$(PREFIX)$(notdir $@)$(SUFFIX) + @echo "LDLIBS expands to" $(LDLIBS) + @echo "LIBRARIES expands to" $(LIBRARIES) + $(CC) $(LDFLAGS) $(OBJECTS) $(patsubst $(BINDIR)/%, $(TESTOD)/%.o, $@) $(LDLIBS) $(TESTLIBS) -o $(dir $@)$(PREFIX)$(notdir $@)$(SUFFIX) @echo "...Done linking unit tests" $(TARGETS): $(OBJECTS) $(MAINOBJS) | $(BINDIR) $(OBJDIR) $(MAINOD) @echo "Linking targets..." - $(CC) $(LDFLAGS) $(OBJECTS) $(patsubst $(BINDIR)/%, $(MAINOD)/%.o, $@) $(LDLIBS) -o $(dir $@)$(PREFIX)$(notdir $@)$(SUFFIX) + $(CC) $(LDFLAGS) $(OBJECTS) $(patsubst $(BINDIR)/%, $(MAINOD)/%.o, $@) $(LDLIBS) -o $(dir $@)$(PREFIX)$(notdir $@)$(SUFFIX) @echo "...Done linking targets" $(BINDIR) $(OBJDIR) $(MAINOD) $(TESTOD): diff --git a/local.schema b/local.schema index 081f8a3..83d3f56 100644 --- a/local.schema +++ b/local.schema @@ -1,6 +1,6 @@ -attributeType ( 69.420 NAME ( '' '' ) +attributeType ( 1.3.6.1.4.1.60580.1.1 NAME ( '' '' ) DESC '' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX -) \ No newline at end of file +) diff --git a/sources/include/main.h b/sources/include/main.h index c8b8b08..3c75c07 100644 --- a/sources/include/main.h +++ b/sources/include/main.h @@ -10,25 +10,18 @@ #define PROGNAME "ldaphotos" #define USAGE0 "Usage:" #define USAGE1 "[OPTION...]" -#define OPTIONS0 "Options:" -#define OPTIONS1 "\t-v run verbosely" -#define OPTIONS2 "\t-h show help and exit" -#define OPTIONS3 "\t-t provide terse output" -#define OPTIONS4 "\t-f Read input from file " -#define OPTIONS5 "" -#define OPTIONS6 "" -#define OPTIONS7 "" -#define OPTIONS8 "" -#define OPTIONS9 "" -#define OPTIONS10 "\t-p Print the effects of the given options for this invocation" +#define OPTIONS "Options: \ +\t-v run verbosely \ +\t-h show help and exit \ +\t-t provide terse output \ +\t-f Read input from file \ +t-p Print the effects of the given options for this invocation" void print_help(void){ printf("%s %s\n", TITLE, VERSION); printf("%s %s %s\n", USAGE0, PROGNAME, USAGE1); - printf("%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n", - OPTIONS0, OPTIONS1, OPTIONS2, OPTIONS3, OPTIONS4, - OPTIONS5, OPTIONS6, OPTIONS7, OPTIONS8, OPTIONS9, - OPTIONS10); + printf("%s\n", + OPTIONS); } #endif diff --git a/sources/main/ldaphotos.c b/sources/main/ldaphotos.c index 8449523..5398e7a 100644 --- a/sources/main/ldaphotos.c +++ b/sources/main/ldaphotos.c @@ -118,7 +118,7 @@ int opt; memcpy(filepath, optarg, strlen(optarg)); break; default: - printf("Literally how could you pass an unspecified argument to this program"); + printf("Literally how could you pass an unspecified argument to this program\n"); } } diff --git a/sources/test/test.c b/sources/test/test.c deleted file mode 100644 index 16f87a5..0000000 --- a/sources/test/test.c +++ /dev/null @@ -1,38 +0,0 @@ -#include -#include -#include -#include - -#include - -#include "main.h" -#include "manipulations.h" -#include "hasher.h" -#include "log.h" - -#ifdef USE_LIBNOTIFY -#include -#endif - -Test(misc, passing){ - cr_assert(1, "ya boi"); -} - -Test(misc, hashsomething){ - - if(!init_hasher()){ - log(LOG_INFO, "Error encountered while initializing hasher"); - } - - begin_digest(); - - - unsigned int len; - unsigned int aalen; - unsigned char * a = get_digest(&len); - char *aa = atohex(a, len, &aalen); - - - - free(aa); -}