home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / os2prgc.zip / comm.h < prev    next >
Text File  |  1995-03-06  |  3KB  |  72 lines

  1. /*****************************************************************************
  2.  
  3.   COMM.H -- Sample code for handling a comm port, character I/O based.
  4.   Copyright (C) 1993,94,95 by Craig Morrison, All Rights Reserved.
  5.  
  6.   You may use this code in your own projects, regardless of renumeration.
  7.   All I ask is that you prominently display the above copyright notice.
  8.  
  9.   Should you need assistance, I can be contacted at the following addresses:
  10.  
  11.         Fidonet:        Craig Morrison, 1:201/60@fidonet.org
  12.         Internet:       cam@wpc.cioe.com
  13.         Post:           Craig Morrison
  14.                         1316 Ferry St.
  15.                         Lafayette, IN 47901-1533
  16.                         USA
  17.  
  18.   NOTES:
  19.  
  20.     You'll notice the complete lack of any references to run-time
  21.     library functions. This was done on purpose so that *I* could
  22.     control what happens when a thread gets killed. This package
  23.     contains just about everything you'll need to do comm port/file
  24.     I/O, string manipulation and ordinal number conversions.
  25.  
  26.  *****************************************************************************/
  27.  
  28. #define SINGLE_LINE_BOX             0
  29. #define DOUBLE_LINE_BOX             1
  30. #define DOUBLE_TOP_BOX              2
  31. #define DOUBLE_SIDE_BOX             3
  32. #define NO_IBMCHAR_BOX              4
  33. #define SPACE_BOX                   5
  34.  
  35. typedef struct _MODEDATA {
  36.         USHORT cb;
  37.         UCHAR  fbType;
  38.         UCHAR  color;
  39.         USHORT col;
  40.         USHORT row;
  41.         USHORT hres;
  42.         USHORT vres;
  43.         } MODEDATA;
  44. typedef MODEDATA FAR16PTR PMODEDATA;
  45.  
  46. BOOL CarrierDetect(HFILE port);
  47. VOID ReadPortData(PVOID p);
  48. INT CharFromPort(HFILE port);
  49. void comPrint(char *s, HFILE port);
  50. BOOL GetNString(PSZ s, INT l, HFILE port);
  51. VOID comGotoXY(HFILE port, PSZ x, PSZ y);
  52. VOID comClrEol(HFILE port);
  53. VOID comCursorRight(HFILE port, PSZ cbMove);
  54. VOID comCursorLeft(HFILE port, PSZ cbMove);
  55. VOID comCursorUp(HFILE port, PSZ cbMove);
  56. VOID comCursorDown(HFILE port, PSZ cbMove);
  57. VOID comSaveCursorPos(HFILE port);
  58. VOID comRestoreCursorPos(HFILE port);
  59. VOID comClearScreen(HFILE port);
  60. VOID comSetAttributes(HFILE port, PSZ attr, PSZ fg, PSZ bg);
  61. VOID DisplayBox(HFILE port, INT x, INT y, INT cx, INT cy, INT bType,
  62.                 BOOL filled);
  63. ULONG vidGetConsoleXY(VOID);
  64. USHORT vidGetConsoleMode(VOID);
  65. USHORT vidSetConsoleMode(USHORT modeIndex);
  66. VOID vidStrAtWAttr(INT x, INT y, PSZ s, CHAR attr);
  67. VOID vidStrAt(INT x, INT y, PSZ s);
  68. VOID vidStr(PSZ s);
  69. VOID vidSetCursorPos(USHORT col, USHORT row);
  70. ULONG vidGetCursorPos(VOID);
  71. ULONG kbdGetKey(USHORT ioWait);
  72.