core: move gpiod_version_string() to misc.c
authorBartosz Golaszewski <bartekgola@gmail.com>
Wed, 28 Jun 2017 14:15:04 +0000 (16:15 +0200)
committerBartosz Golaszewski <bartekgola@gmail.com>
Thu, 6 Jul 2017 09:11:36 +0000 (11:11 +0200)
Create a separate .c file for misc definitions.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
src/lib/Makefile.am
src/lib/core.c
src/lib/misc.c [new file with mode: 0644]

index 9128f64b5769ffc665f99fa86aea4ed0e4522625..6cf3e9ad74aaf9239ac881c6bfc44823c8ccd1bc 100644 (file)
@@ -7,7 +7,7 @@
 #
 
 lib_LTLIBRARIES = libgpiod.la
-libgpiod_la_SOURCES = core.c iter.c simple.c
+libgpiod_la_SOURCES = core.c iter.c misc.c simple.c
 libgpiod_la_CFLAGS = -Wall -Wextra -g
 libgpiod_la_CFLAGS += -fvisibility=hidden -I$(top_srcdir)/include/
 libgpiod_la_CFLAGS += -include $(top_builddir)/config.h
index 59c525cdec0c3d2b710dcc535752b1346b7083d0..27ccbe802653f7354af1f1c4ae59948642496591 100644 (file)
@@ -885,8 +885,3 @@ struct gpiod_chip * gpiod_line_get_chip(struct gpiod_line *line)
 {
        return line->chip;
 }
-
-const char * gpiod_version_string(void)
-{
-       return GPIOD_VERSION_STR;
-}
diff --git a/src/lib/misc.c b/src/lib/misc.c
new file mode 100644 (file)
index 0000000..c7f7cf9
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Misc definitions for libgpiod.
+ *
+ * Copyright (C) 2017 Bartosz Golaszewski <bartekgola@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2.1 of the GNU Lesser General Public License
+ * as published by the Free Software Foundation.
+ */
+
+#include <gpiod.h>
+
+const char * gpiod_version_string(void)
+{
+       return GPIOD_VERSION_STR;
+}