_doscan
T. William Wells
bill at twwells.com
Sat Nov 11 06:33:01 AEST 1989
In article <20645 at mimsy.umd.edu> chris at 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 at twwells.com
More information about the Comp.unix.wizards
mailing list