1. ------------------------------------------------------------------------------ 
  2. --               GtkAda - Ada95 binding for the Gimp Toolkit                -- 
  3. --                                                                          -- 
  4. --                     Copyright (C) 1998-2014, AdaCore                     -- 
  5. --                                                                          -- 
  6. -- This library is free software;  you can redistribute it and/or modify it -- 
  7. -- under terms of the  GNU General Public License  as published by the Free -- 
  8. -- Software  Foundation;  either version 3,  or (at your  option) any later -- 
  9. -- version. This library is distributed in the hope that it will be useful, -- 
  10. -- but WITHOUT ANY WARRANTY;  without even the implied warranty of MERCHAN- -- 
  11. -- TABILITY or FITNESS FOR A PARTICULAR PURPOSE.                            -- 
  12. --                                                                          -- 
  13. -- As a special exception under Section 7 of GPL version 3, you are granted -- 
  14. -- additional permissions described in the GCC Runtime Library Exception,   -- 
  15. -- version 3.1, as published by the Free Software Foundation.               -- 
  16. --                                                                          -- 
  17. -- You should have received a copy of the GNU General Public License and    -- 
  18. -- a copy of the GCC Runtime Library Exception along with this program;     -- 
  19. -- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    -- 
  20. -- <http://www.gnu.org/licenses/>.                                          -- 
  21. --                                                                          -- 
  22. ------------------------------------------------------------------------------ 
  23.  
  24. --  <description> 
  25. -- 
  26. --  This packages provides the implementation of a generic single-linked 
  27. --  list. 
  28. --  One instantiation is found in Gtk.Widget.Widget_Slist for a list of 
  29. --  widgets. 
  30. -- 
  31. --  See the documentation of Glib.Glist for more information, it provides 
  32. --  the same API as this package. 
  33. --  Single linked lists are traversed the same way as double-linked lists, 
  34. --  even though most subprograms are less efficient than their 
  35. --  double-linked counterparts. 
  36. -- 
  37. --  </description> 
  38. --  <c_version>1.2.6</c_version> 
  39. --  <group>Glib, the general-purpose library</group> 
  40.  
  41. with System; 
  42.  
  43. package Glib.GSlist is 
  44.  
  45.    --  <doc_ignore> 
  46.  
  47.    generic 
  48.       type Gpointer (<>) is private; 
  49.       with function Convert (P : Gpointer) return System.Address is <>; 
  50.       with function Convert (S : System.Address) return Gpointer is <>; 
  51.    package Generic_SList is 
  52.  
  53.       type GSlist is private; 
  54.       Null_List : constant GSlist; 
  55.  
  56.       procedure Alloc (List : out GSlist); 
  57.       procedure Append (List : in out GSlist; 
  58.                         Data : in Gpointer); 
  59.       function Concat (List1 : in GSlist; 
  60.                        List2 : in GSlist) 
  61.                        return GSlist; 
  62.       procedure Insert (List : in out GSlist; 
  63.                         Data : in Gpointer; 
  64.                         Position : in Gint); 
  65.       function Find (List : in GSlist; 
  66.                      Data : in Gpointer) 
  67.                      return GSlist; 
  68.       procedure Free (List : in out GSlist); 
  69.       function Get_Data (List : in GSlist) 
  70.                          return Gpointer; 
  71.  
  72.       function Get_Data_Address (List : GSlist) return System.Address; 
  73.       --  Return directly the System.Address contained in the C list. 
  74.       --  This is used mainly internally in GtkAda to implement String lists, 
  75.       --  and you should not have to use this subprogram yourself. 
  76.  
  77.       function Index (List : in GSlist; 
  78.                       Data : in Gpointer) 
  79.                       return Gint; 
  80.       function Last (List : in GSlist) 
  81.                      return GSlist; 
  82.       function Length (List : in GSlist) 
  83.                        return Guint; 
  84.       procedure List_Reverse (List : in out GSlist); 
  85.       function Next (List : in GSlist) 
  86.                      return GSlist; 
  87.       function Nth (List : in GSlist; 
  88.                     N    : in Guint) 
  89.                     return GSlist; 
  90.       function Nth_Data (List : in GSlist; 
  91.                          N : in Guint) 
  92.                          return Gpointer; 
  93.       function Position (List : in GSlist; 
  94.                          Link : in GSlist) 
  95.                          return Gint; 
  96.       procedure Prepend (List : in out GSlist; 
  97.                          Data : in Gpointer); 
  98.       procedure Remove (List : in out GSlist; 
  99.                         Data : in Gpointer); 
  100.       procedure Remove_Link (List : in out GSlist; 
  101.                              Link : in GSlist); 
  102.       function Get_Object (Obj : in GSlist) 
  103.                            return System.Address; 
  104.       pragma Inline (Get_Object); 
  105.       procedure Set_Object (Obj    : in out GSlist; 
  106.                             Value  : in     System.Address); 
  107.       pragma Inline (Set_Object); 
  108.    private 
  109.  
  110.       type GSlist is 
  111.          record 
  112.             Ptr : System.Address := System.Null_Address; 
  113.          end record; 
  114.       Null_List : constant GSlist := (Ptr => System.Null_Address); 
  115.    end Generic_SList; 
  116.  
  117.    --  </doc_ignore> 
  118.  
  119. end Glib.GSlist;