1. ------------------------------------------------------------------------------ 
  2. --                  GtkAda - Ada95 binding for Gtk+/Gnome                   -- 
  3. --                                                                          -- 
  4. --                     Copyright (C) 2001-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 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;