uitree.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * BURG - Brand-new Universal loadeR from GRUB
  3. * Copyright 2009 Bean Lee - All Rights Reserved
  4. *
  5. * BURG 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. * BURG 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 BURG. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef GRUB_UITREE_HEADER
  19. #define GRUB_UITREE_HEADER 1
  20. #include <grub/err.h>
  21. #include <grub/tree.h>
  22. struct grub_uiprop
  23. {
  24. struct grub_uiprop *next;
  25. char *value;
  26. char name[0];
  27. };
  28. typedef struct grub_uiprop *grub_uiprop_t;
  29. struct grub_uitree
  30. {
  31. struct grub_uitree *parent;
  32. struct grub_uitree *child;
  33. struct grub_uitree *next;
  34. struct grub_uiprop *prop;
  35. void *data;
  36. int flags;
  37. char name[0];
  38. };
  39. typedef struct grub_uitree *grub_uitree_t;
  40. extern struct grub_uitree grub_uitree_root;
  41. #define GRUB_UITREE_LOAD_FLAG_SINGLE 1
  42. #define GRUB_UITREE_LOAD_FLAG_ROOT 2
  43. void grub_uitree_dump (grub_uitree_t node);
  44. grub_uitree_t grub_uitree_find (grub_uitree_t node, const char *name);
  45. grub_uitree_t grub_uitree_find_id (grub_uitree_t node, const char *name);
  46. grub_uitree_t grub_uitree_create_node (const char *name);
  47. grub_uitree_t grub_uitree_load_string (grub_uitree_t root, char *buf,
  48. int flags);
  49. grub_uitree_t grub_uitree_load_file (grub_uitree_t root, const char *name,
  50. int flags);
  51. grub_uitree_t grub_uitree_clone (grub_uitree_t node);
  52. void grub_uitree_free (grub_uitree_t node);
  53. grub_err_t grub_uitree_set_prop (grub_uitree_t node, const char *name,
  54. const char *value);
  55. char *grub_uitree_get_prop (grub_uitree_t node, const char *name);
  56. #endif