home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / pascal2c / turbo.imp < prev   
Text File  |  1992-08-03  |  10KB  |  394 lines

  1.  
  2. { Turbo Pascal standard units.  For use with p2c. }
  3.  
  4. { Only partially complete! }
  5.  
  6.  
  7.  
  8.  
  9. {-------------------------------------------------------------------------}
  10.  
  11. unit printer;
  12.  
  13. interface
  14.  
  15. var
  16.    lst : text;
  17.  
  18. end;
  19.  
  20.  
  21.  
  22.  
  23. {-------------------------------------------------------------------------}
  24.  
  25. unit dos;
  26.  
  27. interface
  28.  
  29. const
  30.    FCarry     = $0001;     { 8086 flags }
  31.    FParity    = $0004;
  32.    FAuxiliary = $0010;
  33.    FZero      = $0040;
  34.    FSign      = $0080;
  35.    FOverflow  = $0100;
  36.  
  37.    fmClosed   = $D7B0;     { File modes }
  38.    fmInput    = $D7B1;
  39.    fmOutput   = $D7B2;
  40.    fmInOut    = $D7B3;
  41.  
  42.    ReadOnly  = $01;        { File attributes }
  43.    Hidden    = $02;
  44.    SysFile   = $04;
  45.    VolumeID  = $08;
  46.    Directory = $10;
  47.    Archive   = $20;
  48.    AnyFile   = $3F;
  49.  
  50.  
  51. type
  52.    PathStr = string[79];
  53.    DirStr = PathStr;
  54.    NameStr = string[8];
  55.    ExtStr = string[3];
  56.  
  57.    FileRec =
  58.       record
  59.          Handle: Word;
  60.          Mode: Word;
  61.          RecSize: Word;
  62.          Private: array [1..26] of Byte;
  63.          UserData: array [1..16] of Byte;
  64.          Name: array [0..79] of char;
  65.       end;
  66.  
  67.    TextBuf = array [0..127] of char;
  68.    TextRec =
  69.       record
  70.          Handle: Word;
  71.          Mode: Word;
  72.          BufSize: Word;
  73.          Private: Word;
  74.          BufPos: Word;
  75.          BufEnd: Word;
  76.          BufPtr: ^TextBuf;
  77.          OpenProc: Pointer;
  78.          InOutProc: Pointer;
  79.          FlushProc: Pointer;
  80.          CloseProc: Pointer;
  81.          UserData: array [1..16] of Byte;
  82.          Name: array [0..79] of char;
  83.          Buffer: TextBuf;
  84.       end;
  85.  
  86.    Registers =
  87.       record
  88.          case integer of
  89.             0: (AX,BX,CX,DX,BP,SI,DI,ES,Flags: word);
  90.             1: (AL,AH,BL,BH,CL,CH,DL,DH: byte);
  91.       end;
  92.  
  93.    DateTime =
  94.       record
  95.          Year, Month, Day, Hour, Min, Sec: word;
  96.       end;
  97.  
  98.    SearchRec =
  99.       record
  100.          Fill: array [1..21] of byte;
  101.          Attr: byte;
  102.          Time: longint;
  103.          Size: longint;
  104.          Name: string[12];
  105.       end;
  106.  
  107.  
  108. var
  109.    DosError: integer;
  110.  
  111. procedure GetTime(var hour, minute, second, csec : word);
  112. procedure GetDate(var year, month, day, dow : word);
  113. procedure FSplit(fn : PathStr; var dir, name, ext : string);
  114.  
  115. {WarnNames=1}
  116. procedure Exec(path, cmdLine : PathStr);
  117. {WarnNames}
  118.  
  119. end;
  120.  
  121.  
  122.  
  123.  
  124.  
  125. {-------------------------------------------------------------------------}
  126.  
  127. unit crt;
  128.  
  129. interface
  130.  
  131.  
  132. function KeyPressed : boolean;
  133. function ReadKey : char;
  134.  
  135. procedure ClrScr;
  136. procedure TextBackground(i : integer);
  137. procedure Window(a, b, c, d : integer);
  138.  
  139. var wherex, wherey : integer;
  140.  
  141. end;
  142.  
  143.  
  144.  
  145.  
  146.  
  147. {-------------------------------------------------------------------------}
  148.  
  149. unit graph;
  150.  
  151. interface
  152.  
  153. const
  154.   gr0k = 0;
  155.   grNoInitGraph      = -1;
  156.   grNotDetected      = -2;
  157.   grFileNotFound     = -3;
  158.   grInvalidDriver    = -4;
  159.   grNoLoadMem        = -5;
  160.   grNoScanMem        = -6;
  161.   grNoFloodMem       = -7;
  162.   grFontNotFound     = -8;
  163.   grNoFontMem        = -9;
  164.   grInvalidMode      = -10;
  165.   grError            = -11;
  166.   grIOerror          = -13;
  167.   grInvalidFontNum   = -14;
  168.  
  169.   Detect = 0;
  170.   CGA = 1;
  171.   MCGA = 2;
  172.   EGA = 3;
  173.   EGA64 = 4;
  174.   EGAMono = 5;
  175.   IBM8514 = 6;
  176.   HercMono = 7;
  177.   ATT400 = 8;
  178.   VGA = 9;
  179.   PC3270 = 10;
  180.   CurrentDriver = -128;
  181.  
  182.   CGAC0 = 0;
  183.   CGAC1 = 1;
  184.   CGAC2 = 2;
  185.   CGAC3 = 3;
  186.   CGAHi = 4;
  187.   MCGAC0 = 0;
  188.   MCGAC1 = 1;
  189.   MCGAC2 = 2;
  190.   MCGAC3 = 3;
  191.   MCGAMed = 4;
  192.   MCGAHi = 5;
  193.   EGALo = 0;
  194.   EGAHi = 1;
  195.   EGA64Lo = 0;
  196.   EGA64Hi = 1;
  197.   EGAMonoHi = 3;
  198.   HercMonoHi = 0;
  199.   ATT400C0 = 0;
  200.   ATT400C1 = 1;
  201.   ATT400C2 = 2;
  202.   ATT400C3 = 3;
  203.   ATT400Med = 4;
  204.   ATT400Hi = 5;
  205.   VGALo = 0;
  206.   VGAMed = 1;
  207.   VGAHi = 2;
  208.   PC3270Hi = 0;
  209.   IBM8514LO = 0;
  210.   IBM8514HI = 1;
  211.  
  212.   Black = 0;
  213.   Blue = 1;
  214.   Green = 2;
  215.   Cyan = 3;
  216.   Red = 4;
  217.   Magenta = 5;
  218.   Brown = 6;
  219.   LightGray = 7;
  220.   DarkGray = 8;
  221.   LightBlue = 9;
  222.   LightGreen = 10;
  223.   LightCyan = 11;
  224.   LightRed = 12;
  225.   LightMagenta = 13;
  226.   Yellow = 14;
  227.   White = 15;
  228.  
  229.   SolidLn = 0;
  230.   DottedLn = 1;
  231.   CenterLn = 2;
  232.   DashedLn = 3;
  233.   UserBitLn = 4;
  234.  
  235.   NormWidth = 1;
  236.   ThickWidth = 3;
  237.  
  238.  
  239. type
  240.   ArcCoordsType = record
  241.                     X, Y: integer;
  242.                     Xstart, Ystart: integer;
  243.                     Xend, Yend: integer;
  244.                   end;
  245.  
  246. const
  247.   MaxColors = 15;
  248. type
  249.   PaletteType = record
  250.                   Size: byte;
  251.                   Colors: array[0..MaxColors] of shortint;
  252.                 end;
  253.   FillPatternType = array[1..8] of byte;
  254.   FillSettingsType = record
  255.                        Pattern: word;
  256.                        Color: word;
  257.                      end;
  258.   LineSettingsType = record
  259.                        LineStyle: word;
  260.                        Pattern: word;
  261.                        Thickness: word;
  262.                      end;
  263.   TextSettingsType = record
  264.                        Font: word;
  265.                        Direction: word;
  266.                        CharSize: word;
  267.                        Horiz: word;
  268.                        Vert: word;
  269.                      end;
  270.   ViewPortType = record
  271.                    x1, y1, x2, y2: integer;
  272.                    Clip: boolean;
  273.                  end;
  274.  
  275. const
  276.   LeftText = 0;
  277.   CenterText = 1;
  278.   RightText = 2;
  279.   BottomText = 0;
  280.   TopText = 2;
  281.  
  282. const
  283.   ClipOn = true;
  284.   ClipOff = false;
  285.  
  286. const
  287.   EmptyFill = 0;
  288.   SolidFill = 1;
  289.   LineFill = 2;
  290.   LtSlashFill = 3;
  291.   SlashFill = 4;
  292.   BkSlashFill = 5;
  293.   LtBkSlashFill = 6;
  294.   HatchFill = 7;
  295.   XHatchFill = 8;
  296.   InterleaveFill = 9;
  297.   WideDotFill = 10;
  298.   CloseDotFill = 11;
  299.   UserFill = 17;
  300.  
  301. const
  302.   NormalPut = 0;
  303.   CopyPut = 0;
  304.   XORPut = 1;
  305.   OrPut = 2;
  306.   AndPut = 3;
  307.   NotPut = 4;
  308.  
  309.  
  310. procedure Arc(X, Y: integer; StAngle, EndAngle, Radius: word);
  311. procedure Bar(x1, y1, x2, y2: integer);
  312. procedure Bar3D(x1, y1, x2, y2: integer; Depth: word; Top: boolean);
  313. procedure Circle(X, Y: integer; Radius: word);
  314. procedure ClearDevice;
  315. procedure ClearViewPort;
  316. procedure CloseGraph;
  317. procedure DetectGraph(var GraphDriver, GraphMode: integer);
  318. procedure DrawPoly(NumPoints: word; var PolyPoints);
  319. procedure Ellipse(X, Y: integer; StAngle, EndAngle: word;
  320.                   XRadius, YRadius: word);
  321. procedure FillEllipse(X, Y: integer; XRadius, YRadius: word);
  322. procedure FillPoly(NumPoints: word; var PolyPoints);
  323. procedure FloodFill(x, y: integer; Border: word);
  324. procedure GetArcCoords(var ArcCoords: ArcCoordsType);
  325. procedure GetAspectRatio(var Xasp, Yasp: word);
  326. function GetBkColor: word;
  327. function GetColor: word;
  328. function GetDefaultPalette(var Palette: PaletteType): PaletteType;
  329. function GetDriverName: string;
  330. procedure GetFillPattern(var FillPattern: FillPatternType);
  331. procedure GetFillSettings(var FillInfo: FillSettingsType);
  332. function GetGraphMode: integer;
  333. procedure GetImage(x1, y1, x2, y2: integer; var BitMap);
  334. procedure GetLineSettings(var LineInfo: LineSettingsType);
  335. function GetMaxColor: word;
  336. function GetMaxMode: word;
  337. function GetMaxX: integer;
  338. function GetMaxY: integer;
  339. function GetModeName(ModeNumber: integer): string;
  340. procedure GetModeRange(GraphDriver: integer; var LoMode, HiMode: integer);
  341. procedure GetPalette(var Palette: PaletteType);
  342. function GetPaletteSize: integer;
  343. function GetPixel(X,Y: integer): word;
  344. procedure GetTextSettings(var TextInfo: TextSettingsType);
  345. procedure GetViewSettings(var ViewPort: ViewPortType);
  346. function GetX: integer;
  347. function GetY: integer;
  348. procedure GraphDefaults;
  349. function GraphErrorMsg(ErrorCode: integer): string;
  350. function GraphResult: integer;
  351. function ImageSize(x1, y1, x2, y2: integer): word;
  352. procedure InitGraph(var GraphDriver: integer; var GraphMode: integer;
  353.                     PathToDriver: string);
  354. function InstallUserDriver(Name: string; AutoDetectPtr: pointer): integer;
  355. function InstallUserFont(FontFileName: string): integer;
  356. procedure Line(x1, y1, x2, y2: integer);
  357. procedure LineRel(Dx, Dy: integer);
  358. procedure LineTo(x, y: integer);
  359. procedure MoveRel(Dx, Dy: integer);
  360. procedure MoveTo(x, y: integer);
  361. procedure OutText(TextString: string);
  362. procedure OutTextXY(X,Y: integer; TextString: string);
  363. procedure PieSlice(x, y: integer; StAngle, EndAngle, Radius: word);
  364. procedure PutImage(x, y: integer; var BitMap; BitBlt: word);
  365. procedure PutPixel(x, y: integer; Pixel: word);
  366. procedure Rectangle(x1, y1, x2, y2: integer);
  367. function RegisterBGIdriver(driver: pointer): integer;
  368. function RegisterBGIfont(font: pointer): integer;
  369. procedure RestoreCrtMode;
  370. procedure Sector(x, y: integer; StAngle, EndAngle, XRadius, YRadius: word);
  371. procedure SetActivePage(Page: word);
  372. procedure SetAllPalette(var Palette);
  373. procedure SetAspectRatio(Xasp, Yasp: word);
  374. procedure SetBkColor(ColorNum: word);
  375. procedure SetColor(Color: word);
  376. procedure SetFillPattern(Pattern: FillPatternType; Color: word);
  377. procedure SetFillStyle(Pattern: word; Color: word);
  378. procedure SetGraphBufSize(BufSize: word);
  379. procedure SetGraphMode(Mode: integer);
  380. procedure SetLineStyle(LineStyle: word; Pattern: word; Thickness: word);
  381. procedure SetPalette(ColorNum: word; Color: shortint);
  382. procedure SetRGBPalette(ColorNum, RedValue, GreenValue, BlueValue: integer);
  383. procedure SetTextJustify(Horiz, Vert: word);
  384. procedure SetTextStyle(Font: word; Direction: word; CharSize: word);
  385. procedure SetUserCharSize(MultX, DivX, MultY, DivY: word);
  386. procedure SetViewPort(x1, y1, x2, y2: integer; Clip: boolean);
  387. procedure SetVisualPage(Page: word);
  388. procedure SetWriteMode(WriteMode: integer);
  389. function TextHeight(TextString: string): word;
  390. function TextWidth(TextString: string): word;
  391.  
  392.  
  393. end;
  394.