In the beginning...

In the beginning, I'd begin each project by creating a new directory, typing e main.c, and entering the code (e is a custom version of vi that I use). Then it hit me that a lot of the stuff that occurs at the beginning of a new project is always the same. You need:

For projects dealing with a resource manager (introduced in the previous book), other common parts are required:

This resulted in two simple scripts (and associated data files) that create the project for me: mkmain and mkresmgr (see Threaded Resource Managers, below). You invoke them in an empty directory, and they un-tar template files that you can edit to add your own specific functionality.

You'll see this template approach throughout the examples in this book.