]> khamidou — GitHub mirrors - mojo.git/commitdiff
forgot to add those files...
authorkhamidou <khamidou@gmail.com>
Fri, 25 Dec 2009 18:15:52 +0000 (19:15 +0100)
committerkhamidou <khamidou@gmail.com>
Fri, 25 Dec 2009 18:15:52 +0000 (19:15 +0100)
error.c [new file with mode: 0644]
error.h [new file with mode: 0644]

diff --git a/error.c b/error.c
new file mode 100644 (file)
index 0000000..93e2eb1
--- /dev/null
+++ b/error.c
@@ -0,0 +1,13 @@
+#include "error.h"
+
+
+void fail(char *fmt, ...)
+{
+       va_list ap;
+       va_start(ap, fmt);
+       vfprintf(stderr, fmt, ap);
+       va_end(ap);
+       puts("");
+       fflush(stdout);
+       exit(EXIT_FAILURE);
+}
diff --git a/error.h b/error.h
new file mode 100644 (file)
index 0000000..5cb1ab3
--- /dev/null
+++ b/error.h
@@ -0,0 +1,10 @@
+#ifndef __ERROR_H__
+#define __ERROR_H__
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+
+void fail(char *fmt, ...);
+
+#endif