chiark / gitweb /
Prep v239: Fix conf-parser.[hc], it got a bit mangled by migration.
authorSven Eden <yamakuzure@gmx.net>
Mon, 20 Aug 2018 07:30:45 +0000 (09:30 +0200)
committerSven Eden <yamakuzure@gmx.net>
Fri, 24 Aug 2018 14:47:08 +0000 (16:47 +0200)
src/basic/utf8.c
src/shared/conf-parser.c
src/shared/conf-parser.h
src/test/test-conf-parser.c

index 42818358ea828e9f4b0d7c0e6559c2daab385a32..a5ce1a2944ae61ed342ef6ad99f6a4d4a6f01db7 100644 (file)
@@ -29,7 +29,7 @@
 #include <string.h>
 
 #include "alloc-util.h"
-//#include "gunicode.h"
+#include "gunicode.h"
 #include "hexdecoct.h"
 #include "macro.h"
 #include "utf8.h"
index 58a546966ad94370da013e2b776467ec7f877e63..472c996423be58577a478487b86f725d9cc655b1 100644 (file)
@@ -21,6 +21,7 @@
 #include "parse-util.h"
 #include "path-util.h"
 #include "process-util.h"
+//#include "rlimit-util.h"
 #include "signal-util.h"
 #include "socket-util.h"
 #include "string-util.h"
 /// Additional includes needed by elogind
 #include "def.h"
 #include "fileio.h"
-//#include "rlimit-util.h"
-//#include "rlimit-util.h"
-//#include "rlimit-util.h"
-//#include "rlimit-util.h"
-//#include "rlimit-util.h"
-//#include "rlimit-util.h"
-//#include "rlimit-util.h"
-//#include "rlimit-util.h"
-//#include "rlimit-util.h"
-//#include "rlimit-util.h"
-//#include "rlimit-util.h"
-//#include "rlimit-util.h"
-//#include "rlimit-util.h"
-//#include "rlimit-util.h"
-//#include "rlimit-util.h"
-//#include "rlimit-util.h"
 
 int config_item_table_lookup(
                 const void *table,
@@ -536,6 +521,7 @@ DEFINE_PARSER(nsec, nsec_t, parse_nsec);
 DEFINE_PARSER(sec, usec_t, parse_sec);
 DEFINE_PARSER(mode, mode_t, parse_mode);
 
+#if 0 /// UNNEEDED by elogind
 int config_parse_iec_size(const char* unit,
                             const char *filename,
                             unsigned line,
@@ -566,7 +552,6 @@ int config_parse_iec_size(const char* unit,
         return 0;
 }
 
-#if 0 /// UNNEEDED by elogind
 int config_parse_si_size(
                 const char* unit,
                 const char *filename,
@@ -718,6 +703,7 @@ int config_parse_string(
         return 0;
 }
 
+#if 0 /// UNNEEDED by elogind
 int config_parse_path(
                 const char *unit,
                 const char *filename,
@@ -754,6 +740,7 @@ int config_parse_path(
 finalize:
         return free_and_replace(*s, n);
 }
+#endif // 0
 
 int config_parse_strv(
                 const char *unit,
@@ -801,6 +788,7 @@ int config_parse_strv(
         return 0;
 }
 
+#if 0 /// UNNEEDED by elogind
 int config_parse_warn_compat(
                 const char *unit,
                 const char *filename,
@@ -836,7 +824,6 @@ int config_parse_warn_compat(
         return 0;
 }
 
-#if 0 /// UNNEEDED by elogind
 int config_parse_log_facility(
                 const char *unit,
                 const char *filename,
@@ -866,7 +853,6 @@ int config_parse_log_facility(
 
         return 0;
 }
-#endif // 0
 
 int config_parse_log_level(
                 const char *unit,
@@ -930,7 +916,6 @@ int config_parse_signal(
         return 0;
 }
 
-#if 0 /// UNNEEDED by elogind
 int config_parse_personality(
                 const char *unit,
                 const char *filename,
@@ -1152,8 +1137,7 @@ int config_parse_join_controllers(
 
         return 0;
 }
-#endif // 0
-
+x
 int config_parse_mtu(
                 const char *unit,
                 const char *filename,
@@ -1258,3 +1242,4 @@ int config_parse_permille(const char* unit,
 
         return 0;
 }
+#endif // 0
index e006e183f430f67e4e4b18890348c398b784d8d6..50ddbc3a4838983e95f83c302332a0aae671a166 100644 (file)
@@ -112,20 +112,6 @@ int config_parse_many(
                 void *userdata);
 #endif // 0
 
-#if 0 /// UNNEEDED by elogind
-#endif // 0
-#if 0 /// UNNEEDED by elogind
-#endif // 0
-#if 0 /// UNNEEDED by elogind
-#endif // 0
-#if 0 /// UNNEEDED by elogind
-#endif // 0
-#if 0 /// UNNEEDED by elogind
-#endif // 0
-#if 0 /// UNNEEDED by elogind
-#endif // 0
-#if 0 /// UNNEEDED by elogind
-#endif // 0
 CONFIG_PARSER_PROTOTYPE(config_parse_int);
 CONFIG_PARSER_PROTOTYPE(config_parse_unsigned);
 CONFIG_PARSER_PROTOTYPE(config_parse_long);
@@ -134,15 +120,22 @@ CONFIG_PARSER_PROTOTYPE(config_parse_uint16);
 CONFIG_PARSER_PROTOTYPE(config_parse_uint32);
 CONFIG_PARSER_PROTOTYPE(config_parse_uint64);
 CONFIG_PARSER_PROTOTYPE(config_parse_double);
+#if 0 /// UNNEEDED by elogind
 CONFIG_PARSER_PROTOTYPE(config_parse_iec_size);
 CONFIG_PARSER_PROTOTYPE(config_parse_si_size);
 CONFIG_PARSER_PROTOTYPE(config_parse_iec_uint64);
+#endif // 0
 CONFIG_PARSER_PROTOTYPE(config_parse_bool);
+#if 0 /// UNNEEDED by elogind
 CONFIG_PARSER_PROTOTYPE(config_parse_tristate);
+#endif // 0
 CONFIG_PARSER_PROTOTYPE(config_parse_string);
+#if 0 /// UNNEEDED by elogind
 CONFIG_PARSER_PROTOTYPE(config_parse_path);
+#endif // 0
 CONFIG_PARSER_PROTOTYPE(config_parse_strv);
 CONFIG_PARSER_PROTOTYPE(config_parse_sec);
+#if 0 /// UNNEEDED by elogind
 CONFIG_PARSER_PROTOTYPE(config_parse_nsec);
 CONFIG_PARSER_PROTOTYPE(config_parse_mode);
 CONFIG_PARSER_PROTOTYPE(config_parse_warn_compat);
@@ -156,6 +149,7 @@ CONFIG_PARSER_PROTOTYPE(config_parse_ip_port);
 CONFIG_PARSER_PROTOTYPE(config_parse_join_controllers);
 CONFIG_PARSER_PROTOTYPE(config_parse_mtu);
 CONFIG_PARSER_PROTOTYPE(config_parse_rlimit);
+#endif // 0
 
 typedef enum Disabled {
         DISABLED_CONFIGURATION,
index 3cce425e691f5453748354a0360d97c5faf60bd4..1593d3adf0f38f2125e77267d7ac27b42c2e010d 100644 (file)
@@ -10,6 +10,7 @@
 #include "strv.h"
 #include "util.h"
 
+#if 0 /// UNNEEDED by elogind
 static void test_config_parse_path_one(const char *rvalue, const char *expected) {
         _cleanup_free_ char *path = NULL;
 
@@ -24,14 +25,12 @@ static void test_config_parse_log_level_one(const char *rvalue, int expected) {
         assert_se(expected == log_level);
 }
 
-#if 0 /// UNNEEDED by elogind
 static void test_config_parse_log_facility_one(const char *rvalue, int expected) {
         int log_facility = 0;
 
         assert_se(config_parse_log_facility("unit", "filename", 1, "section", 1, "lvalue", 0, rvalue, &log_facility, NULL) >= 0);
         assert_se(expected == log_facility);
 }
-#endif // 0
 
 static void test_config_parse_iec_size_one(const char *rvalue, size_t expected) {
         size_t iec_size = 0;
@@ -40,7 +39,6 @@ static void test_config_parse_iec_size_one(const char *rvalue, size_t expected)
         assert_se(expected == iec_size);
 }
 
-#if 0 /// UNNEEDED by elogind
 static void test_config_parse_si_size_one(const char *rvalue, size_t expected) {
         size_t si_size = 0;
 
@@ -70,12 +68,14 @@ static void test_config_parse_strv_one(const char *rvalue, char **expected) {
         assert_se(strv_equal(expected, strv));
 }
 
+#if 0 /// UNNEEDED by elogind
 static void test_config_parse_mode_one(const char *rvalue, mode_t expected) {
         mode_t v = 0;
 
         assert_se(config_parse_mode("unit", "filename", 1, "section", 1, "lvalue", 0, rvalue, &v, NULL) >= 0);
         assert_se(expected == v);
 }
+#endif // 0
 
 static void test_config_parse_sec_one(const char *rvalue, usec_t expected) {
         usec_t v = 0;
@@ -91,7 +91,6 @@ static void test_config_parse_nsec_one(const char *rvalue, nsec_t expected) {
         assert_se(config_parse_nsec("unit", "filename", 1, "nsection", 1, "lvalue", 0, rvalue, &v, NULL) >= 0);
         assert_se(expected == v);
 }
-#endif // 0
 
 static void test_config_parse_path(void) {
         test_config_parse_path_one("/path", "/path");
@@ -111,14 +110,12 @@ static void test_config_parse_log_level(void) {
         test_config_parse_log_level_one("garbage", 0);
 }
 
-#if 0 /// UNNEEDED by elogind
 static void test_config_parse_log_facility(void) {
         test_config_parse_log_facility_one("mail", LOG_MAIL);
         test_config_parse_log_facility_one("user", LOG_USER);
 
         test_config_parse_log_facility_one("garbage", 0);
 }
-#endif // 0
 
 static void test_config_parse_iec_size(void) {
         test_config_parse_iec_size_one("1024", 1024);
@@ -133,7 +130,6 @@ static void test_config_parse_iec_size(void) {
         test_config_parse_iec_size_one("garbage", 0);
 }
 
-#if 0 /// UNNEEDED by elogind
 static void test_config_parse_si_size(void) {
         test_config_parse_si_size_one("1024", 1024);
         test_config_parse_si_size_one("2K", 2000);
@@ -179,6 +175,7 @@ static void test_config_parse_strv(void) {
         test_config_parse_strv_one("\xc3\x7f", STRV_MAKE("\xc3\x7f"));
 }
 
+#if 0 /// UNNEEDED by elogind
 static void test_config_parse_mode(void) {
         test_config_parse_mode_one("777", 0777);
         test_config_parse_mode_one("644", 0644);
@@ -189,6 +186,7 @@ static void test_config_parse_mode(void) {
         test_config_parse_mode_one("777garbage", 0);
         test_config_parse_mode_one("777 garbage", 0);
 }
+#endif // 0
 
 static void test_config_parse_sec(void) {
         test_config_parse_sec_one("1", 1 * USEC_PER_SEC);
@@ -398,19 +396,19 @@ int main(int argc, char **argv) {
         log_parse_environment();
         log_open();
 
+#if 0 /// UNNEEDED by elogind
         test_config_parse_path();
         test_config_parse_log_level();
-#if 0 /// UNNEEDED by elogind
         test_config_parse_log_facility();
-#endif // 0
         test_config_parse_iec_size();
-#if 0 /// UNNEEDED by elogind
         test_config_parse_si_size();
 #endif // 0
         test_config_parse_int();
         test_config_parse_unsigned();
         test_config_parse_strv();
+#if 0 /// UNNEEDED by elogind
         test_config_parse_mode();
+#endif // 0
         test_config_parse_sec();
 #if 0 /// UNNEEDED by elogind
         test_config_parse_nsec();