[Nut-upsdev] nutdrv_qx interface change proposal item_t::preprocess

Nick Ma.
2015-05-01T13:26:31Z

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,
I would like to propose an interface change/extension, in order to be
able to clearly differ from a PRE_SEND and a POST_RECEIVE
item_t->preprocess-ing calls.

IMHO there is no option to differ from item->preprocess(..), called from
[1] and called from [2], at the moment. My idea is to extend the
item_t->preprocess(..) with an additional argument about the calling
point of the method like this [3].

The changes in the main nutdrv_qx module would be small [4], but every
calling point would have to be extended by the additional argument.
Pleas let me know what you'r thinking.

Best, Nick

[1]
https://github.com/networkupstools/nut/blob/master/drivers/nutdrv_qx.c#L1393
[2]
https://github.com/networkupstools/nut/blob/master/drivers/nutdrv_qx.c#L2674
[3]
https://github.com/nickma82/nut/blob/nutdrv_qx_interface_change/drivers/nutdrv_qx.h#L103
[4]
https://github.com/nickma82/nut/commit/ce330a3873fd0a9243a61258db243a6eee327e65
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJVQ38GAAoJEDMnKdeJttQVxagP/1lOfPd0qVol9nTvLAptFr8I
GKcfAg+1LHNXZ43qAxo8ZXGEHIxmRHuKxuMBAEWKXA76zlYozOIP85GGy63rONCL
D5z4y/J8B2dgW4Q0Jtj4PsAmTvsW7yXbKvGWboAhnoTeRf5BupPB4335GGByl1HM
jQZrHhG+TvAJa/86zzL0OBNggV0SMiqyI7YEyMmR+5jz5p7g0hj+0IJQ1s90aWCM
l2S5qr+joitqWS///Ta1L4X8Slbog+/wMinX0+zzRFwpcRDTfAGARJQMVQhLU5Ue
3XPBNIMMLxpB+qga3rlzk3hVxB2+t6OEuZPkDML9KouvB4fYyXsGVMc99rkQQdCD
rk10BTDErpQ+5dReQmnKMXzGW5zqikfJ+RUEoyVp94Gq5P4umA7pzcM0dO/TICpL
Jc/pt+nj9RE2VmGdHCzsvXdJ5ErnheGmGMz1jDFq7PtMeHTlXq1aLvCbMIbksvi+
WbjdpGH/ozh9SJBytOVAV7tvKXTI0J2zIjvtk9x3SlookIxhWe63WjG5mB/wvEGl
Z89RyM3h3qNC7dUWaTnIzXQ1qmxIiPnVI0uwLpe4PGZwRwQUqtaXCcd+uVV0L06/
XlzRV5Y4oXQeNAfCDABUfpvJzS0R09oK0ADyTtTdjg+7XSRw8+occtYndzh7rjrN
1eBv4tFB5jqGULDoA/PF
=8dmy
-----END PGP SIGNATURE-----