?login_element?

Subversion Repositories NedoOS

Rev

Blame | Last modification | View Log | Download

  1. /* l_isrc.h - declarations for "l_isrc.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_ISRC_H_INCLUDED
  7. #define _L_ISRC_H_INCLUDED
  8.  
  9. #include "defs.h"
  10.  
  11. #include <stdbool.h>
  12. #include "l_list.h"
  13. #include "l_isrc.h"
  14.  
  15. // Input sources list structure
  16.  
  17. // Entry
  18.  
  19. struct input_source_entry_t
  20. {
  21.     struct list_entry_t list_entry;
  22.     char *real, *base, *user;
  23. };
  24.  
  25. void
  26.     input_source_entry_clear
  27.     (
  28.         struct input_source_entry_t *self
  29.     );
  30.  
  31. void
  32.     input_source_entry_free
  33.     (
  34.         struct input_source_entry_t *self
  35.     );
  36.  
  37. // List
  38.  
  39. struct input_sources_t
  40. {
  41.     struct list_t list;
  42. };
  43.  
  44. void
  45.     input_sources_clear
  46.     (
  47.         struct input_sources_t *self
  48.     );
  49.  
  50. // Returns "false" on success ("result" if presents is set to list entry).
  51. bool
  52.     input_sources_add
  53.     (
  54.         struct input_sources_t *self,
  55.         const char *real,
  56.         const char *base,
  57.         const char *user,
  58.         struct input_source_entry_t **result
  59.     );
  60.  
  61. // Returns "false" on success ("result" if presents is set to list entry).
  62. bool
  63.     input_sources_find_real
  64.     (
  65.         struct input_sources_t *self,
  66.         const char *real,
  67.         struct input_source_entry_t **result
  68.     );
  69.  
  70. // Returns "false" on success ("result" if presents is set to list entry).
  71. bool
  72.     input_sources_find_user
  73.     (
  74.         struct input_sources_t *self,
  75.         const char *user,
  76.         struct input_source_entry_t **result
  77.     );
  78.  
  79. // Returns "false" on success ("result" if presents is set to list entry).
  80. bool
  81.     input_sources_add_with_check
  82.     (
  83.         struct input_sources_t *self,
  84.         const char *user,
  85.         const char *base_path_real,
  86.         struct input_source_entry_t **result
  87.     );
  88.  
  89. #if DEBUG == 1
  90. void
  91.     _DBG_input_sources_dump
  92.     (
  93.         struct input_sources_t *self
  94.     );
  95. #else   // DEBUG != 1
  96. # define _DBG_input_sources_dump(x)
  97. #endif  // DEBUG 1= 1
  98.  
  99. void
  100.     input_sources_free
  101.     (
  102.         struct input_sources_t *self
  103.     );
  104.  
  105. #endif  // !_L_ISRC_H_INCLUDED
  106.