If you configure Ghostscript as a server rather than an interactive program, you will use gserver.c instead of gs.c . Each operator XXX is implemented by a procedure named z XXX, for example, zfill and zarray . See the makefile for a little more information on how the files are divided functionally. The main loop of the PostScript interpreter is the interp procedure in interp.c . The PDF interpreter is written entirely in PostScript.
Files beginning with gdev are device drivers or related code, also part of the library.
Other files beginning with g are library files that don't fall neatly into either the kernel or the driver category. See stream.h , scommon.h , and strimpl.h for all the details. In addition to many real device and file format drivers listed in devs.mak and contrib.mak , a number of drivers are used for internal purposes. There are very few platform dependencies in Ghostscript. The file arch.h contains a set of mechanically-discovered platform properties like byte order, size of int , etc.