home *** CD-ROM | disk | FTP | other *** search
/ Solo Programadores 22 / SOLO_22.iso / packages / win32ada / data.z / win32-conio.adb < prev    next >
Encoding:
Text File  |  1995-11-17  |  2.2 KB  |  68 lines

  1. -- $Source: /home/harp/1/proto/monoBANK/winnt/win32-conio.adb,v $ 
  2. -- $Revision: 1.3 $ $Date: 95/02/06 11:29:45 $ $Author: mg $ 
  3. -------------------------------------------------------------------------------
  4. --
  5. -- THIS FILE AND ANY ASSOCIATED DOCUMENTATION IS FURNISHED "AS IS" WITHOUT 
  6. -- WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 
  7. -- TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR 
  8. -- PURPOSE.  The user assumes the entire risk as to the accuracy and the 
  9. -- use of this file.
  10. --
  11. -- Copyright (c) Intermetrics, Inc. 1995
  12. -- Royalty-free, unlimited, worldwide, non-exclusive use, modification, 
  13. -- reproduction and further distribution of this file is permitted.
  14. --
  15. -------------------------------------------------------------------------------
  16.  
  17.  
  18. with Ada.Unchecked_Conversion;
  19. with Stdarg.Impl;
  20.  
  21. package body Win32.Conio is
  22.     
  23.     function "&" is new Stdarg.Concat(Win32.PCSTR);
  24.  
  25.     function cprintf (
  26.         format : Win32.PCSTR;
  27.         args   : Stdarg.ArgList := Stdarg.Empty) return Win32.INT is
  28.  
  29.         use Stdarg, Stdarg.Impl;
  30.  
  31.         Complete_Args: Stdarg.Arglist :=
  32.             Stdarg.Empty & Format & Args;
  33.  
  34.         function C_cprintf return Win32.INT;
  35.         pragma Import(C, C_cprintf, "_cprintf");
  36.  
  37.         function To_INT is new Ada.Unchecked_Conversion(
  38.                          Stdarg.C_Param, Win32.INT);
  39.     begin
  40.         return To_INT(F_Varargs(
  41.             C_cprintf'Address,
  42.             ArgCount(Complete_Args),
  43.             Address_of_First_Arg(Complete_Args)));
  44.     end cprintf;
  45.  
  46.     function cscanf (
  47.         format : Win32.PCSTR;
  48.         args   : Stdarg.ArgList := Stdarg.Empty) return Win32.INT is
  49.  
  50.         use Stdarg, Stdarg.Impl;
  51.  
  52.         Complete_Args: Stdarg.Arglist :=
  53.             Stdarg.Empty & Format & Args;
  54.  
  55.         function C_cscanf return Win32.INT;
  56.         pragma Import(C, C_cscanf, "_cscanf");
  57.  
  58.         function To_INT is new Ada.Unchecked_Conversion(
  59.                          Stdarg.C_Param, Win32.INT);
  60.     begin
  61.         return To_INT(F_Varargs(
  62.             C_cscanf'Address,
  63.             ArgCount(Complete_Args),
  64.             Address_of_First_Arg(Complete_Args)));
  65.     end cscanf;
  66.  
  67. end Win32.Conio;
  68.