1. ----------------------------------------------------------------------- 
  2. --               GtkAda - Ada95 binding for Gtk+/Gnome               -- 
  3. --                                                                   -- 
  4. --                Copyright (C) 2001-2002 ACT-Europe                 -- 
  5. --                                                                   -- 
  6. -- This library is free software; you can redistribute it and/or     -- 
  7. -- modify it under the terms of the GNU General Public               -- 
  8. -- License as published by the Free Software Foundation; either      -- 
  9. -- version 2 of the License, or (at your option) any later version.  -- 
  10. --                                                                   -- 
  11. -- This library is distributed in the hope that it will be useful,   -- 
  12. -- but WITHOUT ANY WARRANTY; without even the implied warranty of    -- 
  13. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU -- 
  14. -- General Public License for more details.                          -- 
  15. --                                                                   -- 
  16. -- You should have received a copy of the GNU General Public         -- 
  17. -- License along with this library; if not, write to the             -- 
  18. -- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      -- 
  19. -- Boston, MA 02111-1307, USA.                                       -- 
  20. --                                                                   -- 
  21. -- -- -- -- -- -- -- -- -- -- -- --
  22. ----------------------------------------------------------------------- 
  23.  
  24. --  <description> 
  25. -- 
  26. --  This package provides definitions for the error handling mechanism used in 
  27. --  Glib, Gdk and Gtk. 
  28. -- 
  29. --  </description> 
  30. --  <c_version>1.3.11</c_version> 
  31. --  <group>Glib, the general-purpose library</group> 
  32.  
  33. package Glib.Error is 
  34.    pragma Preelaborate; 
  35.  
  36.    type GError is new C_Proxy; 
  37.  
  38.    type GError_Access is access all GError; 
  39.  
  40.    function Error_New 
  41.      (Domain : GQuark; Code : Gint; Message : String) return GError; 
  42.    --  Create a new GError object. 
  43.  
  44.    procedure Error_Free (Error : GError); 
  45.    --  Free the memory associated with a GError. 
  46.  
  47.    function Error_Copy (Error : GError) return GError; 
  48.    --  Duplicate a GError object. 
  49.  
  50.    function Error_Matches 
  51.      (Error : GError; Domain : GQuark; Code : Gint) return Boolean; 
  52.    --  Return whether a given GError matches a domain/code. 
  53.  
  54.    function Get_Domain (Error : GError) return GQuark; 
  55.    --  Return the domain associated with a GError. 
  56.  
  57.    function Get_Code (Error : GError) return Gint; 
  58.    --  Return the code associated with a GError. 
  59.  
  60.    function Get_Message (Error : GError) return String; 
  61.    --  Return the message associated with a GError. 
  62.  
  63. private 
  64.  
  65.    pragma Import (C, Error_Free, "g_error_free"); 
  66.    pragma Import (C, Error_Copy, "g_error_copy"); 
  67.  
  68. end Glib.Error;