summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--journal-notify.c16
-rw-r--r--journal-notify.h34
3 files changed, 38 insertions, 14 deletions
diff --git a/Makefile b/Makefile
index 570c23e..810f921 100644
--- a/Makefile
+++ b/Makefile
@@ -19,7 +19,7 @@ version.h: $(wildcard .git/HEAD .git/index .git/refs/tags/*) Makefile
echo "#define VERSION \"$(shell git describe --tags --long 2>/dev/null || echo ${VERSION})\"" >> $@
echo "#endif" >> $@
-journal-notify: journal-notify.c version.h
+journal-notify: journal-notify.c journal-notify.h version.h
$(CC) $(CFLAGS) -o journal-notify journal-notify.c
README.html: README.md
diff --git a/journal-notify.c b/journal-notify.c
index bc7740c..9819f07 100644
--- a/journal-notify.c
+++ b/journal-notify.c
@@ -5,22 +5,11 @@
* of the GNU General Public License, incorporated herein by reference.
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <regex.h>
-
-#include <systemd/sd-journal.h>
-
-#include <libnotify/notify.h>
-
-#include "version.h"
+#include "journal-notify.h"
const char * program = NULL;
-#define OPTSTRING "aehi:m:nor:v"
-#define DEFAULTICON "dialog-information"
-
+/*** notify ***/
int notify(const char * summary, const char * body, const char * icon) {
NotifyNotification * notification;
int rc = -1;
@@ -46,6 +35,7 @@ out:
return rc;
}
+/*** main ***/
int main(int argc, char **argv) {
int i, rc = EXIT_FAILURE;
uint8_t verbose = 0;
diff --git a/journal-notify.h b/journal-notify.h
new file mode 100644
index 0000000..c16942d
--- /dev/null
+++ b/journal-notify.h
@@ -0,0 +1,34 @@
+/*
+ * (C) 2014 by Christian Hesse <mail@eworm.de>
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ */
+
+#ifndef _JOURNAL_NOTIFY_H
+#define _JOURNAL_NOTIFY_H
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <regex.h>
+
+#include <systemd/sd-journal.h>
+
+#include <libnotify/notify.h>
+
+#include "version.h"
+
+#define OPTSTRING "aehi:m:nor:v"
+#define DEFAULTICON "dialog-information"
+
+/*** notify ***/
+int notify(const char * summary, const char * body, const char * icon);
+
+/*** main ***/
+int main(int argc, char **argv);
+
+#endif /* _JOURNAL_NOTIFY_H */
+
+// vim: set syntax=c:
+