?login_element?

Subversion Repositories NedoOS

Rev

Blame | Last modification | View Log | Download

  1. /* l_list.h - declarations for "l_list.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_LIST_H_INCLUDED
  7. #define _L_LIST_H_INCLUDED
  8.  
  9. #include "defs.h"
  10.  
  11. // List structure
  12.  
  13. // Entry
  14.  
  15. struct list_entry_t
  16. {
  17.     struct list_entry_t *next;
  18. };
  19.  
  20. void
  21.     list_entry_clear
  22.     (
  23.         struct list_entry_t *self
  24.     );
  25.  
  26. // Free contents, but not the variable itself
  27. void
  28.     list_entry_free
  29.     (
  30.         struct list_entry_t *self
  31.     );
  32.  
  33. // List
  34.  
  35. struct list_t
  36. {
  37.     struct list_entry_t *first, *last;
  38.     unsigned count;
  39. };
  40.  
  41. void
  42.     list_clear
  43.     (
  44.         struct list_t *self
  45.     );
  46.  
  47. void
  48.     list_add_entry
  49.     (
  50.         struct list_t *self,
  51.         struct list_entry_t *p
  52.     );
  53.  
  54. // Free contents, but not the variable itself
  55. void
  56.     list_free
  57.     (
  58.         struct list_t *self
  59.     );
  60.  
  61. #endif  // !_L_LIST_H_INCLUDED
  62.