cmd_nvedit.h 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * (C) Copyright 2000
  3. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. */
  23. /*
  24. * Boot support
  25. */
  26. #ifndef _CMD_NVEDIT_H
  27. #define _CMD_NVEDIT_H
  28. #define CMD_TBL_PRINTENV MK_CMD_TBL_ENTRY( \
  29. "printenv", 4, CFG_MAXARGS, 1, do_printenv, \
  30. "printenv- print environment variables\n", \
  31. "\n - print values of all environment variables\n" \
  32. "printenv name ...\n" \
  33. " - print value of environment variable 'name'\n" \
  34. ),
  35. int do_printenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  36. #define CMD_TBL_SETENV MK_CMD_TBL_ENTRY( \
  37. "setenv", 6, CFG_MAXARGS, 0, do_setenv, \
  38. "setenv - set environment variables\n", \
  39. "name value ...\n" \
  40. " - set environment variable 'name' to 'value ...'\n" \
  41. "setenv name\n" \
  42. " - delete environment variable 'name'\n" \
  43. ),
  44. int do_setenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  45. #if ((CONFIG_COMMANDS & (CFG_CMD_ENV|CFG_CMD_FLASH)) == (CFG_CMD_ENV|CFG_CMD_FLASH))
  46. #define CMD_TBL_SAVEENV MK_CMD_TBL_ENTRY( \
  47. "saveenv", 4, 1, 0, do_saveenv, \
  48. "saveenv - save environment variables to persistent storage\n", \
  49. NULL \
  50. ),
  51. int do_saveenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  52. #else
  53. #define CMD_TBL_SAVEENV
  54. #endif /* CFG_CMD_ENV */
  55. #if (CONFIG_COMMANDS & CFG_CMD_ASKENV)
  56. #define CMD_TBL_ASKENV MK_CMD_TBL_ENTRY( \
  57. "askenv", 8, CFG_MAXARGS, 1, do_askenv, \
  58. "askenv - get environment variables from stdin\n", \
  59. "name [message] [size]\n" \
  60. " - get environment variable 'name' from stdin (max 'size' chars)\n" \
  61. "askenv name\n" \
  62. " - get environment variable 'name' from stdin\n" \
  63. "askenv name size\n" \
  64. " - get environment variable 'name' from stdin (max 'size' chars)\n" \
  65. "askenv name [message] size\n" \
  66. " - display 'message' string and get environment variable 'name'" \
  67. "from stdin (max 'size' chars)\n" \
  68. ),
  69. int do_askenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  70. #else
  71. #define CMD_TBL_ASKENV
  72. #endif /* CFG_CMD_ASKENV */
  73. #if (CONFIG_COMMANDS & CFG_CMD_RUN)
  74. #define CMD_TBL_RUN MK_CMD_TBL_ENTRY( \
  75. "run", 3, CFG_MAXARGS, 1, do_run, \
  76. "run - run commands in an environment variable\n", \
  77. "var [...]\n" \
  78. " - run the commands in the environment variable(s) 'var'\n" \
  79. ),
  80. int do_run (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  81. #else
  82. #define CMD_TBL_RUN
  83. #endif /* CFG_CMD_RUN */
  84. #endif /* _CMD_NVEDIT_H */