cli: add additional user-data argument to get_fcn()

System Internals / NetworkManager - Thomas Haller [redhat.com] - 9 July 2018 13:43 EDT

The function nmc_print() receives a list of "targets". These are essentially the rows that should be printed (while the "fields" list represents the columns).

When filling the cells with values, it calles repeatedly get_fcn() on the column descriptors (fields), by passing each row (target).

The caller must be well aware that the fields and targets are compatible. For example, in some cases the targets are NMDevice instances and the target type must correspond to what get_fcn() expects.

Add another user-data pointer that is passed on along with the targets. That is useful, if we have a list of targets/rows, but pass in additional data that applies to all rows alike.

It is still unused.

ba350a349 cli: add additional user-data argument to get_fcn()
clients/cli/common.c | 2 ++
clients/cli/connections.c | 5 ++++-
clients/cli/devices.c | 6 ++++++
clients/cli/general.c | 3 +++
clients/cli/settings.c | 1 +
clients/cli/utils.c | 10 +++++++++-
clients/cli/utils.h | 2 ++
clients/common/nm-meta-setting-access.c | 2 ++
clients/common/nm-meta-setting-access.h | 1 +
clients/common/nm-meta-setting-desc.c | 3 +++
clients/common/nm-meta-setting-desc.h | 1 +
11 files changed, 34 insertions(+), 2 deletions(-)

Upstream: cgit.freedesktop.org


  • Share