[comp.sys.mac.programmer] PAP routine assistance? Also, LSC in-line assembly

gf0c+@andrew.cmu.edu (Gregory S. Fox) (06/04/90)

Howdy,

     I'm porting an LPD server from Think C to C++, and I could use a
bit of advice.  The heart of the original program was based loosely on
PSPrint, which I believe originally appeared in MacTutor, and was
written in LSC.  Everything is pretty straightforward, but several
of the PAP routines [open, read, write, status, close, unload]
use LSC's in-line assembler.  The trick is that you can use your
C variables in the in-line code.  There is no corresponding utility in
MPW, unfortunately, and I'm a little weak in the assembly language
department.

     My solution for this is to write the routines in MPW assembly,
and leave a global space for all the PAP parameters that have to be
shuffled around  [eg- pointer to the Laserwriter name, etc], then
stuff them in from C by virtue of knowing their offsets relative to
the start of the code segment.  Same thing for the return values.

     Is this workable?  Are there better interfaces to the PAP
routines? Am I missing something terribly obvious?

Thanks,
--Greg
gf0c@andrew.cmu.edu