Initial commit

This commit is contained in:
Folkert Kevelam 2025-06-10 21:36:18 +02:00
parent 1a93dddd38
commit 115d30ade1

View File

@ -0,0 +1,44 @@
with Ada.Text_IO; use Ada.Text_IO;
with Interfaces.C;
with Interfaces.C.Strings; use Interfaces.C.Strings;
with Interfaces.C_Streams; use Interfaces.C_Streams;
procedure Personal_Finance_Tool is
type NCDirect_Struct is null record with Convention => C;
type NCDirect is access NCDirect_Struct
with Convention => C;
function Init return NCDirect is
function NCDirect_Init( Term_Type : Chars_Ptr; FP : FILEs ) return NCDirect
with Import, Convention => C, External_Name => "ncdirect_init";
begin
return NCDirect_Init( NULL_Ptr , stdout );
end Init;
function NC_Stop( NC : NCDirect ) return Interfaces.C.Int
with Import, Convention => C, External_Name => "ncdirect_stop";
function FG_RGB( NC : NCDirect; RGB : Interfaces.C.Int ) return Interfaces.C.Int
with Import, Convention => C, External_Name => "ncdirect_set_fg_rgb";
Handle : NCDirect := Init;
begin
if Handle = null then
Put_Line("Cannot open notcurses connection");
end if;
Put_Line(FG_RGB(Handle, 16#e539dc#)'Image);
Put_Line("Hello, World!");
Put_Line(NC_Stop(Handle)'Image);
end Personal_Finance_Tool;