Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!usc!apple!ames!haven!mimsy!chris From: chris@mimsy.umd.edu (Chris Torek) Newsgroups: comp.unix.questions Subject: Re: printf implementation again Message-ID: <22267@mimsy.umd.edu> Date: 3 Feb 90 20:36:32 GMT References: <29039@amdcad.AMD.COM> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 29 In article <29039@amdcad.AMD.COM> srini@diablo.amd.com writes: >Does vprintf call _doprnt? From what I have found so far, _doprnt >is called, _flsbuf is called to flush buffer, and a memory copy >(memcpy) is done to copy from buffer to file. If you were to trace my stdio, you would see: 1. printf/fprintf/sprintf 2. vfprintf 3. __spstr (someday, a static symbol) 4. (if buffer fills) __swrite + write You would also find that there is no function called `_doprnt'. >If all these are implementation dependent, then let me rephrase my >original question. What are the factors that are assumed or >considered to implement printf or in the already existing printf >implementation(s)? All the details are implementation dependent: I suspect neither __spstr nor __swrite appear in any other stdio, nor will I say what their call sequence is. In my implementation, vfprintf() (with funopen(), a new function that opens functions to do I/O) gives you everything you need. The factors that are assumed and considered are those outlined in the ANSI standard or the SVID or some other applicable standard. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@cs.umd.edu Path: uunet!mimsy!chris