env_private.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * GRUB -- GRand Unified Bootloader
  3. * Copyright (C) 2003,2005,2006,2007,2009 Free Software Foundation, Inc.
  4. *
  5. * GRUB is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * GRUB is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef GRUB_ENV_PRIVATE_HEADER
  19. #define GRUB_ENV_PRIVATE_HEADER 1
  20. #include <grub/env.h>
  21. /* The size of the hash table. */
  22. #define HASHSZ 13
  23. /* A hashtable for quick lookup of variables. */
  24. struct grub_env_context
  25. {
  26. /* A hash table for variables. */
  27. struct grub_env_var *vars[HASHSZ];
  28. /* One level deeper on the stack. */
  29. struct grub_env_context *prev;
  30. };
  31. /* This is used for sorting only. */
  32. struct grub_env_sorted_var
  33. {
  34. struct grub_env_var *var;
  35. struct grub_env_sorted_var *next;
  36. };
  37. extern struct grub_env_context *grub_current_context;
  38. #endif /* ! GRUB_ENV_PRIVATE_HEADER */