From 406c568fffc68527e3a2cd67c35fc5b38c2b1218 Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Wed, 28 Jun 2017 16:15:04 +0200 Subject: [PATCH] core: move gpiod_version_string() to misc.c Create a separate .c file for misc definitions. Signed-off-by: Bartosz Golaszewski --- src/lib/Makefile.am | 2 +- src/lib/core.c | 5 ----- src/lib/misc.c | 16 ++++++++++++++++ 3 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 src/lib/misc.c diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am index 9128f64..6cf3e9a 100644 --- a/src/lib/Makefile.am +++ b/src/lib/Makefile.am @@ -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 diff --git a/src/lib/core.c b/src/lib/core.c index 59c525c..27ccbe8 100644 --- a/src/lib/core.c +++ b/src/lib/core.c @@ -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 index 0000000..c7f7cf9 --- /dev/null +++ b/src/lib/misc.c @@ -0,0 +1,16 @@ +/* + * Misc definitions for libgpiod. + * + * Copyright (C) 2017 Bartosz Golaszewski + * + * 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 + +const char * gpiod_version_string(void) +{ + return GPIOD_VERSION_STR; +} -- 2.30.2