X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=doc%2Fhtml%2Fada%2Fterminal_interface-curses-trace__adb.htm;h=b766f28071bee9dc69e0447b5f4fd93780fd2e19;hp=a209b3f34e057777fc394c058eec284a6d5ace08;hb=f86cbeb5f9bd96ab041d34039c35749a14965039;hpb=027ae42953e3186daed8f3882da73de48291b606 diff --git a/doc/html/ada/terminal_interface-curses-trace__adb.htm b/doc/html/ada/terminal_interface-curses-trace__adb.htm index a209b3f3..b766f280 100644 --- a/doc/html/ada/terminal_interface-curses-trace__adb.htm +++ b/doc/html/ada/terminal_interface-curses-trace__adb.htm @@ -12,7 +12,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 2000,2004 Free Software Foundation, Inc. -- +-- Copyright (c) 2000-2004,2009 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -40,22 +40,43 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control: --- @Revision: 1.5 @ +-- @Revision: 1.6 @ -- Binding Version 01.00 ------------------------------------------------------------------------------ +with Interfaces.C; use Interfaces.C; +with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; +with Ada.Unchecked_Conversion; -package body Terminal_Interface.Curses.Trace is +package body Terminal_Interface.Curses.Trace is - procedure Trace_On (x : Trace_Attribute_Set) is - pragma Unreferenced (x); + type C_TraceType is new C_UInt; + + function TraceAda_To_TraceC is new + Ada.Unchecked_Conversion (Source => Trace_Attribute_Set, + Target => C_TraceType); + + procedure Trace_On (x : Trace_Attribute_Set) is + procedure traceC (y : C_TraceType); + pragma Import (C, traceC, "trace"); begin - null; + traceC (TraceAda_To_TraceC (x)); end Trace_On; - procedure Trace_Put (str : String) is - pragma Unreferenced (str); + -- 75. (12) A C function that takes a variable number of arguments can + -- correspond to several Ada subprograms, taking various specific + -- numbers and types of parameters. + + procedure Trace_Put (str : String) is + procedure tracef (format : char_array; s : char_array); + pragma Import (C, tracef, "_tracef"); + Txt : char_array (0 .. str'Length); + Length : size_t; + formatstr : constant String := "%s" & ASCII.NUL; + formattxt : char_array (0 .. formatstr'Length); begin - null; + To_C (formatstr, formattxt, Length); + To_C (str, Txt, Length); + tracef (formattxt, Txt); end Trace_Put; end Terminal_Interface.Curses.Trace;