From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,cf51ba4ee213baa4,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews2.google.com!not-for-mail From: jsuarezrivaya@yahoo.es (Jorge Suarez-Solis Rivaya) Newsgroups: comp.lang.ada Subject: adaflorist Date: 2 Jul 2004 01:28:45 -0700 Organization: http://groups.google.com Message-ID: <61f665c0.0407020028.39bca9d2@posting.google.com> NNTP-Posting-Host: 81.9.162.127 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1088756930 10773 127.0.0.1 (2 Jul 2004 08:28:50 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 2 Jul 2004 08:28:50 +0000 (UTC) Xref: g2news1.google.com comp.lang.ada:2042 Date: 2004-07-02T01:28:45-07:00 List-Id: I have a problem with the adaflorist posix binding, I have a program witch code is this: ------------------------------------------------------------------------------ with Ada.Text_IO; with POSIX, POSIX_IO; with Interfaces.C; --with Tareas; procedure pruebaflorist is -- TIPOS type fildes_pair is array (1 .. 2) of POSIX_IO.File_Descriptor; --task type A (fdr: POSIX_IO.File_Descriptor, fdw: POSIX_IO.File_Descriptor, Buffer : POSIX_IO.IO_Buffer(1..4096)); -- DECLARACIONES Audio_Fd : POSIX_IO.File_Descriptor; mp3 : POSIX_IO.File_Descriptor; fin : Interfaces.C.Int; Buffer1 : POSIX_IO.IO_Buffer(1..4096); Buffer2 : POSIX_IO.IO_Buffer(1..4096); Last : POSIX.IO_Count; fildes : fildes_pair; -- IMPORTACIONES function Open_Driver (start: in POSIX_IO.File_Descriptor) return Interfaces.C.Int; pragma import(C,Open_Driver,"open_sound_device"); begin -- abrimos ficheros mp3 := POSIX_IO.open("c.raw",POSIX_IO.Read_Only); Audio_Fd := POSIX_IO.open("/dev/dsp",POSIX_IO.Write_Only); fin := Open_Driver(Audio_Fd); -- abrimos pipe POSIX_IO.Create_Pipe(fildes(1),fildes(2)); declare task A; task B; task body A is begin loop POSIX_IO.read(mp3,Buffer1,Last); POSIX_IO.write(fildes(2),Buffer1,Last); Ada.Text_IO.Put_Line("Tarea A"); end loop; end A; task body B is begin loop POSIX_IO.read(fildes(1),Buffer2,Last); POSIX_IO.write(Audio_Fd,Buffer2,Last); Ada.Text_IO.Put("Tarea B"); end loop; end B; begin Ada.Text_IO.Put_Line("Programa principal, esperando ..."); -- exception -- when Ada.Text_IO.End_Error => Ada.Text_IO.Put_Line("Terminamos"); end; -- bloque declare POSIX_IO.close(mp3); POSIX_IO.close(Audio_Fd); --exception -- when Ada.Text_IO.End_Error => Ada.Text_IO.Put_Line("Terminamos"); end pruebaflorist; -------------------------------------------------------------------------- It compiles perfectly, but I cant link it, I did it months ago but dont remember how, if someone could help ... I think is because some flag but I'm not sure. thanks Jorge Suarez-Solis Rivaya