
DEFINITION MODULE DCLInterface;

(* Author:         Andrew Trevorrow
   Implementation: University of Hamburg Modula-2 under VAX/VMS version 4
   Date Started:   June, 1985

   Description:
   Exports the DVI file name and qualifier values given in the
   DVItoVDU command line.

   Revised:
   September, 1986
 - No longer export Translate routine.

   November, 1987
 - Added tfmdir qualifier that indicates the default location of TFM files.
   This allows DVItoVDU to handle PostScript fonts for which no pixel files
   exist.

   June--August, 1988 (while at Aston University)
 - Added psprefix qualifier that specifies the prefix in TFM file names
   for PostScript fonts.
 - Added hoffset and voffset qualifiers to allow shifting of page.

   November, 1988 (Niel Kempson <tex@uk.ac.cranfield.rmcs>,
		  RMCS Shrivenham, SWINDON SN6 8LA, United Kingdom)
 - Added new TYPEs for use with SYS$TRNLNM.
 - Removed /FONT_DIRECTORY qualifier.
 - Added /PK_FONT_DIRECTORY & /PXL_FONT_DIRECTORY qualifiers.

   December, 1988
 - Added /XORIGIN & /YORIGIN qualifiers to incorporate changes made by 
   Phil Taylor (CHAA006@UK.AC.RHBNC.VAXB).

   April, 1990 (Brian {Hamilton Kelly} <tex@uk.ac.cranfield.rmcs>,
		  RMCS Shrivenham, SWINDON SN6 8LA, United Kingdom)
 - Added facilities for extracting qualifiers with and without logical
   name translation.

*)

  FROM SYSTEM IMPORT 
                     	SHORTWORD;

  EXPORT QUALIFIED
         	stringvalue, vdu, paperwd, paperht, hoffset, voffset,
		xorigin, yorigin,
		helpname, DVIname, psprefix, tfmdir, PKfontdir, PKfontPfx,
		PXLfontdir, PXLfontPfx, dummyfont, mag, resolution, Cap;

  TYPE
    (* DO NOT make stringvalue an array of [0..255] or parts of the MODULA
       run time library will stop working! 
       A module known to be affected is FileSystem.Parse which adds 1 to
       HIGH(string) and puts the result in a BYTE field. BYTE(255+1) = 0 !!
    *)
    stringvalue = ARRAY [0..254] OF CHAR;

    VMSItemListPtr = POINTER TO VMSItemList;
    VMSItemList = 
      RECORD
        CASE BOOLEAN OF
          FALSE:  BufferLength : SHORTWORD;
            	  ItemCode : SHORTWORD;
                  BufferAddress : POINTER TO stringvalue;
                  RetLenAddress : POINTER TO CARDINAL;
        | TRUE:   NullItem : CARDINAL;
        END;
     END;

  VAR
    resolution, (* /RESOLUTION value defines pixels per inch               *)
    mag,	(* /MAGNIFICATION value replaces DVI mag; 0 = use DVI mag  *)
    paperwd,	(* /XSIZE value defines paper width; converted to pixels   *)
    paperht	(* /YSIZE value defines paper height; converted to pixels  *)
      : CARDINAL;
    xorigin,	(* /XORIGIN value is the TeX page x origin - usually 1in   *)
    yorigin,	(* /YORIGIN value is the TeX page y origin - usually 1in   *)
    hoffset,	(* /HOFFSET value is the horizontal shift in pixels	   *)
    voffset	(* /VOFFSET value is the horizontal shift in pixels	   *)
      : INTEGER;
    psprefix,	(* /PSPREFIX value defines TFM files for Postscript fonts  *)
    tfmdir,	(* /TFM_DIRECTORY value defines location of TFM files      *)
    PKfontdir,	(* /PK_FONT_DIRECTORY value defines location of PK fonts   *)
    PKfontPfx,	(* /PK_FONT_DIRECTORY value without logical name translated*)
    PXLfontdir,	(* /PXL_FONT_DIRECTORY value defines location of PXL fonts *)
    PXLfontPfx,	(* /PXL_FONT_DIRECTORY value w/o logical name translated   *)
    dummyfont,	(* /DUMMY_FONT value defines dummy font file               *)
    helpname,	(* /HELP_FILE value defines help file read by ? command    *)
    vdu,	(* /VDU value tells DVItoVDU what terminal is being used   *)
    DVIname	(* DVI file specification                                  *)
      : stringvalue;

  PROCEDURE Cap (ch : CHAR) : CHAR;
(* If ch is in 'a'..'z' then return capitalized version, else return ch. *)

END DCLInterface.
