
When a variable with a registered callback is inserted, deleted, or overwritten the callback is called and gives the system an opportunity to do something in response to the change. It also has the opportunuty to reject the change by returning non-zero.
Before I go much further, I want to get a little feedback if this is a good implementation. It certainly cleans up cmd_nvedit.c significantly!
Joe Hershberger (5): env: Add support for callbacks to environment vars env: Add a loadaddr env handler env: Add a bootfile env handler env: Add a baudrate env handler env: Add a console env handler
arch/arm/cpu/u-boot.lds | 7 +++ common/Makefile | 4 +- common/cmd_load.c | 24 +++++++- common/cmd_nvedit.c | 87 -------------------------- common/console.c | 46 ++++++++++++++ common/env_attr.c | 159 ++++++++++++++++++++++++++++++++++++++++++++++++ common/env_callback.c | 114 ++++++++++++++++++++++++++++++++++ common/serial.c | 58 ++++++++++++++++++ include/env_attr.h | 35 +++++++++++ include/env_callback.h | 64 +++++++++++++++++++ include/environment.h | 2 + include/search.h | 5 ++ lib/hashtable.c | 65 +++++++++++++++++++- net/net.c | 16 +++++ 14 files changed, 595 insertions(+), 91 deletions(-) create mode 100644 common/env_attr.c create mode 100644 common/env_callback.c create mode 100644 include/env_attr.h create mode 100644 include/env_callback.h