#ifndef ZCK_H
#define ZCK_H
-#define ZCK_NAME "zchunk"
#define ZCK_VERSION "0.4.0"
#define ZCK_VER_MAJOR 0
#define ZCK_VER_MINOR 4
add_global_arguments('-Wunused-result', language : 'c')
add_global_arguments('-std=gnu99', language : 'c')
subdir('lib')
-executable('zck', ['zck.c', 'buzhash/buzhash.c'], include_directories: inc, link_with: zcklib, install: true)
-executable('unzck', ['unzck.c'], include_directories: inc, link_with: zcklib, install: true)
-executable('zckdl', ['zck_dl.c'], include_directories: inc, link_with: zcklib, install: true)
-executable('zck_read_header', ['zck_read_header.c'], include_directories: inc, link_with: zcklib, install: true)
-executable('zck_delta_size', ['zck_delta_size.c', 'memmem.c'], include_directories: inc, link_with: zcklib, install: true)
+executable('zck', ['zck.c', 'util_common.c', 'buzhash/buzhash.c'], include_directories: inc, link_with: zcklib, install: true)
+executable('unzck', ['unzck.c', 'util_common.c'], include_directories: inc, link_with: zcklib, install: true)
+executable('zckdl', ['zck_dl.c', 'util_common.c'], include_directories: inc, link_with: zcklib, install: true)
+executable('zck_read_header', ['zck_read_header.c', 'util_common.c'], include_directories: inc, link_with: zcklib, install: true)
+executable('zck_delta_size', ['zck_delta_size.c', 'util_common.c', 'memmem.c'], include_directories: inc, link_with: zcklib, install: true)
--- /dev/null
+/*
+ * Copyright 2018 Jonathan Dieter <jdieter@gmail.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <zck.h>
+
+#include "util_common.h"
+
+void version() {
+ printf(ZCK_NAME " " ZCK_VERSION "\nCopyright (c) " ZCK_COPYRIGHT_YEAR
+ " Jonathan Dieter\n");
+ exit(0);
+}
--- /dev/null
+#ifndef UTIL_COMMON_H
+#define UTIL_COMMON_H
+
+#define ZCK_NAME "zchunk"
+#define ZCK_COPYRIGHT_YEAR "2018"
+
+void version();
+
+#endif
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
-#include <zck.h>
#include <argp.h>
+#include <zck.h>
+#include "util_common.h"
#include "buzhash/buzhash.h"
#include "memmem.h"
static char args_doc[] = "<file>";
-void version() {
- printf(ZCK_NAME " " ZCK_VERSION "\nCopyright (c) 2018 Jonathan Dieter\n");
- exit(0);
-}
-
static struct argp_option options[] = {
{"verbose", 'v', 0, 0,
"Increase verbosity (can be specified more than once for debugging)"},