From 8e12dba8d99a009efc68a43cecb9975498141929 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Mon, 22 Jun 2015 11:15:31 +0200 Subject: [PATCH] Refactor: Move conf.c declarations from finit.h --> conf.h Signed-off-by: Joachim Nilsson --- api.c | 3 ++- conf.c | 2 +- conf.h | 41 +++++++++++++++++++++++++++++++++++++++++ finit.c | 1 + finit.h | 7 ------- plugins/initctl.c | 3 ++- service.c | 1 + sig.c | 1 + tty.c | 1 + 9 files changed, 50 insertions(+), 10 deletions(-) create mode 100644 conf.h diff --git a/api.c b/api.c index 5a501e24..eb08aa34 100644 --- a/api.c +++ b/api.c @@ -30,10 +30,11 @@ #include #include +#include "finit.h" +#include "conf.h" #include "helpers.h" #include "plugin.h" #include "sig.h" -#include "finit.h" #include "service.h" #include "libite/lite.h" diff --git a/conf.c b/conf.c index 92627a8e..98edcfe5 100644 --- a/conf.c +++ b/conf.c @@ -1,4 +1,4 @@ -/* Parser for finit.conf +/* Parser for /etc/finit.conf and /etc/finit.d/.conf * * Copyright (c) 2012-2015 Joachim Nilsson * diff --git a/conf.h b/conf.h new file mode 100644 index 00000000..5c9b4ce3 --- /dev/null +++ b/conf.h @@ -0,0 +1,41 @@ +/* Parser for /etc/finit.conf and /etc/finit.d/.conf + * + * Copyright (c) 2012-2015 Joachim Nilsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef FINIT_CONF_H_ +#define FINIT_CONF_H_ + +void parse_kernel_cmdline (void); +int parse_runlevels (char *runlevels); +int parse_finit_conf (char *file); +int parse_finit_d (char *dir); +void reload_finit_d (void); + +#endif /* FINIT_CONF_H_ */ + +/** + * Local Variables: + * version-control: t + * indent-tabs-mode: t + * c-file-style: "linux" + * End: + */ diff --git a/finit.c b/finit.c index 4ac54aaa..b634fb3a 100644 --- a/finit.c +++ b/finit.c @@ -28,6 +28,7 @@ #include /* umask(), mkdir() */ #include "finit.h" +#include "conf.h" #include "helpers.h" #include "private.h" #include "plugin.h" diff --git a/finit.h b/finit.h index dcbd0b9f..a3c5cfef 100644 --- a/finit.h +++ b/finit.h @@ -111,13 +111,6 @@ extern char *runparts; extern char *console; extern char *__progname; -/* conf.c */ -void parse_kernel_cmdline (void); -int parse_runlevels (char *runlevels); -int parse_finit_conf (char *file); -int parse_finit_d (char *dir); -void reload_finit_d (void); - #endif /* FINIT_H_ */ /** diff --git a/plugins/initctl.c b/plugins/initctl.c index 24701629..935fc548 100644 --- a/plugins/initctl.c +++ b/plugins/initctl.c @@ -29,10 +29,11 @@ #include /* read() */ #include +#include "../finit.h" +#include "../conf.h" #include "../helpers.h" #include "../plugin.h" #include "../sig.h" -#include "../finit.h" #include "../service.h" #include "libite/lite.h" diff --git a/service.c b/service.c index b65c510b..71933219 100644 --- a/service.c +++ b/service.c @@ -28,6 +28,7 @@ #include "libite/lite.h" #include "finit.h" +#include "conf.h" #include "helpers.h" #include "private.h" #include "sig.h" diff --git a/sig.c b/sig.c index 1aa108b7..13ea4792 100644 --- a/sig.c +++ b/sig.c @@ -43,6 +43,7 @@ #include #include "finit.h" +#include "conf.h" #include "helpers.h" #include "plugin.h" #include "private.h" diff --git a/tty.c b/tty.c index 1344003f..cd7cfa00 100644 --- a/tty.c +++ b/tty.c @@ -26,6 +26,7 @@ #include #include "finit.h" +#include "conf.h" #include "helpers.h" #include "libite/lite.h" #include "tty.h"