Dot Printer (code)
Volume Number: 5
Issue Number: 10
Column Tag: Advanced Mac'ing
Related Info: Printing Manager
Dot Matrix Printer Driver (code)
Listing: MPW MakeFile
# file is part of DMP-110 printer driver for the Macintosh
# series of computers.
# Earle R. Horton Wednesday, November 30, 1988
# Makefile for DMP-110 v1.0.
# This is the Makefile for use with MPW C, v 2.0.2.
CFLAGS = -g
.c.o .c
C {CFLAGS} {default}.c -o {default}.c.o
.a.o .a
Asm {default}.a -o {default}.a.o
DMP-110 PACK PDEF0 PDEF4 PDriver DMP-110.rsrc mpwfinal.r
Rez -o DMP-110 -c ‘Dmp1’ -t ‘PRER’ mpwfinal.r
SetFile DMP-110 -a B
DMP-110.rsrc DMP-110.rsrc.r makefile
rez -o DMP-110.rsrc -t ‘rsrc’ -c RSED DMP-110.rsrc.r
PACK MPWGlue.a.o pack.c.o
link MPWGlue.a.o pack.c.o ∂
-m PACKENTRY -d ∂
{libraries}interface.o -rt PACK=-4096 -sn Main=”Chooser
Device” ∂
-ss 100000 -o PACK -t ‘rsrc’ -c RSED
PDriver MPWGlue.a.o PDriver.c.o
link -m DriverEntry -d MPWGlue.a.o PDriver.c.o
{clibraries}cinterface.o ∂
{libraries}interface.o {clibraries}CRunTime.o
{clibraries}StdCLib.o ∂
-rt DRVR=-8192 -sn Main=.XPrint ∂
-ss 100000 -o PDriver -t ‘rsrc’ -c RSED
PDEF0 MPWGlue.a.o PDEF0.c.o
link -m PRINTENTRY -d MPWGlue.a.o PDEF0.c.o
{clibraries}cinterface.o ∂
{libraries}interface.o {clibraries}CRunTime.o ∂
{clibraries}StdCLib.o -sn Main=”Draft Printing Code” ∂
-rt PDEF=0 -ss 100000 -o PDEF0 -t ‘rsrc’ -c RSED
PDEF4 MPWGlue.a.o PDEF4.c.o
link -m DIALOGSENTRY -d MPWGlue.a.o PDEF4.c.o
{clibraries}cinterface.o ∂
{libraries}interface.o -sn Main=PrDialogs ∂
-rt PDEF=4 -ss 100000 -o PDEF4 -t ‘rsrc’ -c RSED
install DMP-110
duplicate -y DMP-110 “{ system folder}DMP-110”
clean
delete -i “{ system folder}testDMP-110” ∂
‘files -m 300 -t rsrc ;files -m 300 -t PRER;files -m 300 -t ‘OBJ
‘‘
PDEF0.c.o DMP-110.h
PDEF4.c.o DMP-110.h
PDriver.c.o DMP-110.h
pack.c.o DMP-110.h
Listing: compat.h
/* FILE is intended for use with MPW C 2.0 Interface files
* which generate InLine code for routines that call the
* ToolBox with points by value & strings as Pascal strings.
* It should be included AFTER any Macintosh #include files.
* See Appendix H of the MPW C 2.0 manual for details.
* file allows use of MPW C 2.0 standardized ToolBox calls
* using spelling from Inside Macinstosh, and not all upper
* case, as is used in MPW C 2.0 header files. Please note
* that use of this means that you no longer have access
* to the C-language versions of the ToolBox calls.
* It is rumored that this file will no longer be necessary
* with MPW C 3.0. (?)
* If you like to pass C strings to ToolBox, do NOT include
* this FILE. */
#ifdef MPU68000 /* Aztec C, v 3.6c. */
/* -D_INLINE on cc’s command line is all that’s required. */
#else
#define NewControl NEWCONTROL
#define SetCTitle SETCTITLE
#define GetCTitle GETCTITLE
#define DragControl DRAGCONTROL
#define TestControl TESTCONTROL
#define TrackControl TRACKCONTROL
#define FindControl FINDCONTROL
#define OpenDeskAcc OPENDESKACC
#define FindDItem FINDDITEM
#define NewDialog NEWDIALOG
#define ParamText PARAMTEXT
#define GetIText GETITEXT
#define SetIText SETITEXT
#define NewCDialog NEWCDIALOG
#define GetVol GETVOL
#define SetVol SETVOL
#define UnmountVol UNMOUNTVOL
#define Eject EJECT
#define FlushVol FLUSHVOL
#define Create CREATE
#define FSDelete FSDELETE
#define FSOpen FSOPEN
#define OpenRF OPENRF
#define Rename RENAME
#define GetFInfo GETFINFO
#define SetFInfo SETFINFO
#define SetFLock SETFLOCK
#define RstFLock RSTFLOCK
#define GetFontName GETFONTNAME
#define GetFNum GETFNUM
#define LCellSize LCELLSIZE
#define LClick LCLICK
#define LNew LNEW
#define NewMenu NEWMENU
#define AppendMenu APPENDMENU
#define SetItem SETITEM
#define GetItem GETITEM
#define InsMenuItem INSMENUITEM
#define MenuSelect MENUSELECT
#define EqualString EQUALSTRING
#define RelString RELSTRING
#define UprString UPRSTRING
#define DIZero DIZERO
#define NumToString NUMTOSTRING
#define StringToNum STRINGTONUM
#define SFPutFile SFPUTFILE
#define SFPPutFile SFPPUTFILE
#define SFGetFile SFGETFILE
#define SFPGetFile SFPGETFILE
#define IUDateString IUDATESTRING
#define IUDatePString IUDATEPSTRING
#define IUTimeString IUTIMESTRING
#define IUTimePString IUTIMEPSTRING
#define IUCompString IUCOMPSTRING
#define IUEqualString IUEQUALSTRING
#define DIBadMount DIBADMOUNT
#define DrawString DRAWSTRING
#define StringWidth STRINGWIDTH
#define StuffHex STUFFHEX
#define AddPt ADDPT
#define SubPt SUBPT
#define EqualPt EQUALPT
#define PtInRect PTINRECT
#define Pt2Rect PT2RECT
#define PtToAngle PTTOANGLE
#define PtInRgn PTINRGN
#define StdText STDTEXT
#define CreateResFile CREATERESFILE
#define OpenResFile OPENRESFILE
#define OpenRFPerm OPENRFPERM
#define GetNamedResource GETNAMEDRESOURCE
#define Get1NamedResource GET1NAMEDRESOURCE
#define GetResInfo GETRESINFO
#define SetResInfo SETRESINFO
#define AddResource ADDRESOURCE
#define GetAppParms GETAPPPARMS
#define OpenDriver OPENDRIVER
#define TEGetOffset TEGETOFFSET
#define TEGetPoint TEGETPOINT
#define TEClick TECLICK
#define NewString NEWSTRING
#define SetString SETSTRING
#define GetIndString GETINDSTRING
#define DeltaPoint DELTAPOINT
#define ShieldCursor SHIELDCURSOR
#define NewWindow NEWWINDOW
#define SetWTitle SETWTITLE
#define GetWTitle GETWTITLE
#define NewCWindow NEWCWINDOW
#define GrowWindow GROWWINDOW
#define DragWindow DRAGWINDOW
#define TrackGoAway TRACKGOAWAY
#define FindWindow FINDWINDOW
#define PinRect PINRECT
#define DragGrayRgn DRAGGRAYRGN
#define TrackBox TRACKBOX
#endif
Listing: DMP-110.h
/* Earle R. Horton.
* Wednesday, November 30, 1988
* All rights reserved.*/
#ifndef __DMP__
#define __DMP__
/* Define BACKWARD_COMPATIBLE to use printing glue,
* rather than _PrGlue trap. Penalty is about 2k size in
* final printer resource file.*/
#ifdef BACKWARD_COMPATIBLE
#include
#else
#include
#endif
#include
#include
#include
#include
#include