chiark / gitweb /
log: move log_syntax() into src/shared/log.c, and make it more similar to the other...
[elogind.git] / src / shared / conf-parser.h
index 2507a44444a5e620f32554a90a2c2c4ffe4aa75f..6152ee33b93af8bb28113c84bef6850c8e32e24b 100644 (file)
@@ -119,28 +119,12 @@ int config_parse_mode(const char *unit, const char *filename, unsigned line, con
 int config_parse_log_facility(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
 int config_parse_log_level(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
 
-int log_syntax_internal(
-                const char *unit,
-                int level,
-                const char *file,
-                int line,
-                const char *func,
-                const char *config_file,
-                unsigned config_line,
-                int error,
-                const char *format, ...) _printf_(9, 10);
-
-#define log_syntax(unit, level, config_file, config_line, error, ...)   \
-        log_syntax_internal(unit, level,                                \
-                            __FILE__, __LINE__, __func__,               \
-                            config_file, config_line,                   \
-                            error, __VA_ARGS__)
-
-#define log_invalid_utf8(unit, level, config_file, config_line, error, rvalue) { \
-        _cleanup_free_ char *__p = utf8_escape_invalid(rvalue);                  \
-        log_syntax(unit, level, config_file, config_line, error,                 \
-                   "String is not UTF-8 clean, ignoring assignment: %s", __p);   \
-        }
+#define log_invalid_utf8(unit, level, config_file, config_line, error, rvalue) \
+        do {                                                            \
+                _cleanup_free_ char *_p = utf8_escape_invalid(rvalue);  \
+                log_syntax(unit, level, config_file, config_line, error, \
+                           "String is not UTF-8 clean, ignoring assignment: %s", strna(_p)); \
+        } while(false)
 
 #define DEFINE_CONFIG_PARSE_ENUM(function,name,type,msg)                \
         int function(const char *unit,                                  \