First of all, there are no C features that are dependent on Unix. C runs just fine on Windows, and it runs just fine on 8-bit microcontrollers.
As for classic Mac OS, there were two primary programming environments: Metrowerks CodeWarrior and Apple's MPW.
CodeWarrior came with a library called SIOUX which opened up a window and provided simple I/O. Any printf
statements would print to this window. There's no piping or sockets, but that's not part of the C standard anyway (pipes are a part of POSIX). Using SIOUX, you could port a simple program to Mac OS as long as it stuck to portable C.
Apple's MPW was the other option. MPW provided a command line, a bunch of command-line programs (compilers for C, C++, Pascal, assembly), and dialog box "shells" for generating command line arguments to the programs. You could even use pipes, set environment variables, et cetera.
There were, however, some major differences in functionality between Unix and MPW. MPW had a great interface, but you could not run two command line programs simultaneously, not even in the very trivial case where one is suspended to run the other. This meant that the "make" program couldn't run the compiler. Instead, "make" generated a shell script which would run the compiler. You'd typically have some kind of keyboard shortcut that would run "make" and then run the resulting output as a shell script.
Now, this seems to imply that pipes wouldn't work, but I think pipes were just syntactic sugar for working with temporary files.
Xcode has no MPW heritage, as far as I know. Xcode derives from Project Builder which was developed at NeXT, and NeXT was always Unix. Apple ported some of the old MPW command-line tools to OS X, but not many. The big one is Rez
(and DeRez
). Since they're shipped with the latest Xcode, I guess somebody is probably still using them. The Rez headers are still around, to get a blast from the past check out:
find /System/Library/Frameworks -name '*.r'
It seems like Apple has really scrubbed their development website of anything older than 10.6, which is a bit of a shame. Not too long ago you could still find the old pre-Carbon documentation, including all of the "Inside Macintosh" series on Apple's website. You also used to be able to get MPW from Apple's FTP site (it was free), and I still have the downloads, but I don't know if you can still download it.
Mind you, you'll need 10.4 (or earlier) and a PowerPC computer before you can even consider playing around with this, unless you've somehow managed to get Sheep Shaver working.
Funny tidbit, there were some funny error messages that MPW's C compiler could produce.
a typedef name was a complete surprise to me at this point in your program
You can't modify a constant, float upstream, win an argument with the IRS, or satisfy this compiler
...And the lord said, 'lo, there shall only be case or default labels inside a switch statement'
type in (cast) must be scalar; ANSI 3.3.4; page 39, lines 10-11 (I know you don't care, I'm just trying to annoy you)
Call me paranoid but finding '/*' inside this comment makes me suspicious
Symbol table full - fatal heap error; please go buy a RAM upgrade from your local Apple dealer
Too many errors on one line (make fewer)
This label is the target of a goto from outside of the block containing this label AND this block has an automatic variable with an initializer AND your window wasn't wide enough to read this whole error message
we already did this function