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