diff options
author | Thomas Haller <thaller@redhat.com> | 2018-04-27 11:10:13 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-05-14 17:53:03 +0200 |
commit | fc475f25f2ad29efad7af0ac8d6bef4989a0bf15 (patch) | |
tree | 23ae3be37433cb217c48435b76365596e35e51ae /clients/cli/general.c | |
parent | 5975e4a39e81fab9a23db4adc74d531097ac5a41 (diff) | |
download | NetworkManager-th/cli-connection-handling.tar.gz |
cli: use macro for list of argument for NmcMetaGenericInfo.get_fcn()th/cli-connection-handling
The reasons are:
- I want to locate all implmenetations of the get_fcn() handler. By
consistently using this macro, you can just grep for the macro and
find them all.
- all implementations should follow the same style. This macro
enforces the same names for arguments and avoids copy&paste.
- if we are going to add or change an argument, it becomes easier.
That's because we can easily identify all implementation and can
change arguments in one place.
Diffstat (limited to 'clients/cli/general.c')
-rw-r--r-- | clients/cli/general.c | 30 |
1 files changed, 3 insertions, 27 deletions
diff --git a/clients/cli/general.c b/clients/cli/general.c index f1a350c77d..841df8bdec 100644 --- a/clients/cli/general.c +++ b/clients/cli/general.c @@ -172,15 +172,7 @@ _NM_UTILS_LOOKUP_DEFINE (static, permission_result_to_color, NMClientPermissionR static const NmcMetaGenericInfo *const metagen_general_status[]; static gconstpointer -_metagen_general_status_get_fcn (const NMMetaEnvironment *environment, - gpointer environment_user_data, - const NmcMetaGenericInfo *info, - gpointer target, - NMMetaAccessorGetType get_type, - NMMetaAccessorGetFlags get_flags, - NMMetaAccessorGetOutFlags *out_flags, - gboolean *out_is_default, - gpointer *out_to_free) +_metagen_general_status_get_fcn (NMC_META_GENERIC_INFO_GET_FCN_ARGS) { NmCli *nmc = target; const char *value; @@ -280,15 +272,7 @@ static const NmcMetaGenericInfo *const metagen_general_status[_NMC_GENERIC_INFO_ /*****************************************************************************/ static gconstpointer -_metagen_general_permissions_get_fcn (const NMMetaEnvironment *environment, - gpointer environment_user_data, - const NmcMetaGenericInfo *info, - gpointer target, - NMMetaAccessorGetType get_type, - NMMetaAccessorGetFlags get_flags, - NMMetaAccessorGetOutFlags *out_flags, - gboolean *out_is_default, - gpointer *out_to_free) +_metagen_general_permissions_get_fcn (NMC_META_GENERIC_INFO_GET_FCN_ARGS) { NMClientPermission perm = GPOINTER_TO_UINT (target); NmCli *nmc = environment_user_data; @@ -329,15 +313,7 @@ typedef struct { } GetGeneralLoggingData; static gconstpointer -_metagen_general_logging_get_fcn (const NMMetaEnvironment *environment, - gpointer environment_user_data, - const NmcMetaGenericInfo *info, - gpointer target, - NMMetaAccessorGetType get_type, - NMMetaAccessorGetFlags get_flags, - NMMetaAccessorGetOutFlags *out_flags, - gboolean *out_is_default, - gpointer *out_to_free) +_metagen_general_logging_get_fcn (NMC_META_GENERIC_INFO_GET_FCN_ARGS) { NmCli *nmc = environment_user_data; GetGeneralLoggingData *d = target; |