[comp.unix.wizards] _doscan

jp27+@andrew.cmu.edu (Jacques Parker) (11/09/89)

Could someone send me the specifications for _doscan.

(What it returns & what arguments it takes.)

			thank you
			Jacques

Address: internet	jp27+@andrew.cmu.edu, 
	 uucp		...!{harvard,uunet}!andrew.cmu.edu!jp27,
         bitnet		jp27%andrew@cmccvb.bitnet.

chris@mimsy.umd.edu (Chris Torek) (11/09/89)

In article <21404@adm.BRL.MIL> jp27+@andrew.cmu.edu (Jacques Parker) writes:
>Could someone send me the specifications for _doscan.
>(What it returns & what arguments it takes.)

It has none.  It is an internal routine which may not (read: does not)
exist in future (read: present) implementations.

Using _doscan in code that is not part of the stdio library is, to
paraphrase Dennis Ritchie, `unwarranted chumminess with the implementation'.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@cs.umd.edu	Path:	uunet!mimsy!chris

bill@twwells.com (T. William Wells) (11/11/89)

In article <20645@mimsy.umd.edu> chris@mimsy.umd.edu (Chris Torek) writes:
: Using _doscan in code that is not part of the stdio library is, to
: paraphrase Dennis Ritchie, `unwarranted chumminess with the implementation'.

That, I'm afraid, is going to require me to completely rewrite one
of my favorite little utilites:

	scanprt [options] <scanf-string> <printf-string>

with a few useful options (controlling whether the scanf is
fgets/sscanf or scanf, whether the printf has a newline after it,
etc.)

I wrote it way back when for blank filling in some shell scripts,
as in: scanprt %s %-10s. I've used it as a stage in a cheap
binary editor: hd file >somewhere; <edit>; cut -c9-56 somewhere |
scanprt -n -l0 %x %c >file.new. I've used it for number
conversions, e.g., on the output of cmp -l: cmp -l foo bar |
scanprt %d%o%o '%X %X %X', etc.

Oh well, the internals of that thing are ugly anyway. I suppose
it was time for a rewrite. :-)

---
Bill                    { uunet | novavax | ankh | sunvice } !twwells!bill
bill@twwells.com