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.8 required=5.0 tests=BAYES_00,INVALID_DATE, UPPERCASE_50_75 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,343551ac8a3d0216 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1993-03-05 20:55:58 PST Newsgroups: comp.lang.ada Path: sparky!uunet!wupost!howland.reston.ans.net!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!uchinews!ux1.cso.uiuc.edu!news.cso.uiuc.edu!ehsn4.cen.uiuc.edu!dl10696 From: dl10696@ehsn4.cen.uiuc.edu (Dat Trieu Le) Subject: Re: How do I "Get" just 4 characters? Date: Fri, 5 Mar 1993 05:45:18 GMT Message-ID: References: <9303041121.aa12530@Paris.ics.uci.edu> <1993Mar4.232013.6988@convex.com> Sender: usenet@news.cso.uiuc.edu (Net Noise owner) Organization: University of Illinois at Urbana Date: 1993-03-05T05:45:18+00:00 List-Id: >>I believe TEXT_IO works much like buffered input io. That is, >>it will read from the input buffer. the Get message reads from >>that buffer. If there is not enough characters in the buffer, >>then the program will wait until the user has completed its >>input to the buffer. Text_IO doesn't consider inputs to be complete >>until it is followed by a carriage-return. If you want Ada to >>interpret characters one-at-a-time, then a routine to interface >>to the hardware may have to be written. >> >>hope this helps. >package SET_TTY_MODES is > > procedure SET_CBREAK; > procedure UNSET_CBREAK; > >end SET_TTY_MODES; > >with TTY; >with OS_FILES; >with V_I_BITS; >with IOCTL; > >package body SET_TTY_MODES is > > STTY_STATE : TTY.TOTAL_STATE; > > procedure SET_CBREAK is > begin > TTY.GET_TTY_STATE(FD => OS_FILES.STDIN_FD, STATE => STTY_STATE); > STTY_STATE.U_TTY_STATE.SG_FLAGS := SHORT_INTEGER( > V_I_BITS.BIT_OR( > INTEGER(STTY_STATE.U_TTY_STATE.SG_FLAGS), > IOCTL.CBREAK)); > TTY.SET_TTY_STATE(FD => OS_FILES.STDIN_FD, STATE => STTY_STATE); > end SET_CBREAK; > > procedure UNSET_CBREAK is > begin > TTY.GET_TTY_STATE(FD => OS_FILES.STDIN_FD, STATE => STTY_STATE); > STTY_STATE.U_TTY_STATE.SG_FLAGS := SHORT_INTEGER( > V_I_BITS.BIT_AND( > INTEGER(STTY_STATE.U_TTY_STATE.SG_FLAGS), > V_I_BITS.BIT_NEG(IOCTL.CBREAK))); > TTY.SET_TTY_STATE(FD => OS_FILES.STDIN_FD, STATE => STTY_STATE); > end UNSET_CBREAK; > >end SET_TTY_MODES; Hi, what does this package do?