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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b2077f5b728fb9af X-Google-Attributes: gid103376,public X-Google-Thread: 114c38,b2077f5b728fb9af X-Google-Attributes: gid114c38,public X-Google-ArrivalTime: 2001-04-12 13:06:18 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.gv.tsc.tdk.com!hub.org!hub.org!newsfeed.wirehub.nl!news.maxwell.syr.edu!newsfeed.icl.net!newspeer.clara.net!news.clara.net!dispose.news.demon.net!demon!btnet-peer0!btnet!news5-gui.server.ntli.net!ntli.net!news6-win.server.ntlworld.com.POSTED!not-for-mail Message-ID: <3AD60791.AA7CDCB@ntlworld.com> From: "martin.m.dowie" Reply-To: martin.m.dowie@ntlworld.com X-Mailer: Mozilla 4.76 [en] (Win95; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada,comp.os.vxworks Subject: Re: redirecting the standard output References: <3ad31759$1@pull.gecm.com> <3AD42861.A6C58874@NOSPAM.bcs.org.uk> <3ad59c42$1@pull.gecm.com> <9b4cfn$s6j7@cui1.lmms.lmco.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Thu, 12 Apr 2001 20:52:49 +0100 NNTP-Posting-Host: 62.252.136.157 X-Complaints-To: abuse@ntlworld.com X-Trace: news6-win.server.ntlworld.com 987105400 62.252.136.157 (Thu, 12 Apr 2001 20:56:40 BST) NNTP-Posting-Date: Thu, 12 Apr 2001 20:56:40 BST Organization: ntlworld News Service Xref: supernews.google.com comp.lang.ada:6838 comp.os.vxworks:6457 Date: 2001-04-12T20:52:49+01:00 List-Id: 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" 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;