]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - Ada95/gen/terminal_interface-curses-aux.ads.m4
ncurses 5.0
[ncurses.git] / Ada95 / gen / terminal_interface-curses-aux.ads.m4
similarity index 70%
rename from Ada95/ada_include/terminal_interface-curses-aux.ads
rename to Ada95/gen/terminal_interface-curses-aux.ads.m4
index 1221b2e50a846f6d2a7646f4cd956dbdb979b5d4..71e4872b47c41a8d327e0e32545f1ee0bab186f8 100644 (file)
@@ -1,4 +1,6 @@
-------------------------------------------------------------------------------
+--  -*- ada -*-
+define(`HTMLNAME',`terminal_interface-curses-aux__ads.htm')dnl
+include(M4MACRO)------------------------------------------------------------------------------
 --                                                                          --
 --                           GNAT ncurses Binding                           --
 --                                                                          --
 -- sale, use or other dealings in this Software without prior written       --
 -- authorization.                                                           --
 ------------------------------------------------------------------------------
---  Author: Juergen Pfeifer <Juergen.Pfeifer@T-Online.de> 1996
+--  Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1996
 --  Version Control:
---  $Revision: 1.8 $
---  Binding Version 00.93
+--  $Revision: 1.13 $
+--  Binding Version 01.00
 ------------------------------------------------------------------------------
+include(`Base_Defs')
 with System;
 with Interfaces.C;
 with Interfaces.C.Strings; use Interfaces.C.Strings;
 with Unchecked_Conversion;
 
 package Terminal_Interface.Curses.Aux is
-   pragma Preelaborate (Aux);
+   pragma Preelaborate (Terminal_Interface.Curses.Aux);
 
-   use type Interfaces.C.Int;
+   use type Interfaces.C.int;
 
-   subtype C_Int      is Interfaces.C.Int;
-   subtype C_Short    is Interfaces.C.Short;
-   subtype C_Long_Int is Interfaces.C.Long;
-   subtype C_Size_T   is Interfaces.C.Size_T;
-   subtype C_Char_Ptr is Interfaces.C.Strings.Chars_Ptr;
+   subtype C_Int      is Interfaces.C.int;
+   subtype C_Short    is Interfaces.C.short;
+   subtype C_Long_Int is Interfaces.C.long;
+   subtype C_Size_T   is Interfaces.C.size_t;
+   subtype C_UInt     is Interfaces.C.unsigned;
+   subtype C_ULong    is Interfaces.C.unsigned_long;
+   subtype C_Char_Ptr is Interfaces.C.Strings.chars_ptr;
    type    C_Void_Ptr is new System.Address;
-
+include(`Chtype_Def')
    --  This is how those constants are defined in ncurses. I see them also
    --  exactly like this in all ETI implementations I ever tested. So it
    --  could be that this is quite general, but please check with your curses.
    --  This is critical, because curses sometime mixes boolean returns with
    --  returning an error status.
-   Curses_Ok    : constant C_Int :=  0;
-   Curses_Err   : constant C_Int := -1;
-
-   Curses_True  : constant C_Int := 1;
-   Curses_False : constant C_Int := 0;
-
-   subtype Eti_Error is C_Int range -14 .. 0;
-   --  Type for error codes returned by the menu and forms subsystem
+   Curses_Ok    : constant C_Int := CF_CURSES_OK;
+   Curses_Err   : constant C_Int := CF_CURSES_ERR;
 
-   E_Ok              : constant Eti_Error := 0;
-   E_System_Error    : constant Eti_Error := -1;
-   E_Bad_Argument    : constant Eti_Error := -2;
-   E_Posted          : constant Eti_Error := -3;
-   E_Connected       : constant Eti_Error := -4;
-   E_Bad_State       : constant Eti_Error := -5;
-   E_No_Room         : constant Eti_Error := -6;
-   E_Not_Posted      : constant Eti_Error := -7;
-   E_Unknown_Command : constant Eti_Error := -8;
-   E_No_Match        : constant Eti_Error := -9;
-   E_Not_Selectable  : constant Eti_Error := -10;
-   E_Not_Connected   : constant Eti_Error := -11;
-   E_Request_Denied  : constant Eti_Error := -12;
-   E_Invalid_Field   : constant Eti_Error := -13;
-   E_Current         : constant Eti_Error := -14;
+   Curses_True  : constant C_Int := CF_CURSES_TRUE;
+   Curses_False : constant C_Int := CF_CURSES_FALSE;
 
+   --  Eti_Error: type for error codes returned by the menu and form subsystem
+include(`Eti_Defs')
    procedure Eti_Exception (Code : Eti_Error);
    --  Dispatch the error code and raise the appropriate exception
    --
    --
    --  Some helpers
-   function CInt_To_Chtype is new
-     Unchecked_Conversion (Source => C_Int,
+   function Chtype_To_AttrChar is new
+     Unchecked_Conversion (Source => C_Chtype,
                            Target => Attributed_Character);
-   function Chtype_To_CInt is new
+   function AttrChar_To_Chtype is new
      Unchecked_Conversion (Source => Attributed_Character,
-                           Target => C_Int);
+                           Target => C_Chtype);
+
+   function AttrChar_To_AttrType is new
+     Unchecked_Conversion (Source => Attributed_Character,
+                           Target => C_AttrType);
+
+   function AttrType_To_AttrChar is new
+     Unchecked_Conversion (Source => C_AttrType,
+                           Target => Attributed_Character);
 
    procedure Fill_String (Cp  : in  chars_ptr;
                           Str : out String);