From 632e869456c09a3c015fee874e41dd8af6487f47 Mon Sep 17 00:00:00 2001 From: Bostjan Skufca Date: Tue, 14 Oct 2014 13:45:05 +0000 Subject: [PATCH] Removed -Wno-portability, added -Wall and -Werror, fixed errors that occured and included header files as dependencies to make them included in release when doing "make dist" --- Makefile.in | 1 + build/Makefile.am.common | 2 + configure.ac | 2 +- src/Makefile.am | 12 ++- src/Makefile.in | 183 ++++++++++++++++++++++++++++++++----- src/input/Makefile.am | 27 +++++- src/input/Makefile.in | 192 ++++++++++++++++++++++++++++++++++----- src/inputregistry.c | 3 +- src/inputregistry.h | 2 + src/snoopy.h | 2 +- 10 files changed, 371 insertions(+), 55 deletions(-) diff --git a/Makefile.in b/Makefile.in index 0e279a52..40968039 100644 --- a/Makefile.in +++ b/Makefile.in @@ -266,6 +266,7 @@ EXTRA_LTLIBRARIES = #CLEANFILES += $(EXTRA_LTLIBRARIES) $(EXTRA_PROGRAMS) $(check_PROGRAMS) #DISTCLEANFILES += $(BUILT_SOURCES) MAINTAINERCLEANFILES = Makefile.in +AM_CFLAGS = -Wall -Werror AUTOMAKE_OPTIONS = foreign subdir-objects ACLOCAL_AMFLAGS = -I m4 SUBDIRS = src bin diff --git a/build/Makefile.am.common b/build/Makefile.am.common index d4754a0b..3e2f569e 100644 --- a/build/Makefile.am.common +++ b/build/Makefile.am.common @@ -12,3 +12,5 @@ CLEANFILES += *.o #CLEANFILES += $(EXTRA_LTLIBRARIES) $(EXTRA_PROGRAMS) $(check_PROGRAMS) #DISTCLEANFILES += $(BUILT_SOURCES) MAINTAINERCLEANFILES += Makefile.in + +AM_CFLAGS = -Wall -Werror diff --git a/configure.ac b/configure.ac index b955a08d..a6c99492 100644 --- a/configure.ac +++ b/configure.ac @@ -9,7 +9,7 @@ AC_CONFIG_HEADERS([config.h]) # We are using automake and libtool AC_CONFIG_MACRO_DIR([m4]) -AM_INIT_AUTOMAKE([1.11 gnu silent-rules subdir-objects -Wall -Wno-portability]) +AM_INIT_AUTOMAKE([1.11 gnu silent-rules subdir-objects -Wall -Werror]) LT_INIT([disable-static]) #LT_INIT diff --git a/src/Makefile.am b/src/Makefile.am index a5e9dd10..11224908 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,3 +1,9 @@ +### Include common Makefile configuration +# +include $(top_srcdir)/build/Makefile.am.common + + + ### First process all required subdirs # SUBDIRS = input @@ -11,8 +17,12 @@ noinst_LTLIBRARIES = \ libsnoopy_no_execve_la_SOURCES = \ inputdatastorage.c \ + inputdatastorage.h \ inputregistry.c \ - log.c + inputregistry.h \ + log.c \ + log.h \ + snoopy.h libsnoopy_no_execve_la_LIBADD = \ input/libsnoopy_inputs_all.la diff --git a/src/Makefile.in b/src/Makefile.in index abe6f424..78eb6abf 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -51,8 +51,12 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/build/Makefile.am.common +EXTRA_PROGRAMS = +TESTS = +check_PROGRAMS = subdir = src -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ @@ -151,6 +155,8 @@ AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ distdir ETAGS = etags CTAGS = ctags +am__tty_colors = \ +red=; grn=; lgn=; blu=; std= DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ @@ -293,6 +299,18 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ +BUILT_SOURCES = +CLEANFILES = *.o +DISTCLEANFILES = +EXTRA_DIST = +EXTRA_LTLIBRARIES = +#CLEANFILES += $(EXTRA_LTLIBRARIES) $(EXTRA_PROGRAMS) $(check_PROGRAMS) +#DISTCLEANFILES += $(BUILT_SOURCES) +MAINTAINERCLEANFILES = Makefile.in +AM_CFLAGS = -Wall -Werror + +### Include common Makefile configuration +# ### First process all required subdirs # @@ -305,8 +323,12 @@ noinst_LTLIBRARIES = \ libsnoopy_no_execve_la_SOURCES = \ inputdatastorage.c \ + inputdatastorage.h \ inputregistry.c \ - log.c + inputregistry.h \ + log.c \ + log.h \ + snoopy.h libsnoopy_no_execve_la_LIBADD = \ input/libsnoopy_inputs_all.la @@ -323,11 +345,12 @@ libsnoopy_la_SOURCES = \ libsnoopy_la_LIBADD = \ libsnoopy_no_execve.la -all: all-recursive +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/build/Makefile.am.common $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -348,6 +371,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; +$(top_srcdir)/build/Makefile.am.common: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -403,6 +427,15 @@ libsnoopy.la: $(libsnoopy_la_OBJECTS) $(libsnoopy_la_DEPENDENCIES) $(EXTRA_libsn libsnoopy_no_execve.la: $(libsnoopy_no_execve_la_OBJECTS) $(libsnoopy_no_execve_la_DEPENDENCIES) $(EXTRA_libsnoopy_no_execve_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libsnoopy_no_execve_la_OBJECTS) $(libsnoopy_no_execve_la_LIBADD) $(LIBS) +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -579,6 +612,99 @@ GTAGS: distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; skip=0; \ + srcdir=$(srcdir); export srcdir; \ + list=' $(TESTS) '; \ + $(am__tty_colors); \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$tst[\ \ ]*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + col=$$red; res=XPASS; \ + ;; \ + *) \ + col=$$grn; res=PASS; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$tst[\ \ ]*) \ + xfail=`expr $$xfail + 1`; \ + col=$$lgn; res=XFAIL; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + col=$$red; res=FAIL; \ + ;; \ + esac; \ + else \ + skip=`expr $$skip + 1`; \ + col=$$blu; res=SKIP; \ + fi; \ + echo "$${col}$$res$${std}: $$tst"; \ + done; \ + if test "$$all" -eq 1; then \ + tests="test"; \ + All=""; \ + else \ + tests="tests"; \ + All="All "; \ + fi; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="$$All$$all $$tests passed"; \ + else \ + if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ + banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all $$tests failed"; \ + else \ + if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ + banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ + fi; \ + fi; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + if test "$$skip" -eq 1; then \ + skipped="($$skip test was not run)"; \ + else \ + skipped="($$skip tests were not run)"; \ + fi; \ + test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$skipped"; \ + fi; \ + report=""; \ + if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ + report="Please report to $(PACKAGE_BUGREPORT)"; \ + test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$report"; \ + fi; \ + dashes=`echo "$$dashes" | sed s/./=/g`; \ + if test "$$failed" -eq 0; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + fi; \ + echo "$${col}$$dashes$${std}"; \ + echo "$${col}$$banner$${std}"; \ + test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ + test -z "$$report" || echo "$${col}$$report$${std}"; \ + echo "$${col}$$dashes$${std}"; \ + test "$$failed" -eq 0; \ + else :; fi + distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ @@ -635,14 +761,18 @@ distdir: $(DISTFILES) fi; \ done check-am: all-am -check: check-recursive + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-recursive all-am: Makefile $(LTLIBRARIES) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done -install: install-recursive +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive @@ -664,18 +794,22 @@ install-strip: mostlyclean-generic: clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive -clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ - clean-noinstLTLIBRARIES mostlyclean-am +clean-am: clean-checkPROGRAMS clean-generic clean-libLTLIBRARIES \ + clean-libtool clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) @@ -743,24 +877,25 @@ ps-am: uninstall-am: uninstall-libLTLIBRARIES -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ - install-am install-strip tags-recursive +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \ + check-am ctags-recursive install install-am install-strip \ + tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am check check-am clean clean-generic \ - clean-libLTLIBRARIES clean-libtool clean-noinstLTLIBRARIES \ - ctags ctags-recursive distclean distclean-compile \ - distclean-generic distclean-libtool distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-libLTLIBRARIES \ - install-man install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-recursive uninstall uninstall-am \ + all all-am check check-TESTS check-am clean \ + clean-checkPROGRAMS clean-generic clean-libLTLIBRARIES \ + clean-libtool clean-noinstLTLIBRARIES ctags ctags-recursive \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-libLTLIBRARIES install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-libLTLIBRARIES diff --git a/src/input/Makefile.am b/src/input/Makefile.am index 8c00530b..d91bd7bc 100644 --- a/src/input/Makefile.am +++ b/src/input/Makefile.am @@ -1,4 +1,13 @@ -AM_CFLAGS = -I$(top_srcdir)/src +### Include common Makefile configuration +# +include $(top_srcdir)/build/Makefile.am.common + + + +### Include +# +AM_CFLAGS += -I$(top_srcdir)/src + ### Create one library with all snoopy inputs collected in it @@ -6,15 +15,27 @@ AM_CFLAGS = -I$(top_srcdir)/src noinst_LTLIBRARIES = libsnoopy_inputs_all.la -### Inputs collection is made of the following files + +### Input providers collection is made of the following files +# +# Please maintain alphabetical order, equal to what `ls` would do # libsnoopy_inputs_all_la_SOURCES = \ cmdline.c \ + cmdline.h \ cwd.c \ + cwd.h \ egid.c \ + egid.h \ euid.c \ + euid.h \ filename.c \ + filename.h \ gid.c \ + gid.h \ sid.c \ + sid.h \ tty.c \ - uid.c + tty.h \ + uid.c \ + uid.h diff --git a/src/input/Makefile.in b/src/input/Makefile.in index 747ac099..40c34c99 100644 --- a/src/input/Makefile.in +++ b/src/input/Makefile.in @@ -51,8 +51,12 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/build/Makefile.am.common +EXTRA_PROGRAMS = +TESTS = +check_PROGRAMS = subdir = src/input -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ @@ -108,6 +112,8 @@ am__can_run_installinfo = \ esac ETAGS = etags CTAGS = ctags +am__tty_colors = \ +red=; grn=; lgn=; blu=; std= DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -224,30 +230,56 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -AM_CFLAGS = -I$(top_srcdir)/src +BUILT_SOURCES = +CLEANFILES = *.o +DISTCLEANFILES = +EXTRA_DIST = +EXTRA_LTLIBRARIES = +#CLEANFILES += $(EXTRA_LTLIBRARIES) $(EXTRA_PROGRAMS) $(check_PROGRAMS) +#DISTCLEANFILES += $(BUILT_SOURCES) +MAINTAINERCLEANFILES = Makefile.in + +### Include common Makefile configuration +# + +### Include +# +AM_CFLAGS = -Wall -Werror -I$(top_srcdir)/src ### Create one library with all snoopy inputs collected in it # noinst_LTLIBRARIES = libsnoopy_inputs_all.la -### Inputs collection is made of the following files +### Input providers collection is made of the following files +# +# Please maintain alphabetical order, equal to what `ls` would do # libsnoopy_inputs_all_la_SOURCES = \ cmdline.c \ + cmdline.h \ cwd.c \ + cwd.h \ egid.c \ + egid.h \ euid.c \ + euid.h \ filename.c \ + filename.h \ gid.c \ + gid.h \ sid.c \ + sid.h \ tty.c \ - uid.c + tty.h \ + uid.c \ + uid.h -all: all-am +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/build/Makefile.am.common $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -268,6 +300,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; +$(top_srcdir)/build/Makefile.am.common: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -289,6 +322,15 @@ clean-noinstLTLIBRARIES: libsnoopy_inputs_all.la: $(libsnoopy_inputs_all_la_OBJECTS) $(libsnoopy_inputs_all_la_DEPENDENCIES) $(EXTRA_libsnoopy_inputs_all_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libsnoopy_inputs_all_la_OBJECTS) $(libsnoopy_inputs_all_la_LIBADD) $(LIBS) +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -387,6 +429,99 @@ GTAGS: distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; skip=0; \ + srcdir=$(srcdir); export srcdir; \ + list=' $(TESTS) '; \ + $(am__tty_colors); \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$tst[\ \ ]*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + col=$$red; res=XPASS; \ + ;; \ + *) \ + col=$$grn; res=PASS; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$tst[\ \ ]*) \ + xfail=`expr $$xfail + 1`; \ + col=$$lgn; res=XFAIL; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + col=$$red; res=FAIL; \ + ;; \ + esac; \ + else \ + skip=`expr $$skip + 1`; \ + col=$$blu; res=SKIP; \ + fi; \ + echo "$${col}$$res$${std}: $$tst"; \ + done; \ + if test "$$all" -eq 1; then \ + tests="test"; \ + All=""; \ + else \ + tests="tests"; \ + All="All "; \ + fi; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="$$All$$all $$tests passed"; \ + else \ + if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ + banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all $$tests failed"; \ + else \ + if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ + banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ + fi; \ + fi; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + if test "$$skip" -eq 1; then \ + skipped="($$skip test was not run)"; \ + else \ + skipped="($$skip tests were not run)"; \ + fi; \ + test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$skipped"; \ + fi; \ + report=""; \ + if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ + report="Please report to $(PACKAGE_BUGREPORT)"; \ + test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$report"; \ + fi; \ + dashes=`echo "$$dashes" | sed s/./=/g`; \ + if test "$$failed" -eq 0; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + fi; \ + echo "$${col}$$dashes$${std}"; \ + echo "$${col}$$banner$${std}"; \ + test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ + test -z "$$report" || echo "$${col}$$report$${std}"; \ + echo "$${col}$$dashes$${std}"; \ + test "$$failed" -eq 0; \ + else :; fi + distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ @@ -418,10 +553,14 @@ distdir: $(DISTFILES) fi; \ done check-am: all-am -check: check-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) installdirs: -install: install-am +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am @@ -443,18 +582,22 @@ install-strip: mostlyclean-generic: clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am -clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ - mostlyclean-am +clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ + clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -522,20 +665,21 @@ ps-am: uninstall-am: -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags uninstall uninstall-am +.MAKE: all check check-am install install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ + clean-checkPROGRAMS clean-generic clean-libtool \ + clean-noinstLTLIBRARIES ctags distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/src/inputregistry.c b/src/inputregistry.c index 62901b42..b6e56f25 100644 --- a/src/inputregistry.c +++ b/src/inputregistry.c @@ -27,6 +27,7 @@ */ #include "snoopy.h" #include "inputregistry.h" +#include @@ -111,5 +112,5 @@ int snoopy_inputregistry_call (char *providerName, char *returnMessage) return -1; } - snoopy_inputregistry_ptrs[idx](returnMessage); + return snoopy_inputregistry_ptrs[idx](returnMessage); } diff --git a/src/inputregistry.h b/src/inputregistry.h index 2542153b..0ff6cf06 100644 --- a/src/inputregistry.h +++ b/src/inputregistry.h @@ -48,4 +48,6 @@ extern int (*snoopy_inputregistry_ptrs []) (char *input); /* * Functions to manage and utilise input providers */ +int snoopy_inputregistry_call (char *providerName, char *returnMessage); +int snoopy_inputregistry_getIndex (char *providerName); int snoopy_inputregistry_isRegistered (char *providerName); diff --git a/src/snoopy.h b/src/snoopy.h index b6cc6db3..b19d1d05 100644 --- a/src/snoopy.h +++ b/src/snoopy.h @@ -22,7 +22,7 @@ /** - * Include configured constants, so we can do thins here + * Include configured constants */ #include "config.h"