?login_element?

Subversion Repositories NedoOS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /* l_src.h - declarations for "l_src.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_SRC_H_INCLUDED
  7. #define _L_SRC_H_INCLUDED
  8.  
  9. #include "defs.h"
  10.  
  11. #include <stdbool.h>
  12. #include "l_list.h"
  13. #include "l_ifile.h"
  14.  
  15. // Sources list structure
  16.  
  17. // Entry
  18.  
  19. struct source_entry_t
  20. {
  21.     struct list_entry_t list_entry;
  22.     char *real, *base, *user;
  23.     unsigned flags;
  24.     struct included_files_t included;
  25. };
  26.  
  27. void
  28.     source_entry_clear
  29.     (
  30.         struct source_entry_t *self
  31.     );
  32.  
  33. void
  34.     source_entry_free
  35.     (
  36.         struct source_entry_t *self
  37.     );
  38.  
  39. // List
  40.  
  41. struct sources_t
  42. {
  43.     struct list_t list;
  44. };
  45.  
  46. void
  47.     sources_clear
  48.     (
  49.         struct sources_t *self
  50.     );
  51.  
  52. // Returns "false" on success ("result" if presents is set to list entry).
  53. bool
  54.     sources_add
  55.     (
  56.         struct sources_t *self,
  57.         const char *real,
  58.         const char *base,
  59.         const char *user,
  60.         unsigned flags,
  61.         struct source_entry_t **result
  62.     );
  63.  
  64. // Returns "false" on success ("result" if presents is set to list entry).
  65. bool
  66.     sources_find_real
  67.     (
  68.         struct sources_t *self,
  69.         const char *real,
  70.         struct source_entry_t **result
  71.     );
  72.  
  73. // Returns "false" on success ("result" if presents is set to list entry).
  74. bool
  75.     sources_find_user
  76.     (
  77.         struct sources_t *self,
  78.         const char *user,
  79.         struct source_entry_t **result
  80.     );
  81.  
  82. void
  83.     sources_free
  84.     (
  85.         struct sources_t *self
  86.     );
  87.  
  88. #endif  // !_L_SRC_H_INCLUDED
  89.