First of all, there are no C functions that depend on Unix. C works fine on Windows, and it works fine on 8-bit microcontrollers.
As for the classic Mac OS, there were two main programming environments: Metrowerks CodeWarrior and Apple MPW.
CodeWarrior introduced a library called SIOUX, which opened a window and provided simple I / O. Any printf statements will print in this window. There are no pipelines or sockets, but this is not part of the C standard in any case (pipes are part of POSIX). Using SIOUX, you can port a simple program to Mac OS if it is stuck with portable C.
Apple MPW was another option. MPW provided a command line, a bunch of command-line programs (compilers for C, C ++, Pascal, assembly) and a "shells" dialog box to generate command-line arguments for programs. You can even use pipes, set environment variables, etc.
However, there were some significant differences in functionality between Unix and MPW. MPW had an excellent interface, but you could not run two command-line programs at the same time, even in the very trivial case when one of them pauses to start the other. This meant that the make program could not start the compiler. Instead, "make" generated a shell script that would run the compiler. Usually you have some kind of key combinator that runs make and then runs the resulting output as a shell script.
Now this seems to imply that the pipes will not work, but I think the pipes were just syntactic sugar for working with temporary files.
As far as I know, Xcode does not have an MPW legacy. Xcode comes from Project Builder, which was developed on NeXT, and NeXT has always been Unix. Apple has ported some of the older MPW command-line tools to OS X, but not so many. Big - Rez (and DeRez ). Since they come with the latest Xcode, I think someone is probably still using them. Rez headers are still around to get a blast from a past check: find /System/Library/Frameworks -name '*.r'
It seems like Apple really cleared its development website with something older than 10.6, which is a bit of a shame. Not so long ago, you can still find the old documentation before carbon, including the entire series "Inside Macintosh" on the Apple website. You also had the opportunity to get MPW from the Apple FTP site (it was free), and I still have downloads, but I don’t know if you can download it.
Keep in mind that you will need 10.4 (or earlier) and a PowerPC computer before you can even think about it, unless you succeeded in getting Sheep Shaver to work.
Funny tidbit, there were some funny error messages that the MPW C compiler could create.
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
source share