env: add check/apply logic to himport_r()
authorGerlando Falauto <gerlando.falauto@keymile.com>
Fri, 24 Aug 2012 00:11:39 +0000 (00:11 +0000)
committerTom Rini <trini@ti.com>
Tue, 18 Sep 2012 19:01:52 +0000 (12:01 -0700)
commitc5983592e912835fe9ed00b9d98b05580c460eae
tree96245807698607969286b6b4d0b2f1b664fdb3e8
parent348b1f1c6064990210a6797c86514fd358b73062
env: add check/apply logic to himport_r()

Change hashtable so that a callback function will decide whether a
variable can be overwritten, and possibly apply the changes.

So add a new field to struct hsearch_data:

 o "apply" callback function to check whether a variable can be
    overwritten, and possibly immediately apply the changes;
    when NULL, no check is performed.

And a new argument to himport_r():
 o "do_apply": whether to call the apply callback function

NOTE: This patch does not change the current behavior.

Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Reviewed-by: Marek Vasut <marex@denx.de>
common/cmd_nvedit.c
common/env_common.c
include/environment.h
include/search.h
lib/hashtable.c