?login_element?

Subversion Repositories NedoOS

Rev

Blame | Last modification | View Log | Download

  1. /* l_ifile.h - declarations for "l_ifile.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_IFILE_H_INCLUDED
  7. #define _L_IFILE_H_INCLUDED
  8.  
  9. #include "defs.h"
  10.  
  11. #include <stdbool.h>
  12. #include "l_list.h"
  13.  
  14. // Include files list structure
  15.  
  16. #define SRCFL_NONE  0
  17. #define SRCFL_PARSE (1 << 0)
  18.  
  19. // Entry
  20.  
  21. struct included_file_entry_t
  22. {
  23.     struct list_entry_t list_entry;
  24.     unsigned line;
  25.     unsigned flags;
  26.     char *name;
  27. };
  28.  
  29. void
  30.     included_file_entry_clear
  31.     (
  32.         struct included_file_entry_t *self
  33.     );
  34.  
  35. void
  36.     included_file_entry_free
  37.     (
  38.         struct included_file_entry_t *self
  39.     );
  40.  
  41. // List
  42.  
  43. struct included_files_t
  44. {
  45.     struct list_t list;
  46. };
  47.  
  48. void
  49.     included_files_clear
  50.     (
  51.         struct included_files_t *self
  52.     );
  53.  
  54. bool
  55.     included_files_add
  56.     (
  57.         struct included_files_t *self,
  58.         unsigned line,
  59.         unsigned flags,
  60.         const char *name,
  61.         struct included_file_entry_t **result
  62.     );
  63.  
  64. // Returns "false" on success ("result" if presents is set to list entry).
  65. bool
  66.     included_files_find
  67.     (
  68.         struct included_files_t *self,
  69.         const char *name,
  70.         struct included_file_entry_t **result
  71.     );
  72.  
  73. void
  74.     included_files_free
  75.     (
  76.         struct included_files_t *self
  77.     );
  78.  
  79. #endif  // !_L_IFILE_H_INCLUDED
  80.