?login_element?

Subversion Repositories NedoOS

Rev

Blame | Last modification | View Log | Download

  1. /* l_pre.h - declarations for "l_pre.c".
  2.  
  3.    This is free and unencumbered software released into the public domain.
  4.    For more information, please refer to <http://unlicense.org>. */
  5.  
  6. #ifndef _L_PRE_H_INCLUDED
  7. #define _L_PRE_H_INCLUDED
  8.  
  9. #include "defs.h"
  10.  
  11. #include <stdbool.h>
  12. #include "l_list.h"
  13.  
  14. // Prerequisites list structure
  15.  
  16. // Entry
  17.  
  18. struct prerequisite_entry_t
  19. {
  20.     struct list_entry_t list_entry;
  21.     char *prerequisite;
  22. };
  23.  
  24. void
  25.     prerequisite_entry_clear
  26.     (
  27.         struct prerequisite_entry_t *self
  28.     );
  29.  
  30. void
  31.     prerequisite_entry_free
  32.     (
  33.         struct prerequisite_entry_t *self
  34.     );
  35.  
  36. // List
  37.  
  38. struct prerequisites_t
  39. {
  40.     struct list_t list;
  41. };
  42.  
  43. void
  44.     prerequisites_clear
  45.     (
  46.         struct prerequisites_t *self
  47.     );
  48.  
  49. // Returns "false" on success ("result" if presents is set to list entry).
  50. bool
  51.     prerequisites_add
  52.     (
  53.         struct prerequisites_t *self,
  54.         const char *prerequisite,
  55.         struct prerequisite_entry_t **result
  56.     );
  57.  
  58. // Returns "false" on success.
  59. bool
  60.     prerequisites_print
  61.     (
  62.         struct prerequisites_t *self,
  63.         FILE *stream
  64.     );
  65.  
  66. void
  67.     prerequisites_free
  68.     (
  69.         struct prerequisites_t *self
  70.     );
  71.  
  72. #endif  // !_L_PRE_H_INCLUDED
  73.