chiark / gitweb /
tree-wide: port over all code to the new CONFIG_PARSER_PROTOTYPE() macro
authorLennart Poettering <lennart@poettering.net>
Tue, 22 May 2018 11:10:17 +0000 (13:10 +0200)
committerSven Eden <yamakuzure@gmx.net>
Fri, 24 Aug 2018 14:47:08 +0000 (16:47 +0200)
This makes most header files easier to look at. Also Emacs gets really
slow when browsing through large sections of overly long prototypes,
which is much improved by this macro.

We should probably not do something similar with too many other cases,
as macros like this might help readability for some, but make it worse
for others. But I think given the complexity of this specific prototype
and how often we use it, it's worth doing.

src/login/logind-action.h
src/login/logind-user.h
src/login/logind.h

index 4fdbc60e4932deb4d1f7139a524e4f8077490063..74b1dc88fb3c75867e1f1d8f47806a5812a930b7 100644 (file)
@@ -5,21 +5,10 @@
   This file is part of systemd.
 
   Copyright 2012 Lennart Poettering
-
-  elogind 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.
-
-  elogind 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 elogind; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+//#include "conf-parser.h"
+
 typedef enum HandleAction {
         HANDLE_IGNORE,
         HANDLE_POWEROFF,
@@ -49,4 +38,5 @@ const char* handle_action_to_string(HandleAction h) _const_;
 HandleAction handle_action_from_string(const char *s) _pure_;
 
 const char* manager_target_for_action(HandleAction handle);
-int config_parse_handle_action(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);
+
+CONFIG_PARSER_PROTOTYPE(config_parse_handle_action);
index c80b0227146d8904008fc5b5b251983a3b06e29b..ad830206cb1cf152312e409e59baeb73730cf9bf 100644 (file)
@@ -9,6 +9,7 @@
 
 typedef struct User User;
 
+//#include "conf-parser.h"
 #include "list.h"
 #include "logind.h"
 
@@ -82,4 +83,4 @@ UserState user_state_from_string(const char *s) _pure_;
 int bus_user_method_terminate(sd_bus_message *message, void *userdata, sd_bus_error *error);
 int bus_user_method_kill(sd_bus_message *message, void *userdata, sd_bus_error *error);
 
-int config_parse_compat_user_tasks_max(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);
+CONFIG_PARSER_PROTOTYPE(config_parse_compat_user_tasks_max);
index 52e41680be9b0417ff5419d19c2e50e80b9415cd..be276170cf17bbbc88d746c66c5c8f8e7c85b47b 100644 (file)
@@ -17,6 +17,7 @@
 #include "sd-bus.h"
 #include "sd-event.h"
 
+//#include "conf-parser.h"
 #include "hashmap.h"
 #include "list.h"
 #include "set.h"
@@ -231,8 +232,8 @@ const struct ConfigPerfItem* logind_gperf_lookup(const char *key, GPERF_LEN_TYPE
 
 int manager_set_lid_switch_ignore(Manager *m, usec_t until);
 
-int config_parse_n_autovts(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_tmpfs_size(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);
+CONFIG_PARSER_PROTOTYPE(config_parse_n_autovts);
+CONFIG_PARSER_PROTOTYPE(config_parse_tmpfs_size);
 
 int manager_get_session_from_creds(Manager *m, sd_bus_message *message, const char *name, sd_bus_error *error, Session **ret);
 int manager_get_user_from_creds(Manager *m, sd_bus_message *message, uid_t uid, sd_bus_error *error, User **ret);