]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shared: move output_mode_to_string() into output-mode.c
authorLennart Poettering <lennart@poettering.net>
Wed, 20 Apr 2016 17:37:46 +0000 (19:37 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 22 Apr 2016 14:16:59 +0000 (16:16 +0200)
After all, the enum definition is in output-mode.h

Makefile.am
src/shared/logs-show.c
src/shared/logs-show.h
src/shared/output-mode.c [new file with mode: 0644]
src/shared/output-mode.h

index b0118fd9a50ac6643e99ff7c74836a31d09ffc1b..0f475c6d0954876b6676894379372e8693da603d 100644 (file)
@@ -962,6 +962,7 @@ noinst_LTLIBRARIES += \
 
 libshared_la_SOURCES = \
        src/shared/output-mode.h \
+       src/shared/output-mode.c \
        src/shared/gpt.h \
        src/shared/udev-util.h \
        src/shared/linux/auto_dev-ioctl.h \
index 15c818ccf1dd6f9419af99b27984811743543e9e..895223a4d9f827d14dbaa7146980b1bd5f9776c6 100644 (file)
@@ -1292,18 +1292,3 @@ int show_journal_by_unit(
 
         return show_journal(f, j, mode, n_columns, not_before, how_many, flags, ellipsized);
 }
-
-static const char *const output_mode_table[_OUTPUT_MODE_MAX] = {
-        [OUTPUT_SHORT] = "short",
-        [OUTPUT_SHORT_ISO] = "short-iso",
-        [OUTPUT_SHORT_PRECISE] = "short-precise",
-        [OUTPUT_SHORT_MONOTONIC] = "short-monotonic",
-        [OUTPUT_VERBOSE] = "verbose",
-        [OUTPUT_EXPORT] = "export",
-        [OUTPUT_JSON] = "json",
-        [OUTPUT_JSON_PRETTY] = "json-pretty",
-        [OUTPUT_JSON_SSE] = "json-sse",
-        [OUTPUT_CAT] = "cat"
-};
-
-DEFINE_STRING_TABLE_LOOKUP(output_mode, OutputMode);
index 9765a24ff24bd971de4bb815a0843a7c26f87baa..66434408812d62bdca81843cb25c16d6320d882e 100644 (file)
@@ -68,6 +68,3 @@ void json_escape(
                 const char* p,
                 size_t l,
                 OutputFlags flags);
-
-const char* output_mode_to_string(OutputMode m) _const_;
-OutputMode output_mode_from_string(const char *s) _pure_;
diff --git a/src/shared/output-mode.c b/src/shared/output-mode.c
new file mode 100644 (file)
index 0000000..be6281b
--- /dev/null
@@ -0,0 +1,36 @@
+/***
+  This file is part of systemd.
+
+  Copyright 2012 Lennart Poettering
+
+  systemd is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Lesser General Public License as published by
+  the Free Software Foundation; either version 2.1 of the License, or
+  (at your option) any later version.
+
+  systemd is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public License
+  along with systemd; If not, see <http://www.gnu.org/licenses/>.
+***/
+
+#include "output-mode.h"
+#include "string-table.h"
+
+static const char *const output_mode_table[_OUTPUT_MODE_MAX] = {
+        [OUTPUT_SHORT] = "short",
+        [OUTPUT_SHORT_ISO] = "short-iso",
+        [OUTPUT_SHORT_PRECISE] = "short-precise",
+        [OUTPUT_SHORT_MONOTONIC] = "short-monotonic",
+        [OUTPUT_VERBOSE] = "verbose",
+        [OUTPUT_EXPORT] = "export",
+        [OUTPUT_JSON] = "json",
+        [OUTPUT_JSON_PRETTY] = "json-pretty",
+        [OUTPUT_JSON_SSE] = "json-sse",
+        [OUTPUT_CAT] = "cat"
+};
+
+DEFINE_STRING_TABLE_LOOKUP(output_mode, OutputMode);
index e2b26e04d3d8b67247cea27bb70aac60716dd57d..ea2e95f06b11ca36d3980ee48cb6a7c0c8ab5436 100644 (file)
@@ -19,6 +19,8 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include "macro.h"
+
 typedef enum OutputMode {
         OUTPUT_SHORT,
         OUTPUT_SHORT_ISO,
@@ -48,3 +50,6 @@ typedef enum OutputFlags {
         OUTPUT_UTC            = 1 << 7,
         OUTPUT_KERNEL_THREADS = 1 << 8,
 } OutputFlags;
+
+const char* output_mode_to_string(OutputMode m) _const_;
+OutputMode output_mode_from_string(const char *s) _pure_;