comp.lang.ada
 help / color / mirror / Atom feed
From: "martin.m.dowie" <martin.m.dowie@ntlworld.com>
Subject: Re: redirecting the standard output
Date: Thu, 12 Apr 2001 20:52:49 +0100
Date: 2001-04-12T20:52:49+01:00	[thread overview]
Message-ID: <3AD60791.AA7CDCB@ntlworld.com> (raw)
In-Reply-To: 9b4cfn$s6j7@cui1.lmms.lmco.com

yes, the other 'trick' I had to do was get the std_in/std_out constants the right
way round (which managed to throw me for an hour!) ;-)

Smark wrote:

> So the trick was to use VxWorks' "open" and "ioGlobalStdSet" rather than
> Ada.Text_Io's "Open" and "Set_Output" ... interesting.
>
> Mark
>
> "Martin Dowie" <martin.dowie@gecm.com> wrote in message
> news:3ad59c42$1@pull.gecm.com...
> > Cheers Graham! That's done the trick!
> >
> > And in return to the community here is the Ada equivilant we will
> > be using (feel free to add your own comments :-)
> >
> >
> > -- vxworks.ads
> > --------------
> > with Interfaces.C;
> >
> > package VxWorks is
> >
> >   subtype A_Status is Interfaces.C.Int;
> >
> >   use type A_Status;
> >
> >   Ok    : constant A_Status :=  0;
> >   Error : constant A_Status := -1;
> >
> > end VxWorks;
> >
> > -- vxworks-iolib.ads
> > --------------------
> > with Interfaces.C;
> > with Interfaces.C.Strings;
> >
> > package VxWorks.ioLib is
> >
> >    O_RDONLY : constant := 16#0000#;
> >    O_WRONLY : constant := 16#0001#;
> >    O_RDWR   : constant := 16#0002#;
> >    O_CREAT  : constant := 16#0200#;
> >
> >    subtype A_File is Interfaces.C.Int;
> >
> >    function Open (Name  : Interfaces.C.Strings.Chars_Ptr;
> >                   Flags : Interfaces.C.Int;
> >     Mode  : Interfaces.C.Int) return A_File;
> >
> >    function Close (File : A_File) return A_Status;
> >
> >    STD_IN  : constant A_File := 0;
> >    STD_OUT : constant A_File := 1;
> >    STD_ERR : constant A_File := 2;
> >
> >    function ioGlobalStdGet (StdFd : A_File) return A_File;
> >
> >    procedure ioGlobalStdSet (StdFd : A_File;
> >                              NewFd : A_File);
> >
> >    function ioTaskStdGet (TaskId : Interfaces.C.Int := 0;
> >      StdFd : A_File) return A_File;
> >
> >    procedure ioTaskStdSet (TaskId : Interfaces.C.Int := 0;
> >       StdFd : A_File;
> >                            NewFd : A_File);
> >
> > private
> >
> >    pragma Import (C, Open,           "open");
> >    pragma Import (C, Close,          "close");
> >    pragma Import (C, ioGlobalStdGet, "ioGlobalStdGet");
> >    pragma Import (C, ioGlobalStdSet, "ioGlobalStdSet");
> >    pragma Import (C, ioTaskStdGet,   "ioTaskStdGet");
> >    pragma Import (C, ioTaskStdSet,   "ioTaskStdSet");
> >
> > end VxWorks.ioLib;




      reply	other threads:[~2001-04-12 19:52 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-10 14:32 redirecting the standard output Martin Dowie
2001-04-10 15:01 ` redirecting the standard output to different std outputs? Frank
2001-04-10 16:17   ` Mark Biggar
2001-04-10 20:38     ` James Rogers
2001-04-13 16:23   ` Tucker Taft
2001-04-10 16:08 ` redirecting the standard output Stephen Leake
2001-04-10 16:46   ` Stephen Leake
2001-04-10 17:13     ` Smark
2001-04-10 21:00   ` Ted Dennison
2001-04-11  7:32   ` Martin Dowie
2001-04-11 12:04     ` Stephen Leake
2001-04-11 14:15       ` Martin Dowie
2001-04-12  1:41     ` tmoran
2001-04-12  7:08       ` Martin Dowie
2001-04-10 16:46 ` Smark
2001-04-11 12:06   ` Stephen Leake
2001-04-11 14:11     ` Martin Dowie
2001-04-11  0:04 ` Jeff Creem
2001-04-11  9:48 ` Graham Baxter
2001-04-12 12:23   ` Martin Dowie
2001-04-12 14:01     ` Smark
2001-04-12 19:52       ` martin.m.dowie [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox