PDDR/2 - The 42XX Rasterizing Driver

Reprint Courtesy of International Business Machines Corporation, © International Business Machines Corporation =The 42XX Rasterizing Driver= The 42XX printer driver is a rasterizing driver for Lexmark's 42XX family of printers. It supports the following printer models:
 * IBM 4201 Proprinter Model 1 (4201-001)
 * IBM 4201 Proprinter Model 2 (4201-002)
 * IBM 4201 Proprinter Model 3 (4201-003)
 * IBM 4202 Proprinter XL Model 1 (4202-001)
 * IBM 4201 Proprinter II XL Model 2 (4202-002)
 * IBM 4201 Proprinter III XL Model 3 (4202-003)
 * IBM 4201 Proprinter X24 Model 1 (4207-001)
 * IBM 4201 Proprinter X24E Model 2 (4207-002)
 * IBM 4201 Proprinter XL24 Model 1 (4208-001)
 * IBM 4201 Proprinter XL24E Model 2 (4208-002)
 * IBM 4224 - C2 (Color)
 * IBM 4224 - O1, O2, E3 (Mono)
 * IBM 2380 Personal Printer Series II (9-narrow)
 * IBM 2381 Personal Printer Series II (24-wide)
 * IBM 2390 Personal Printer Series II (24-narrow)
 * IBM 2391 Personal Printer Series II (24-wide)
 * IBM 4226 Model 302

Features of the 42XX Driver
The 42XX driver hooks a number of graphics engine (Gre) functions. Its main features include banding, color support for the IBM 4224 Color printer, and support for system fonts and some device fonts. Each of these features is described in the following sections.

Functions Exported and Hooked by the Driver
The following table shows the functions that are exported by the driver.

Banding
The 42XX driver resorts to banding when sufficient memory is not available for the entire page bit map. The driver uses Gre journaling functions for banding.

The driver initially tries to acquire memory for one band, which is the size of the entire page. If this fails, the driver successively tries incrementing the number of bands for the page bit map until the request for memory succeeds. The minimum band size supported is 64KB. If a request for 64KB of memory fails, the driver returns an error to the application.

Banding is then implemented as follows for each page in the job:
 * The driver creates a bit map for the first band and asks the graphics engine to start journaling.
 * The presentation driver interface routines then draw into this band, clipping as necessary.
 * When the page is completed (indicated by a NewFrame or BeginCloseDC call), the journaling is stopped and the printer control component outputs the band to the printer.
 * When the first band has been output, it is discarded and a bit map for the second band is created. The journal is then played back to draw those parts of the picture that fall within the second band. This step is repeated until all the bands have been processed and the entire page has been printed.

Color
The physical color table is used for the band and other internal bit maps. All internal bit maps are held in 1bpp format for mono printers and in 4bpp format for the 4224 color printer. However, the top bit is ignored when raster data is sent to the printer, leading to support for 8 colors for the 2424 Color printer. The physical color tables used by the driver are as follows:

!Mono printers !4224 Color Printer The driver uses the following types of color conversion methods to move a pel between a source and target bit map or to draw into a target bit map.
 * 0||Black
 * 1||White
 * 1||White
 * 1||White
 * 0||Black
 * 1||Blue
 * 2||Red
 * 3||Magenta
 * 4||Green
 * 5||Cyan
 * 6||Yellow
 * 7||White
 * }
 * 4||Green
 * 5||Cyan
 * 6||Yellow
 * 7||White
 * }
 * 7||White
 * }
 * }

Bit-Map Conversion Functions
The driver supports conversion between any of the standard external formats (1bpp, 4bpp, 8bpp and 24bpp) to the internal bit map format, which is 1bpp for mono and 4bpp for the 4224 Color printer. The functions GetBitmapBits, SetBitmapBits, DeviceCreateBitmap and DeviceDeleteBitmap use a nearest color mapping method, which is based on the square of the distance between the points that two colors represent in RGB space. For 1bpp target bit maps, the driver uses a threshold value of 384 for (R+G+B). Any value above this threshold maps to white and any value below maps to black.

BitBlt
The Bitblt uses the nearest color mapping method except when:
 * The blt is from a mono memory bit map to a mono band; and
 * The memory bit map was created by a DeviceCreateBitmap call which asked for a color bit map, not a mono bit map.

In this case, the source bits are mapped as follows:
 * Source 0 bits map to the background color of the target image bundle.
 * Source 1 bits map to the foreground color of the target image bundle.

Drawing Functions
Drawing functions use the nearest color mapping method when drawing into a color bit map or band. When drawing into a mono bit map or band, they use the following method:
 * If the source is white, draw the pel in white.
 * If the source is black, draw the pel in black.

Grey Scaling
The driver uses a grey scaling technique when all of the following conditions are met:
 * The current printer is a mono printer.
 * An application is drawing (into the band or a memory bit map) using a Bitblt or PolyScanLine call with any raster operation(ROP) in which the source bit map is not involved.
 * The pattern set and symbol in the pattern bundle attributes are the default values (for example, solid fill pattern in the default pattern set).

The drawing is then completed using a pattern copy ROP and one of 65 grey scale patterns. These are mono patterns with a width and height of 8; the number of bits set to onranges from 0 to all 64. The pattern is drawn with on bits as black and off bits as white. The pattern used is always 8x8, regardless of the current resolution.

The foreground color from the pattern bundle attributes is used to determine which one of these 65 grey scale patterns to use. A grey scale value is calculated from the R, G, and B components using weighting factors as follows:

((59 x G) + (27 x R) + (14 x B)) Grey scale value =  -- 100

The resulting grey scale value will lie between 0 and 255. This range is then translated into an index value within the range of 0 to 64 and this index value is then used to extract a grey scale pattern from the grey scale pattern table that represents the grey scale value, as follows:

!Value||Pattern
 * 0||64 bits set on (completely black)
 * 1 to 3||63 bits set on
 * 4 to 7||62 bits set on
 * 248 to 251||1 bit set on
 * 252 to 256||0 bits set on (completely white)
 * }
 * 248 to 251||1 bit set on
 * 252 to 256||0 bits set on (completely white)
 * }
 * 252 to 256||0 bits set on (completely white)
 * }

Text
The 42XX driver supports two types of fonts: engine (system) fonts and device (printer) fonts. Engine fonts are owned by the Presentation Manager while device fonts are owned by the printer. Both of these types may be image (bit mapped) or outline (vector) fonts.

Engine Fonts
The 42XX driver supports image and outline engine fonts. The fonts available to the driver depend on the fonts that have been installed from the Control Panel.

Device Fonts
Device fonts are classified into the following categories:
 * Resident Fonts:Resident fonts are those that are defined in the printer ROM.
 * Downloadable Codepage Fonts:A downloadable code page consists of a set of fonts, each having the same code page, that can be downloaded into printer RAM.
 * Card or Cartridge Fonts:Some printers have slots for cards or cartridges that contain multiple fonts to be plugged into. In these cases, the corresponding screen font must be installed so that the display output matches printer output.
 * Download Fonts:Download fonts are single fonts that can be downloaded into printer RAM.

The IBM 42XX driver supports resident and downloadable code-page fonts.

42XX Job States
The 42XX driver has six states for a print job. These are affected by the following actions: The six job states are: The initial state, after CompleteOpenDC, is IMPLICIT. The following table shows the possible states of a print job, based on incoming calls to 42XX subfunctions. The actions of the driver are defined after the table. Numbers that appear before the action codes is the initial state after the subfunction. A "-" signifies no state change. The actions found in the table are defined below:
 * Enable subfunctions CompleteOpenDC and BeginCloseDC.
 * DevEscape subfunctions StartDoc, EndDoc, NewFrame, AbortDoc, and RawData.
 * User selecting CANCEL from a message box when printing a job.
 * Drawing operations.
 * WAIT_START Waiting for a StartDoc or BeginCloseDC; the application cannot do any drawing yet.
 * IMPLICIT Initial state after a CompleteOpenDC.
 * EXPLICIT During a 'proper' document (one that will not give an abort signal.
 * PURGE PrtOpen or PrtWrite failed and CANCEL was selected by the user from message box displayed by the driver.
 * RAW_IMPLICIT Implicit state, after RawData issued.
 * RAW_EXPLICIT Explicit state, after RawData issued.
 * ERR:Return ERROR to the application.
 * OK:Return OK to the application.
 * A:1.Set up the default attributes and the default font.
 * 2.Then,
 * If a Queued DC, call SplQmOpen.
 * If a Queued STD DC, call SplSTDOpen.
 * If not a Queued STD DC, prepare for the new document in the following way:
 * a.Set up the form, band, and default clips.
 * b.Set the number of download fonts to 0.


 * B1:If a Queued DC, call SplQmClose.
 * If a Queued STD DC, call SplSTDCLose.


 * B2:If not a Queued STD DC, print the (last) page.
 * If a Queued DC, call SplQmClose.
 * If a Queued STD DC, call SplSTDClose.


 * B3:1.Print the (last) page.
 * 2.Then,
 * If a Queued DC, call SplQmClose.
 * If a Queued STD DC, call SplSTDClose.


 * C1:1.Set the DC data to default values.
 * 2.Prepare for the new document as follows:
 * a.Set up the form, band and default clips.
 * b.Set the number of download fonts to 0.
 * 3.Set up the document name.
 * 4.Then,
 * If a Queued DC, call SplQmStartDoc.


 * C2:If not a Queued STD DC, print the last page.
 * 1.Set the DC data to default values.
 * 2.Prepare for the new document as follows:
 * a.Set up the form, band, and default clips.
 * b.Set the number of download fonts to 0.
 * 3.Set up the document name.
 * If a Queued DC, call SplQmStartDoc.


 * C3:If Aborted Flag is set, complete the following actions:
 * 1.Call PrtAbort if the function is available.
 * 2.Send zeroes to printer to flush the raster command.
 * 3.Perform action C1.
 * Otherwise, return ERROR to the application.


 * D1:If a Queued STD DC, return ERROR to the application.
 * Otherwise, print the last page.


 * D2:Print the last page.
 * E1:If a Queued STD DC then return ERROR to the application.
 * Otherwise, complete the following actions:
 * 1.Print the page.
 * 2.Increment the page number.
 * 3.Set up the form, bands, and default clips for the next page.
 * 4.Set the number of download fonts used to 0.


 * E2:1.Print the page.
 * 2.Increment the page number.
 * 3.Set up the form, bands, and default clips for the next page.
 * 4.Set the number of download fonts used to 0.


 * F:1.Set the Aborted Flag.
 * 2.Then,
 * If a direct DC, return OK to the application
 * Otherwise, complete the following actions:
 * a.Wait for standard thread.
 * b.Do tidy up abort processing.
 * c.Return OK to application.


 * G:1.Call PrtAbort if the function is available.
 * 2.Close the printer.
 * 3.Perform clean up abort processing.


 * H1:If a Direct DC, open the printer.
 * Otherwise, call SplQmStartDoc.
 * 1.Send initializing escape sequences.
 * 2.Send escape sequences to set the default font.
 * 3.Send RawData to the spool file or printer.


 * H2:1.Send initializing escape sequences.
 * 2.Send escape sequences to set the default font.
 * 3.Send RawData to the spool file or printer.


 * J:Continue with drawing function.

42xx Modules and Functions
This section provides a layout of the 42XX rasterizing driver source code included on the DDK CD-ROM. Refer to the "Using Your DDK", also available on the DDK CD, for a roadmap of the file structure used by the 42XX source code.

The first part of this section lists all functions of 42XX in alphabetical order. The module in which each function is found is listed next to the function.

The second part of this section lists the modules that comprise 42XX and the functions that comprise each module. Each function is followed by a description.

Module and Function Descriptions
This section describes the modules that comprise the 42XX Rasterizing driver and the functions that comprise each module. Each function is followed by a description. The functions in each module are listed in alphabetical order.

ASMUTILS.ASM
This module contains utility functions.
 * Prdu_bitcopy:Copies bits of data from the source to the target.
 * Prdu_createraster:Creates a vertical raster from the buffer.
 * Prdu_dwordset:Sets the supplied Dword into the bit map count times.
 * Prdu_mergeraster:Merges OutputBuffer1 and OutputBuffer2 into OutputBuffer3.
 * Prdu_writerow:Writes Dwords into the buffer.

BITMOUT.ASM
This module contains functions that scan and output the bit map.
 * Prdp_OutputRules:Scans the bit map from top to bottom for a nonzero byte.
 * Search_down:Performs a search down function.

FONTXFRM.ASM
This module contains functions that transform the font metrics.
 * Big_fix_square_root:Approximates the square root of BIGFIXED.
 * Far_get_sqr_determinant:Finds the square root of the determinant of input parameters.
 * Far_get_vector_length:Finds the length of a vector in an array of vectors.
 * Get_vector_length:Finds the length of a vector in an array of vectors.
 * Perform_rip:Passes a given error message to WinSetErrorInfo.
 * Square_root:Computes the fixed square root of a fixed point integer using Newton's method.
 * UlNormalize:Normalizes a ULONG so that the highest order bit is 1.
 * UqNormalize:Normalizes an unsigned quadword so that the highest order bit is 1.
 * Xform_metrics:Transforms the font metrics.

NEWBMPS.C
This module contains functions that handle the bit map functions.
 * CompDeCompBull:Handles calls from createbitmap and getsetbitmapbits.
 * Prdn_DeviceCreateBitmap:Creates the bit map.
 * Prdn_GetSetBitmapBits:Sets the bit map bits.

PRD42SR2.C
This module contains functions that handle outputs to the printer.
 * Prda_ConvertOld42XXMatch:Converts old 42XX match number into current match number.
 * Prda_GetNewMatchNumber:Gets the new match number.
 * Prdp_Print360by180:Outputs two 24-bit-deep 360x180 scanline passes to the printer.
 * Prdp_Print360by360:Outputs two 24-bit-deep 360x360 scanline passes to the printer.
 * Prdp_PrintRasterPass:Prepares and outputs the raster to the printer.

PRDAKERN.C
This module contains functions that return the kerning pairs for the current font.
 * Prda_GetKerningPairTable:Returns the kerning pairs for the current font.

PRDAPAGE.C
This module contains functions that handle the code page function for the printer.
 * Prda_AdjustFaceName2:Adds a description of the font quality and the font attribute of the face name.
 * Prda_AlterCodePage:Changes the code page function for the default font.
 * Prda_CheckMetrics:Looks for a default font with the new code page.
 * Prda_FindDeviceCodePage:Changes the default font to the requested code page.
 * Prda_GetCodePage:Returns the current code page.
 * Prda_MatchExactCodePage:Looks for a default device font with the new code page.
 * Prda_MultiCodePageSupported:Looks through the global outline code page table.
 * Prda_SetCodePage:Sets the code page to the value passed in ArgCodePage.

PRDAQERY.C
This module contains functions that prepare the font metrics.
 * Prda_AdjustFaceName:Adds a description of the font quality and the font attribute.
 * Prda_AdjustForCharBox:Scales outline font metrics by the character box.
 * Prda_CopyMetrics:Copies font metrics to the local temporary metric buffer.
 * Prda_DeviceQueryFontAttributes:Returns the current font metrics.
 * Prda_DeviceQueryFonts:Returns the metrics to all fonts.
 * Prda_MatchFaceNames:Matches the font face names.
 * Prda_ProcessAttributes:Processes the input device attributes.
 * Prda_ReturnMetrics:Copies the metrics from the buffer to the return buffer.

PRDARFNT.C
This module contains functions that find a font.
 * Prda_MatchFont:Finds a font that matches the given attributes.
 * Prda_RealizeFont:Realizes or deletes fonts.

PRDARSUB.C
This module contains functions that handle code page and font functions.
 * Prda_ChangeMatchNumber:Matches FGID and changes some font information.
 * Prda_CodePageType:Gets the code page number or type.
 * Prda_DefaultFontSwitch:Switches to default font.
 * Prda_GetCPIndexFromCodePage:Gets code page font index.
 * Prda_InfoFromMatchNumber:Determines what type of font is being used.
 * Prda_MatchBaseFont:Matches the base font.
 * Prda_MatchEngineAttributes:Matches the engine attributes structure.
 * Prda_MatchFattrStructure:Matches the font attributes.
 * Prda_MatchMetrics:Matches the font attributes and the target metrics.
 * Prda_RealizeDeviceFont:Realizes a device font.

PRDASETB.C
This module contains functions that set and return the attributes.
 * Prda_CheckFontValid:Checks if the font is valid.
 * Prda_DeviceGetAttributes:Returns the attributes.
 * Prda_DeviceSetAttributes:Sets various attributes.
 * Prda_GetDfltCharBox:Sets up the default character box dimensions.
 * Prda_SetImagAttrs:Sets the image attributes.
 * Prda_SetLineAttrs:Sets the line attributes.
 * Prda_SetMarkAttrs:Sets the marker attributes.
 * Prda_SetPtrnAttrs:Sets the pattern attributes.
 * Prda_SetTextAttrs:Sets the text attributes.
 * Prda_SetTextSimlFlag:Sets the flags for simulation.

PRDASETG.C
This module contains a function that sets global attributes.
 * Prda_DeviceSetGlobalAttribute:Sets global attributes.

PRDBBLT.C
This module contains functions that perform bit logical transfer.
 * Prdb_BitBlt:The hooked function from the dispatch table.
 * Prdb_CachePattern:Sets up a new copy of the pattern which has been expanded to a Dword.
 * Prdb_DoBitBlt:Performs the BLT only after high level checks have been done.
 * Prdb_DoQuickBlt:Implements BLT very fast.
 * Prdb_DoQuickRop:Implements some ROPs very fast.
 * Prdb_GetBitOffset:Returns the bit offset of the Dword with the top 3 bits.
 * Prdb_GetByteOffset:Returns the byte offset of the Dword.
 * Prdb_GetDwordBitOffset:Returns the bit offset of the Dword with the top 5 bits.
 * Prdb_GetFastFlags:Sets up flags to indicate fast paths can be taken in the code.
 * Prdb_GetIndices:Determines the indexes to the source and target bit maps.
 * Prdb_GetMasks:Determines the masks required for the start and end Dwords.
 * Prdb_GetPattern:Sets up the pattern information for the bitblt.
 * Prdb_GetPatternRow:Gets a pattern row.
 * Prdb_GetSourceRow:Gets the row for the source bit map.
 * Prdb_Pat11BitAligned:Gets a pattern row and makes it a Dword aligned with the target.
 * Prdb_Pat41BitAligned:Gets a pattern row and adjusts it with a different pattern.
 * Prdb_PerformRop:Performs the raster operation.
 * Prdb_QuickBltPossible:Decides if the ROPs can be done very quickly.
 * Prdb_RopManyDwords:Performs the raster operation for greater than one DWORD.
 * Prdb_RopOneDword:Performs the raster operation for a single Dword in the row.
 * Prdb_RopTwoDwords:Performs the raster operation for two Dwords in the row.
 * Prdb_StartPosAndDir:Determines the start position and the direction for processing the blt.

PRDBCREA.C
This module contains functions that create a bit map.
 * Prdb_CreateBitmap:Creates a bit map and sets it to the current background color.
 * Prdb_DeviceCreateBitmap:Creates a bit map according to the parameters.

PRDBCTAB.C
This module contains three tables for color conversion.

PRDBDATA.C
This module contains data for the raster operation codes and patterns.

PRDBDELT.C
This module contains a function that deletes a bit map.
 * Prdb_DeviceDeleteBitmap:Deletes a bit map in the printer drivers bit map list.

PRDBEXIN.C
This module contains functions that perform bit map conversion.
 * Convert_ext1_to_int1:Transfers one scanline from the external 1bpp to the internal 1bpp.
 * Convert_ext1_to_int4:Transfers one scanline from the external 1bpp to the internal 4bpp.
 * Convert_ext24_to_int1:Transfers one scanline from the external 24bpp to the internal 1bpp.
 * Convert_ext24_to_int4:Transfers one scanline from the external 24bpp to the internal 4bpp.
 * Convert_ext4_to_int1:Transfers one scanline from the external 4bpp to the internal 1bpp.
 * Convert_ext4_to_int4:Transfers one scanline from the external 4bpp to the internal 4bpp.
 * Convert_ext8_to_int1:Transfers one scanline from the external 8bpp to the internal 1bpp.
 * Convert_ext8_to_int4:Transfers one scanline from the external 8bpp to the internal 4bpp.
 * Prdb_ConvertExttoInt:Converts an external bit map to an internal bit map.
 * Prdb_TableExttoInt:Creates a color conversion table for color mapping.
 * Prdb_TransferExttoInt:Transfers data from an external bit map to an internal bit map.

PRDBGETB.C
This module contains functions that perform get or set bit map bits.
 * CheckBitmap:Performs initial checking of the parameters.
 * Prdb_GetSetBitmapBits:Checks the parameters and decides if the call is a get or a set.

PRDBGETP.C
This module contains a function that gets the color of the pixel.
 * Prdb_GetPel:Returns the color of the pixel.

PRDBGREY.C
This module contains a function that determines the color of the first pixel.
 * Prdb_GetNextColor:Returns the current RGB color and updates pointers to the source bit map.

PRDBIMAG.C
This module contains a function that inputs image data into a bit map.
 * Prdb_ImageData:Draws a row of image data into the currently selected bit map.

PRDBINEX.C
This module contains functions that perform internal to external conversion of bit maps.
 * Convert_int1_to_ext24:Transfers one scanline from the external 1bpp to the internal 24bpp.
 * Convert_int1_to_ext4:Transfers one scanline from the external 1bpp to the internal 4bpp.
 * Convert_int1_to_ext8:Transfers one scanline from the external 1bpp to the internal 8bpp.
 * Convert_int4_to_ext1:Transfers one scanline from the external 4bpp to the internal 1bpp.
 * Convert_int4_to_ext24:Transfers one scanline from the external 4bpp to the internal 24bpp.
 * Convert_int4_to_ext8:Transfers one scanline from the external 4bpp to the internal 8bpp.
 * Prdb_ConvertInttoExt:Converts an internal bit map to an external bit map.
 * Prdb_CopyInttoExt:Copies data from an internal bit map to an external bit map.
 * Prdb_SetExternalColourTable:Sets up a color table for return.
 * Prdb_TransferInttoExt:Transfers data from an internal bit map to an external bit map.

PRDBMARK.C
This module contains functions that draw markers at the specified positions.
 * Prdb_PolyMarker:Draws a series of markers.

PRDBSELE.C
This module contains a function that selects a bit map into the device context.
 * Prdb_DeviceSelectBitmap:Selects a new bit map into the DC.

PRDBSETP.C
This module contains functions that set the pixel.
 * Prdb_MixPel:Sets the specified pel value.
 * Prdb_SetPel:Sets the pel specified by ArgParm in the currently selected bit map.

PRDBSUBR.C
This module contains functions that deal with operations on a bit map.
 * Prdb_DeleteBitmap:Deletes the bit map.
 * Prdb_FreeBitmap:Frees a bit map.
 * Prdb_GetGreyScaleInfo:Checks the conditions for grey scaling.
 * Prdb_GetOffsets:Returns an offset in two parts, byte and bit, to the position specified by XCoord and YCoord.
 * Prdb_GreyScaleSourceBitmap:Takes the current source bit map and converts it into a grey scaled bit map.
 * Prdb_HugeDecrement:Handles decrements in OldAddress.
 * Prdb_HugeGetByte:Returns the value at the location.
 * Prdb_HugeIncrement:Handles increments in OldAddress.
 * Prdb_HugeSetByte:Writes a byte at the location.

PRDCCTAB.C
This module contains functions that define entries for logical color table.
 * Prdc_CreateLogColorTable:Defines the entries in the logical color table.
 * Prdc_RealizeColorTable:Realizes the color table.
 * Prdc_UnRealizeColorTable:Unrealizes the color table.

PRDCQERY.C
This module contains functions that access the logical color table.
 * Prdc_QueryColorIndex:Returns the index into the logical color table.
 * Prdc_QueryNearestColor:Returns the nearest color available to the printer.
 * Prdc_QueryRealColors:Returns the real colors available to the printer.
 * Prdc_QueryRGBColor:Returns the RGB color.

PRDCQTAB.C
This module contains functions that query the logical color table.
 * Prdc_QueryColorData:Returns the format of the current logical color table.
 * Prdc_QueryLogColorTable:Returns the logical color table entries.

PRDCSUBR.C
This module contains functions that access the device color table.
 * Prdc_ColorDifference:Determines the difference between two RGB values.
 * Prdc_ColorToPelBits:Returns an index to the device color table.
 * Prdc_ColorToRGBValue:Returns an RGB value based upon the color parameter.
 * Prdc_GetSystemColor:Calls Prdc_InterpretDfltColor (below) to handle the color indexes.
 * Prdc_GreyColorToPelBits:Returns an index to the device color table for the entry.
 * Prdc_InterpretDfltColor:Handles the special default negative color indexes.
 * Prdc_NegColorToPelBits:Handles negative color indexes that have special meanings.
 * Prdc_PhysRGBColorToPelBits:Searches the color table for an exact match to PhysRGBColor.
 * Prdc_RGBColorDiff:Checks whether an entry is the closest entry thus far to RGBColor.
 * Prdc_RGBColorToPelBits:Returns the index to the entry in the device color table.
 * Prdc_RGBToCLRIndex:Returns the index to the entry in DefaultColorTable.
 * Prdc_RGBToColIndex:Returns the index to the entry in DVTHardwarePalette.
 * Prdc_RGBToPhysIndex:Returns the index into the logical color table.

PRDD42FT.C
This module contains the IBM42XX Font Tables.

PRDD42XX.C
This module contains the Device Driver Tables (DDTs) for the.

PRDDATA.C
This module contains the data.

PRDDCPGE.C
This module contains the Code Page Tables for.

PRDDEST.C
This module contains the Escape Sequence Tables (ESTs) for the.

PRDDMODE.C
This module contains the Device Mode Settings.

PRDDNTFT.C
This module defines font lists for IBM42XX.

PRDDTAB.C
This module contains the Device Value Tables (DVTs), Device Driver Tables ( DDTs) and Global Descriptor Tables (GDTs) for the.

PRDDYNA.ASM
This module contains the Dynamic Link Entry Points.

PRDEBCLS.C
This module contains a function that performs closing the document.
 * Prde_BeginClose:Closes the metafiler and spooler.

PRDECOPN.C
This module contains functions that complete the preparation of the DC and send the default font sequence to the printer.
 * Prde_CompleteOpen:Finishes preparing the DC.
 * Prde_OutputDefaultFontCodes:Sends the default font escape sequences to the printer.

PRDEDDC.C
This module contains a function that ends the printer process.
 * Prde_DisableDC:Stops the printer and closes the spool file.

PRDEDPDB.C
This module contains a function that disables the physical device block.
 * Prde_DisablePdb:Disables the physical device block.

PRDEEDC.C
This module contains functions that create a heap for a device context.
 * Prde_EnableDC:Creates a heap for a DC.
 * Prde_GetAttrsMemory:Allocates memory on the DC heap for the attribute bundles.
 * Prde_GetVarSizeMemory:Allocates memory on the DC heap for clip rectangles.
 * Prde_QueryProcessCP:Gets the current code page of the process.
 * Prdn_SetCompleteOpenDCIDefaults:Finishes the setup that was begun in Prdn_SetEnableDCIDefaults.
 * Prdn_SetDCIAttributes:Contains setup attributes and the color table.
 * Prdn_SetDCIFlags:Prepares DC flags for startdoc and enableDC 2. Resets DC origin.
 * Prdn_SetDCIXform:Initializes the transform matrix stored in DC instance data.
 * Prdn_SetEnableDCIDefaults:Sets up the DCI attributes and resets various flags.
 * Prdn_SetResetDCDCIDefaults:Sets up the DCI stuff.
 * Prdn_SetStartDocDCIDefaults:Sets up the DCI and resets the Aborted flag.

PRDEFLDB.C
This module contains utilities functions.
 * Prde_FillLdb:Accesses the printer driver's dispatch table.
 * Prde_GetOSVersionNumber:Returns the OS/2 version.
 * Prde_GetProcessID:Determines the process ID.

PRDEFONT.C
This module contains functions that perform the initial process for font and code page.
 * Prde_DownloadCodePage:Downloads the code page to the printer.
 * Prde_DownloadFile:Downloads the given file to the printer.
 * Prde_InitialiseDownFonts:Sets up initial download fonts and code pages on the printer.
 * Prde_LoadCodePageMetrics:Gets the code page structure for this resident font and code page.
 * Prde_LoadResidentFontMetrics:Sets up the metrics pointer and the base match number for each resident font.
 * Prde_ReadFontResource:Accesses a font metrics resource.

PRDEFPDB.C
This module contains functions that perform printer opening and printer device block initialization.
 * Prde_ChooseForms:Chooses the forms and trays for the job and fills the PPMInfo.
 * Prde_FillPdb:Finds and opens the printer, initializes PDB, and keeps track of its state.
 * Prde_FindDfltFormNo:Finds the default form to use and returns the form number.
 * Prde_FindDrvDataFormNo:Matches the form information with the list of forms in PrinterIniInfo.
 * Prde_GetFormDimensions:Sets up the page width and depth and clips fields of the PDB.
 * Prde_GetOutputType:Determines whether the printing is STD or RAW.
 * Prde_GetPrinterInfo:Fills the PDB with information for the printer.
 * Prde_SetMachineType:Sets the machine type, resident font list, and number of resident fonts.
 * Prde_SetPageAtts:Sets the orientation and raster mode into the PDB.

PRDENABL.C
This module contains one of the printer driver entry points.
 * OS2_PM_DRV_ENABLE:One of the entry points into the printer driver.

PRDERSET.C
This module contains a function that resets the DC.
 * Prde_ResetDC:Deletes or frees all items referenced by pointers from the DC instance data.

PRDERSTR.C
This module contains functions that restore the DC.
 * Prde_RestoreDC:Allows a DC to be restored from the stack of DCs.
 * Prde_FreeDCItems:Frees items in the DC instance data.

PRDESAVE.C
This module contains a function that saves the DC.
 * Prde_SaveDC:Saves a DC by pushing it onto the stack.

PRDESUB1.C
This module contains functions that perform font and code page data setup.
 * Prde_CalcAttrCodePageFonts:Calculates the total number of attributed fonts in a downloaded code page.
 * Prde_GetCodePageList:Gets the code page list.
 * Prde_GetDriverDataDfltFontInfo:Gets the default font information from the driver data.
 * Prde_GetFontInfo:Sets up metrics and determines the ID number of the default font that was passed in.
 * Prde_GetIniDfltFontInfo:Deals with the default font information from PrinterIniInfo.
 * Prde_InitialisePrinterStateData:Initiates a new block of PrinterData or re-initializes an old block.
 * Prde_MakeDefaultFontEngine:Makes the default font engine.
 * Prde_ProcessDefaultFont:Sets up default font information and default device font information.
 * Prde_ProcessPrinterStateData:Performs various jobs involving fonts that must be performed immediately.
 * Prde_SetUpPrinterStateData:Sets up printer state data.

PRDESUB2.C
This module contains functions that get the printer name.
 * Prde_GetPrinterName:Gets the printer name.
 * Prde_GetPrinterNameFromDD:Gets the printer name from driver data.
 * Prde_GetPrinterFromLogAddress:Gets the printer name that matches the given LogAddress.
 * Prde_GetBestFitPrinterName:Gets the port or queue associated with the default printer.
 * Prde_MatchDirectSpoolerInfo:Matches the provided printer name and the port.
 * Prde_MatchQueuedSpoolerInfo:Matches the provided printer name and the queue.
 * Prde_GetAppDefaultPrinterName:Queries and returns the printer name.
 * Prde_ReadTerminatedWordFromText:Reads and tests the terminator in text.
 * Prde_GetDeviceName:Determines the printer type.
 * Prde_GetPrinterIniInfo:Points to printer information in the OS2.INI file.
 * Prde_GetPrinterNameEntry:Returns a pointer to the logical printer in the OS2.INI file.
 * Prde_GetPrinterTypeEntry:Gets printer type and returns a pointer to the start of the configuration information.
 * Prde_TranslateOldIniEntry:Finds and translates the driver's old OS2.INI entry into the new format.
 * Prde_WriteHeaderData:Writes the fixed length header data to the OS2.INI entry.

PRDESUB3.C
This module contains functions that deal with OS2.INI entries and set the default printer.
 * Prde_ReadPrinterProperties:Reads the OS2.INI entry for the appname and returns a pointer to this data.
 * Prde_GetDefaultPrinter:Finds the first selected printer and makes it the default printer.
 * Prde_PM_DD_Exist:Reads the OS2.INI entry and verifies the version existence.
 * Prde_PM_DD_Read:Reads the OS2.INI entry.
 * Prde_ReadOldConfig:Returns an old configuration for the specific printer type and the logical printer.
 * Prde_ConvertOldIniEntry:Converts old format OS2.INI entries to the new format.
 * Prde_GetIniVersionType:Verifies that the OS2.INI entry is the current format, a previous format, or is unusable.
 * Prde_TranslateOldDriverData:Converts the driver data from the previous version into the current format.
 * Prde_TranslateOldDriverDataFrm:Converts the previous version of the driver data forms into the current format.
 * Prde_TranslateOldBody:Reads the body data from the OS2.INI entry and converts the first byte into ASCII.
 * Prde_Translate4224Forms:Prepares and adjusts forms and envelopes.

PRDESUBR.C
This module contains functions that work on the OS2.INI file.
 * Prde_ReadIniFile:Reads an entry in the OS2.INI file and returns a pointer to a buffer containing the data.
 * Prde_ExchangeDispatch:Substitutes the function address and returns the original contents of the entry in a dispatch table.
 * Prde_Termination:Allows the printer driver to free any semaphores owned by that process.
 * Prde_ReadHeaderData:Reads the fixed length header data from the OS2.INI entry for the given printer.
 * Prde_GetValFromText:Converts a number in the text of the OS2.INI entry into a value.
 * Prde_FindFormNumber:Matches a given form name to the list of forms.
 * Prde_FindReqdTray:Looks through the trays for the current source configuration to find the required form.
 * Prde_ProcessPPMTrayInfo:Sets up part of the PPMInfo structure.
 * Prde_SetUpPPMFormInfo:Sets up the FormName and FormInfoPtr fields in PPMInfostructure.
 * Prde_StringsAreEqual:Compares two strings, ignoring the case of the characters 'a' - 'z'.
 * Prde_GetResources:Gets some resources that will be used in.
 * Prde_SetupSplData:Sets up the parameters and issues the SplQmOpen call.
 * Prde_CopySplData:Copies the given SpoolerData into a local variable.
 * Prde_OpenSpooler:Opens the spooler and sets the pointer to the device information.
 * Prde_OpenPort:Gets the semaphore for the port that is being written to.

PRDFDFNT.C
This module contains functions that manage the engine font of the printer.
 * EDF_DeleteFontHdr:Deletes all the resources belonging to the font.
 * EDF_DLFCommand:Changes the status of the engine font in the printer.
 * EDF_EndPage:Frees all the engine fonts marked Deleted.
 * EDF_Init:Initializes the pointer to the linked list of downloadable engine font headers.
 * EDF_PurgeFont:Sends a purge command to the printer to purge downloaded engine font.
 * EDF_Terminate:Frees all the resources used for downloading engine fonts.

PRDGACCB.C
This module contains functions that bound rectangle conversion.
 * Prdg_AccumulateBounds:Converts the given bounds rectangle with coordinates stored in Dwords into Words.
 * Prdg_GetBoundsData:Converts the current overall bounds into a Dword format.
 * Prdg_ResetBounds:Resets the current overall bounds by setting the flag for default bounds to true.
 * Prdg_GetBoundingRect:Returns the bounding rectangle.

PRDGADDB.C
This module contains a function that incorporates the rectangle into the current overall bounds.
 * Prdg_AddBounds:Incorporates the given rectangle into the current overall bounds.

PRDGCONV.C
This module contains functions that coordinate conversion.
 * Prdg_Convert:Provides the format of each coordinate pair to GreConvert. Converts and stores in required format.
 * Prdg_FastConvert:Provides a fast conversion between world coordinates and device coordinates.
 * Prdg_NotifyTransformChange:Updates the device coordinate current position and pattern origin.

PRDGHEAP.C
This module contains functions that manage heaps.
 * Prdg_CreateHeap:Acquires a DOS segment and initializes it as a Winthorn Heap.
 * Prdg_DeleteHeap:Deletes the heap in the segment.
 * Prdg_AllocHeapItem:Allocates space from the heap and returns a pointer to the space allocated.
 * Prdg_FreeHeapItem:Frees the space previously allocated to the item of the heap list.
 * Prdg_AllocGlobalHeapItem:Allocates space from the printer driver's global heap and returns a pointer to the space allocated.
 * Prdg_FreeGlobalHeapItem:Frees the space previously allocated to the item of the global heap.
 * Prdg_GetNewGlobalHeap:Creates a new heap to hold global data.

PRDGPRAW.C
This module contains a function that performs data parsing.
 * Prdg_ParseRawData:Parses the stream of raw data passed to the printer so that the driver can handle form feeds correctly.

PRDGXFRM.C
This module contains functions that perform matrix transformation.
 * Prdg_GetXformMatrix:Gets a transform matrix, depending on the given handling flags.
 * Prdg_ScaleValue:Provides more accurate calculation.
 * Prdg_PointToAngle:Converts a point (x,y) to an angle from the x-axis.
 * Prdg_MatrixScaleDifferent:Checks if two matrixes are different.
 * Prdg_XformPoint:Transforms the given point and returns the vector length.
 * Prdg_ScaleUpPoint:Scales the coordinate values until one of the values is greater than the given minimum value.

PRDICLIPh3.C
This module contains functions that clip the rectangle.
 * Prdi_NotifyClipChange:Stores the clip rectangle in the required format if it is the only one.
 * Prdi_DefaultClip:Sets up the default clip regions for the current DC.
 * Prdi_ClipIntSect:Clips the rectangle to the specified coordinates.
 * Prdi_GetNextClip:Checks if a given clip rectangle is exists.
 * Prdi_CacheClipRects:Assigns the coordinates for the clip rectangle.

PRDILINE.C
This module contains functions that clip the line to the rectangle.
 * Prdi_ClipLine:Clips the specified line to the specified rectangle.
 * Prdi_Outcode:Sets up and combines the outcode.

PRDINIT.C

 * This module contains a function that creates the semaphores.


 * Prde_InitSemaphores:Creates the semaphores.

PRDJQSTD.C
This module contains a function that creates a standard spool file.
 * prdn_CreateSTDSpoolFile:Closes the metafile associated with the current DC and writes its contents to a standard spool file.

PRDJSUBR.C
This module contains functions that perform some aspects of banding.
 * prdj_MakeBand:Makes a band based on the size of a page and the number of bands per page.
 * prdj_FreeBand:Deletes the specified band and the bit map, freeing the associated memory.
 * prdj_UpdateBandCoordinates:Updates the field containing the lower limit of the band.
 * prdj_LastBand:Checks if this is the last band.

PRDLDRAW.C
This module contains a function that draws a straight line.
 * Prdl_DrawLinesInPath:Draws the straight lines in a completed path definition.

PRDLGETC.C
This module contains a function that returns the current position.
 * Prdl_GetCurrentPosition:Returns the current position.

PRDLGETO.C
This module contains a function that returns the current coordinates.
 * Prdl_GetLineOrigin:Returns the current style state and the current world coordinates.

PRDLGRAT.C
This module contains functions that return and store the style ratio and gets the instance data.
 * Prdl_GetStyleRatio:Returns the style ratio.
 * Prdl_SetStyleRatio:Stores the style ratio.
 * Prdl_GetDCOrigin:Gets original DC instance data.

PRDLPOLY.C
This module contains functions that draw a sequence of lines.
 * Prdl_UpdateBoundsRectangle:Keeps a record of the bounding rectangle of the current set of lines.
 * Prdl_PolyLine:Draws a sequence of one or more lines from the current position.

PRDLSETC.C
This module contains a function that sets the current position.
 * Prdl_SetCurrentPosition:Sets the current position to the given coordinates.

PRDLSETO.C
This module contains a function that sets the current line origin.
 * Prdl_SetLineOrigin:Sets the current style state in the DC instance data.

PRDLSHRT.C
This module contains a function that draws a series of short lines.
 * Prdl_PolyShortLine:Draws a series of short lines as specified.

PRDLSUBR.C
This module contains functions that return the bit map list entry and series of coordinates for a straight line.
 * Prdl_LineSetUp:Returns the bit map list entry, color, mix, line type, and line type mask.
 * Bresenham:Calculates series of coordinates for points to make a straight line.

PRDMCONN.C
This module contains functions that sets the connection to the available paper source.
 * Prdm_ConnDlgProc:Specifies the forms that are mounted in each of the available paper sources.
 * Prdm_EnterConnections:Handles manual source.

PRDMCONV.C
This module contains functions that convert the OS2.INI format.
 * DrvInstall:Accessed from the OS/2 Printer Install or CSD Install.
 * Prdm_ConvertOldIniToNew:Converts the old OS2.INI format to the new format.
 * Prdm_ReadTerminatedWordFromText:Reads characters until it reaches terminators or null values.

PRDMCPGE.C
This module contains functions that handle the code page.
 * Prdm_CodePageDlgProc:Enables the user to add or delete a code page and to select an initial code page.
 * Prdm_EnterCodePageValues:Allows the user to enter the code page selection.
 * Prdm_AddCodePage:Adjusts the code page list to add a new code page.
 * Prdm_DisplayCodePage:Displays the code page to the user.

PRDMDEV.C
This module contains the entry point to the.
 * OS2_PM_DRV_DEVMODE:This is an entry point into the device driver. It is accessed from the OS/2 Control Panel.
 * Prdm_DevMode:Calls Prdm_Dialog which manages the window and dialog boxes.

PRDMDFNT.C
This module contains functions that handle the default font.
 * Prdm_DfltFontDlgProc:Handles default font processing.
 * Prdm_InitDfltFontList:Initializes default font list.
 * Prdm_DisplayDefaultFontList:Displays each font in the default font list, highlighting the default.
 * Prdm_EnterFontValue:Updates default font information in default font list.
 * Prdm_FontTableMemory:Allocates memory for the default font table and sets up the entry zero to be the system font.
 * Prdm_MoreFontTableMemory:Allocates more memory for the Default Font Table.
 * Prdm_ReleaseFontTableMemory:Deallocates the memory allocated for the Default Font Table.
 * Prdm_CopyFaceNameAcross:Parses a face name to change the decimal point character if it is present.

PRDMDLG.C
This module contains a function that runs the dialog box.
 * Prdm_Dialog:Controls the running of the section of the control panel.

PRDMDSUB.C
This module contains functions that manage the default font entry.
 * Prdm_ResidentFonts:Adds the match and the description parameters of the current default font list entry.
 * Prdm_CardFonts:Processes all the card fonts.
 * Prdm_ExpandFaceName:Expands the face name for Quiet III cartridge fonts.
 * Prdm_LoadMatchParameters:Copies data from the FMF into the match parameters in the current entry of the default font list.
 * Prdm_CheckMatchParameters:Checks if the current font is valid and is the default font.
 * Prdm_CheckDefaultFont:Tests the current entry in the default font list to determine if it is the default font.
 * Prdm_DisplayPointSzList:List all the point sizes in the point size list box.
 * Prdm_GetPointSzIndex:Finds out the index to the default outline font point size table.
 * Prdm_EnterFontPointSz:Queries the point size selection and finds the point size value.
 * Prdm_DfltFontPSzControlProc:Queries the font selection and displays the point sizes.

PRDMENTR.C
This module contains a function that enters data into the DMData.
 * Prdm_EnterValues:Writes the data that is currently contained in that dialog box into the DMData.
 * PRDMFILE.C:This module contains functions that copy a file.
 * Prdm_CopyFile:Copies a file from the source to the target directory.
 * Prdm_ReadFileContents:Reads the file contents.
 * Prdm_CheckFileExists:Checks if the file exists.
 * Prdm_CheckFileOKForPrinter:Checks if this file is appropriate for this driver and the current printer.
 * Prdm_CopyFMFFiles:Copies a CDF file and its associated FMF files.
 * Prdm_StringsAreEqual:Compares two strings, ignoring the case of the characters 'a' - 'z'.
 * Prdm_ReadFontResource:Reads an FMF resource.

PRDMHELP.C
This module contains help functions.
 * Prdm_EnableHelp:Prepares for help.
 * Prdm_DisableHelp:Displays the help.
 * Prdm_GetHelpPath:Gets the help path.
 * Prdm_HelpMessageProcessing:Processes the help message.

PRDMJOB.C
This module contains functions that set up the job for dialog box processing.
 * Prdm_JobSetUpDlgProc:Specifies the printer setup for a single job.
 * Prdm_EnterJobSetUp:Sets up the job according to its type.
 * Prdm_SetupSingleFormList:Displays the available forms in the list box and highlights one according to the driver data.

PRDMMAIN.C
This module contains functions that perform dialog box processing.
 * Prdm_MainDlgProc:Interprets the users responses to the dialog boxes.
 * Prdm_ControlProc:Performs processing or checking when it receives a message relating to a list box or a text box.
 * Prdm_InitFormsDlg:Sets up the dialog box to the current values.
 * Prdm_InitFormListTemplate:Picks up the names of predefined forms from resources and displays them.
 * Prdm_InitFormList:Makes each form name null-terminated, inserts it, and restores the space.
 * Prdm_PaintFormTemplate:Displays the details of the given form.
 * Prdm_PaintForm:Displays the dimensions for a specified form.
 * Prdm_DeleteForm:Deletes the currently selected form.
 * Prdm_DigitToASCII:Converts the rightmost decimal digit of a number to the ASCII digit 0-9.
 * Prdm_TextFromNumeric:Converts a number into a text string.
 * Prdm_ReadWordFromDecText:Returns the value of a number written as text.

PRDMSUB1.C
This module contains error log and debug functions.
 * Prdm_TranslateOldIniEntry:Makes new .INI entries from the old version.
 * prdz_Ring3LogErr:LogErr routines.
 * prdz_Ring3LogDosErr:LogErr routines.
 * Ring3CrLf:Writes a carriage return or line feed sequence to the debug terminal.
 * Ring3OutputValue:Writes the value to the debug terminal in the specified base.
 * Ring3OutputString:Outputs the specified string to the debug terminal, followed by a CrLf.
 * Ring3OutputPrompt:Outputs the prompt to the debug terminal.
 * Ring3OutputPair:Outputs the string and digit to the debug terminal.
 * Prdm_GetDeviceName:Determines the printer type.
 * Prdm_PM_DD_Write:Builds an application name using LPName, DeviceName and DriverName.
 * Prdm_SelectOldDriver:Selects the old driver if it exists.

PRDMSUBR.C
This module contains functions that handle the DMData.
 * Prdm_WriteHeaderData:Writes the fixed length header data from DMSettings to the INI entry.
 * Prdm_ReadyDMData:Clears all the DMData structure pointers to null.
 * Prdm_FreeDMDataSegments:Frees all the segments used by DMData.
 * Prdm_LoadDMDataDefaults:Loads default DMData.
 * Prdm_QueryMainBoxSelections:Queries the box selections.
 * Prdm_WriteBodyData:Writes the variable length body data from DMData to the INI entry.
 * Prdm_WriteIniEntry:Writes the INI entry for the given printer.
 * Prdm_InitMainDlg:Sets up the dialog box to the current values.
 * Prdm_ReadBodyData:Reads the variable length body data from the INI entry to DMData.
 * Prdm_DispMessageBox:Loads the message string from resources for display.
 * Prdm_DispConversionMsg:Loads the driver name and the message string from resources for display.
 * Prdm_RemoveMenuOptions:Turns off menu options.
 * Prdm_InitSourceBoxes:Processes some DDT flags.
 * Prdm_RadioButtonControl:Sets up the control structure for radio buttons.
 * Prdm_FindFormInfo:Looks for the form name, type, and unit from the form data in DMData.
 * Prdm_FindFormNumber:Matches form name, type, and unit to the form data in DMData.
 * Prdm_FindDfltFormNo:Finds the default form index number.

PRDNGPIM.C
This module contains a function that checks the drawing state before continuing.
 * Prdn_CheckDrawingState:Checks the drawing state.

PRDODC.C
This module contains a function that sets the DC origin.
 * Prdo_SetDCOrigin:Sets the DC origin and retrieves the set of clip rectangles appropriate to it.

PRDODRAW.C
This module contains functions that draw borders for frames.
 * Prdo_DrawBorder:Draws a border in a rectangular frame.
 * LockDevice:Returns TRUE.
 * UnlockDevice:Returns TRUE.
 * Prdo_ErasePS:Logs a warning to indicate the function is unsupported.

PRDPCMPB.C
This module contains a function that is not implemented.
 * Prdp_CompressG4:Not implemented.

PRDPERR.C
This module contains a function that responds to errors.
 * Prdp_PrintError:Responds to printer errors and reports them to the user using a message box.

PRDPINIT.C
This module contains functions that perform printer initiation.
 * Prdn_InitialisePrinter:Initializes the printer.
 * Prdn_InitPrinterPage1:Initializes SIC or escape codes.
 * Prdn_InitPrinterAllPages:Performs SICs or whatever must be done between every page.

PRDPPREP.C
This module contains functions that start metafiling.
 * Prdn_PrepareNewDocument:Starts metafiling if required. Calls PrepareNextPage to ready a page for drawing.
 * Prdn_PrepareNextPage:Called by PrepareNewDocument, NewFrame. Sets up a band, and resets the drawnflag.

PRDPRAST.C
This module contains functions that output a band to the printer.
 * Prdp_PrintBandRaster:Outputs a complete band to the printer.
 * Prdp_PrintMakeRaster8:Converts the scanlines into raster scans for 8-wire raster output.
 * Prdp_PrintMakeRaster24:Converts the scanlines into raster scans for 24-wire raster output.
 * Prdp_PrintMakeRasterColor:Produces vertical raster bytes for the printer.
 * Prdp_PrintRaster:Outputs the raster to the printer.
 * Prdp_PrintRasterColor:Sends color output blocks to the printer.

PRDPRINT.C
This module contains functions that process print page.
 * Prdn_ProcessPage:Outputs a page to the printer or spooler, and performs first page actions.
 * Prdn_ProcessLastPage:Outputs a page to the printer or spooler, and performs opening and closing actions for the first and last pages.
 * Prdn_SendInitAndPage:Outputs initiated codes and the bands to the device.
 * Prdn_JobEndFeedOrSIC:Handles the raw data conditional processing.
 * Prdn_BandingStopJournalling:Stops the journal file when banding.
 * Prdn_BandingDeleteJournal:Deletes the journal file for banding.

PRDPSTRT.C
This module contains functions that send the port option.
 * Prdp_InitialiseCOMPort:Reads the port options from OS2.INI, converts to binary data, and sends to the port device driver.

PRDPSUBR.C
This module contains a group of printing steps.
 * Prdp_PrintSimple:Uses the Device Color Table (DCT) to access the EST or uses the EST directly to send issue escape sequences.
 * Prdp_PrintMemory:Prints the current contents of the buffer described by pMemory and MemoryIndex.
 * Prdp_AddString:Adds a string to the buffer and outputs the buffer when it is full.
 * Prdp_PrintMoveDown:Moves the printer head closest to the Targetposition and calculates the new error in head position.
 * Prdp_AddHorizMoveString:Makes the horizontal movement of the printer head.
 * Prdp_NeedSpacesForMove:Verifies that the necessary space is available to make the planned movement.
 * Prdp_OutlineFontSizeString:Writes the Nominal Vertical and Horizontal Font Size parameters of the FSC command to the printer.
 * Prdp_IntToAsciiDecimal:Writes a decimal ASCII string.

PRDPTEXT.C
This module contains functions that handle text printing.
 * Prdp_PrintText:Outputs all the entries in the text band.
 * Prdp_SetUpFont:Outputs the escape sequences used in the first stage of selecting the font.
 * Prdp_SelectFont:Sends the escape sequences to select a font on the printer.
 * Prdp_SelectAttributes:Sends the device attribute and engine attribute escape sequences.
 * Prdp_StrikeOutToBand:Loops thru all the text chain entries and adds the strikeout lines to the graphics bit map band.

PRDPWRIT.C
This module contains functions that access the printer.
 * Prdn_PrtWrite:Performs error checking and retries actions to the printer.
 * Prdn_OpenPrinter:Opens the printer.
 * Prdn_ClosePrinter:Closes the printer.
 * Prdn_our_PrtAbort:Terminates the printer job.
 * Prdn_CloseDevice:Closes the printer or spooler file.

PRDQEDOC.C
This module contains functions that perform actions on a document.
 * Prdq_StartDoc:Starts a document according the state.
 * Prdq_EndDoc:Ends a document in the current device context.
 * Prdq_AbortDoc:Aborts a document for the printer.
 * Prdn_WaitForThread:Waits for a thread in the current device context.
 * Prdn_AbortTidyUp:Resets the Aborted flag, closes the device, and frees the band.
 * Prdn_write_abort_tidy_up:Writes some zeros and a SIC to the printer, frees the band, closes the printer, resets the Aborted flag.

PRDQESC.C
This module contains functions that query the escape code.
 * Prdq_Escape:Allows access to driver facilities that are not covered by the GPI calls.
 * Prdq_QueryEscSupport:Finds out whether an escape code is supported.

PRDQESUB.C
This module contains some output functions of a printer.
 * Prdq_NewFrame:Outputs the page to printer or spooler, and increments PageNumber.
 * Prdq_FlushOutput:Flushes current band without printing it, and restarts the band.
 * Prdq_RawData:Sends raw data to the printer.
 * Prdq_JournalData:Writes the data to the journal.
 * Prdq_SetMode:Sets the printer into a particular mode.

PRDQHCC.C
This module contains a function that queries the hardcopy capabilities of the printer.
 * Prdq_QueryHardcopyCaps:Returns information about the hardcopy capabilities of the printer.

PRDQNAME.C
This module contains one of the exported entry points into the driver.
 * OS2_PM_DRV_DEVICENAMES:One of the exported entry points into the driver.

PRDQQERY.C
This module contains functions that query information about the printer.
 * Prdq_QueryDeviceBitmaps:Returns information about the bit map formats supported by the printer.
 * Prdq_QueryDevResource:Returns information about the resources available in the printer driver.
 * Prdq_QueryDeviceCaps:Returns information about a variety of the printer's capabilities.

PRDRING3.C
This module contains a function that frees any semaphores owned by this process.
 * Prde_Termination_Ring3_Stub:Calls Prde_Termination at Ring 2.

PRDSPOLY.C
This module contains functions that work on polyscanline code.
 * Prds_PolyScanLine:Fills space between each pair of polyshortlines using the required mix and pattern.
 * Prds_GetPattern:Sets up any pattern required for the BLT.
 * Prds_GetMask:Provides a mask to replace some bits at the left of Dword.
 * Prds_GetPattDword:Constructs the Mask and RealPattern Dwords.
 * prds_InnerScanLine:Implements the non-fast path and (4,1) polyscanline code.

PRDSSUBR.C
This module contains other polyscanline code functions.
 * Prds_FastScanLine:Implements the fast path polyscanline code.
 * Prds_WriteRow:Writes the final row into the bit map, considering the start and end masks.

PRDTCSTR.C
This module contains functions that handle the output font for the printer.
 * Prdt_CharString:Calls Prdt_CharStringPos to do all the work.
 * Prdt_CharStringPos:Performs error checking and some set up and calls Prdt_TextOutDevFont and Prdt_TextOutEngFont.

PRDTDFNT.C
This module contains a function that handles output in a device image font.
 * Prdt_TextOutDevFont:Handles output in a device image font.

PRDTEFNT.C
This module contains functions that transfer and output characters from the engine font to the bit map.
 * Prdt_ImageChar:Transfers a character from the engine font to the position in the bit map.
 * Prdt_ImageCharGrey:Transfers a character from the engine font to the position in the bit map when the engine text foreground color is not black.
 * Prdt_TextOutEngFont:Prints a string of characters in engine font to the bit map.

PRDTESUB.C
This module contains functions that work with the font data structure and code point structure.
 * Prdt_LocateFont:Sets up the font data structure.
 * Prdt_EstablishFont:Sets the initial values in the CodePoint structure held in the font data.
 * Prdt_NextCodePoint:Sets up fields in the code point structure.
 * Prdt_OutlineFontSize:Sets up the fields NHFS and NVFS in FontData.
 * Prdt_SetUpFMF:Updates font information.
 * Prdt_ExpandMultiCpFMF:Updates font information to be a valid FMF.
 * Prdt_SimulateFont:Takes the font specified in FontData and a code page and transforms the font into the new code page.
 * Prdt_TranslateChar:Returns the ASCII value of the character based on the mapping of the root code page to the code page vector table.
 * Prdt_TranslateWidthTable:Moves the font width table entries and translates each entry's position through the CodePageVectorTable.
 * Prdt_GetMultiCpFMFIndex:Searches through the code page list for the input code page.

PRDTQERY.C
This module contains a set of string manipulation utility programs for the 42XX program.
 * prdt_QueryCharPositions:Returns an array of coordinates that gives the positions of each character in the string and the position of the first character after the string.
 * prdt_QueryTextBox:Determines the size of the bounding box for the given string of text. Returns all the corners of the box and the position for a further character in the string (allowing for the direction of string).
 * prdt_QueryWidthTable:Determines the widths of the current font codepoints.

PRDTSUBR.C
This module contains functions for drawing a rectangle.
 * prdt_ChainTextBand:Inserts a graphics text band entry into the chain of graphics text band entries which is anchored in the DC instance data.
 * prdt_FillRectangle:Draws a solid rectangle into the bit map. No clipping or bounding is performed on the rectangle.
 * prdt_GetStartPos:Returns the start position in world, device, or font coordinates.
 * prdt_GetStrikeoutRect:Sets up the four corners of the strikeout rectangle taking into account the angle and shear of the character.
 * prdt_GetStringWidth:Returns the string width either in world coordinates or in font coordinates . This function should be used only for device fonts.
 * prdt_SetOpaqueRect:Produces an opaque rectangle. Handles clipping and bounds accumulation.

PRDTXFRM.C
This module contains functions that scale the character box.
 * prdt_RescaleCharBox:Rescales the character box to the new xform matrix that was passed in.
 * prdt_ScaleXMetricToDevice:Scales the X metric value passed in to the character box, converts it to device coordinates, and returns the new value.
 * prdt_ScaleYMetricToDevice:Scales the Y metric value passed in to the character box, converts to device coordinates and returns the new value.
 * prdt_XformFontValue:Scales a value between font and device coordinates depending on given flags.

PRDUPATT.C
This module contains a set of functions for pattern information manipulation for the driver.
 * prdu_AllocPatternMemory:Allocates pattern memory for the device context.
 * prdu_ExpandPattern:Sets up the pattern information for a driver defined pattern.
 * prdu_FreePatternMemory:Frees up memory attached to the pattern information.
 * prdu_GetBitmapPattern:Sets up the pattern information for a bit-map-defined pattern.
 * prdu_GetDriverPattern:Sets up the pattern information for a driver-defined pattern.
 * prdu_GetGreyScaleIndex:Sets up the index into the grey scale pattern table for the pattern that corresponds to the color passed in.
 * prdu_GetPatternInfo:Sets up the pattern information into the supplied pattern data structure.

PRDUTILS.C
This module contains a set of string manipulation utility programs for the 42XX program.
 * SafeSSALLOCMEM:If the Size parameter is equal to 0, a whole segment is created by SSAllocMem and an error is returned.
 * prdu_abs:Returns the absolute value of its argument.
 * prdu_lrotl:Rotates an input value left n positions.
 * prdu_memcmp:Compares count bytes of memory at two locations.
 * prdu_memcpy:Copies nbytes of memory from one location to another.
 * prdu_memset:Sets a character into n bytes.
 * prdu_strcat:Concatenates one string to another.
 * prdu_strcmp:Compares two strings.
 * prdu_strcmpN:Compares two strings up to n characters.
 * prdu_strcpy:Copies one string to another.
 * prdu_strcpyN:Copies one string to another, up to n characters.
 * prdu_strlen:Returns the length of a string.
 * prdu_stroccur:Returns True if the given character occurs in a string or if the character is null.
 * prdu_strupr:Converts a string to capital letters.
 * prdu_tan:Returns tangent*1000for the given angle.

PRDZDRIV.C
This module contains the printer driver entry and exit routines.
 * prdz_EnterDriver:Locks the DC for the current thread if it is not already locked and returns OK.
 * prdz_LeaveDriver:Decrements the lock count by 1 for the DC and releases the lock if the lock count is equal to zero.

PRDZTRAC.C
This module contains the trace routines for the 42XX program.
 * CrLf:Writes a carriage return or line feed sequence to the debug terminal.
 * OutputPair:Writes the specified string and the corresponding value in the given base, binary, decimal, or hexadecimal, followed by a carriage return or line feed sequence.
 * OutputPrompt:Writes the specified string to the debug terminal, followed by a CrLf and waits for input.
 * OutputString:Writes the specified string to the debug terminal, followed by a CrLf.
 * OutputStringNoCRLF:Writes the specified string to the debug terminal, without a CrLf.
 * OutputValue:Writes the value to the debug terminal, in the specified base, binary, decimal, or hexadecimal.
 * OutputValueLen:Writes the value and length to the debug terminal.
 * prdz_Init:Initializes the trace level and opens trace file.
 * prdz_LogDosErr:Writes the function name, the accompanying text, and the error return code to the debug terminal.
 * prdz_LogErr:Writes the function name, the accompanying text, and the error return code to the debug terminal.
 * prdz_ProfileInit:Initializes the Profile array.
 * prdz_ProfileTerm:Outputs the Profile array to a file.
 * prdz_SSALLOC:Allocates memory and writes the result to the debug terminal.
 * prdz_SSFREE:Frees the requested memory and writes the output to the debug terminal.
 * prdz_Term:Closes the trace file.
 * prdz_Trace:Outputs the trace message and the trace data to the trace file.
 * prdz_hex:Converts a long to a hexadecimal ASCII string.