Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ames!umd5!brl-adm!adm!gregg@a.cs.okstate.edu From: gregg@a.cs.okstate.edu (Gregg Wonderly) Newsgroups: comp.unix.wizards Subject: Re: Input Line Editing Message-ID: <16560@brl-adm.ARPA> Date: 19 Jul 88 21:03:51 GMT Sender: news@brl-adm.ARPA Lines: 28 >? From: Gregg Wonderly > >? I just solved that problem here by writing a KSH style history and >? command line editor subroutine that is called gets(). > >As you no doubt already know, there is already a function named gets(). >How about choosing another name? By calling it gets(), I can just link it with existing applications. Since it IOCTL's fd 0 to turn on 'cbreak' mode, it can detect non-terminal input streams when the IOCTL fails, and then switch to normal gets() processing. Normally, I refrain from calling functions the same as library routines, but when they mimick them exactly, and there is nothing outwardly visible to the code (i.e. external variables or support function calls) then I see no reason not to. Exactly is, I guess, a sorta relative word, but I just hate to do a bunch of editing that might break a program, or otherwise make it out of sync with source distributions. The tons of different malloc(3)'s are a great example of why someone might name a routine the same as a library routine when it does the same thing, just differently... Gregg Wonderly Department of Computing and Information Sciences Oklahoma State University UUCP: {cbosgd, ihnp4, rutgers}!okstate!gregg Internet: gregg@A.CS.OKSTATE.EDU