home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cenvi23.zip / PORTIO.LIB < prev    next >
Text File  |  1995-10-12  |  1KB  |  37 lines

  1. // PortIO.lib - Beginning with version 2.00 of CEnvi for OS/2
  2. // ver.2        the inport and outport functions stopped working.
  3. //              This file remedies that problem.  If a Cmm script
  4. //              first includes this lib file, and if CENVI2IO.DLL
  5. //              is in a LIBPATH directory, then the port routines
  6. //              may be called.  These functions match the
  7. //              protocols as defined in the OS/2 library chapter
  8. //              of the CEnvi manual. Not that this file must
  9. //              be in the same directory as the CEnvi executable.
  10. //
  11.  
  12. // initiliaze full path and directory for the DLL, which must be
  13. // in the same directory as the CEnvi executable
  14. sprintf(gCENVI2IO_DLLpath,"%s%s",SplitFileName(_argv[-1]).dir,"CENVI2IO.DLL");
  15.  
  16. inport(pPortID)
  17. {
  18.    lRet = DynamicLink(gCENVI2IO_DLLpath,"INPORT",BIT16,CDECL,pPortID);
  19.    return 0xFF & lRet;
  20. }
  21.  
  22. inportw(pPortID)
  23. {
  24.    lRet = DynamicLink(gCENVI2IO_DLLpath,"INPORTW",BIT16,CDECL,pPortID);
  25.    return 0xFFFF & lRet;
  26. }
  27.  
  28. outport(pPortID,pValue)
  29. {
  30.    DynamicLink(gCENVI2IO_DLLpath,"OUTPORT",BIT16,CDECL,pPortID,pValue);
  31. }
  32.  
  33. outportw(pPortID,pValue)
  34. {
  35.    DynamicLink(gCENVI2IO_DLLpath,"OUTPORTW",BIT16,CDECL,pPortID,pValue);
  36. }
  37.