home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / clipper / nettos11.zip / MISC / IPXINIT.PRG < prev    next >
Text File  |  1993-04-02  |  2KB  |  97 lines

  1. /*
  2.  *   File......: IPXInit.Prg
  3.  *   Author....: Sheldon Easterbrook
  4.  *   CIS ID....: 71421,254
  5.  *   Date......: $Date$
  6.  *   Revision..: $Revision$
  7.  *   Log File..: $LogFile$
  8.  *
  9.  *   This is an original work by Sheldon Easterbrook and is placed in the
  10.  *   Public Domain
  11.  *
  12.  *   Modification History:
  13.  *   ---------------------
  14.  *
  15.  *   $Log$
  16.  */
  17.  
  18.  
  19. /*  $DOC$
  20.  *  $FUNCNAME$
  21.  *     Fn_IPXInit()
  22.  *  $CATEGORY$
  23.  *     Miscellaneous
  24.  *  $ONELINER$
  25.  *      This function gets the entry address for the IPX interface.
  26.  *  $SYNTAX$
  27.  *
  28.  *      Fn_IPXInit() -> lInit
  29.  *
  30.  *  $ARGUMENTS$
  31.  *
  32.  *  $RETURNS$
  33.  *
  34.  *      <lInit> - Whether IPX has been initialised.  If <lInit> is false
  35.  *      check Fn_Error() for the error code which could be one of:
  36.  *
  37.  *       [ Error codes here ]
  38.  *
  39.  *  $DESCRIPTION$
  40.  *
  41.  *      This function initializes an array in the library
  42.  *      with the address of the IPX services. This function must be
  43.  *      called before any of the IPX functions in this library can be
  44.  *      performed.
  45.  *
  46.  *      [This function is meant to be part of a larger suite but 
  47.  *      the code wasn't ready by the release date.  In its present
  48.  *      form, it can be used to determine if IPX is installed, 
  49.  *      which might be useful.]
  50.  *
  51.  *  $EXAMPLES$
  52.  *
  53.  *      If ( Fn_IPXInit())
  54.  *          ? "IPX installed"
  55.  *      EndIf
  56.  *
  57.  *  $SEEALSO$
  58.  *      
  59.  *  $INCLUDE$
  60.  *
  61.  *  $END$
  62.  */
  63.  
  64. #include "ftint86.ch"
  65. #include "netto.ch"
  66.  
  67. static aIPXLocn := { 0, 0 }
  68.  
  69. /* ----------------------------------------------------------------- */
  70.  
  71. function fn_ipxInit()
  72.    local aReg[ 10 ], lRet := .f.
  73.  
  74.    aIpxLocn[ 1 ] := 0
  75.    aIpxLocn[ 2 ] := 0
  76.  
  77.    aReg[ AX ]    := ft_hex2dec( "7a00" )
  78.  
  79.    if ft_int86( ft_hex2dec( "2f" ), aReg ) 
  80.       if lowbyte( aReg[ AX ] ) == 0
  81.          _fnSetErr( ft_hex2dec( "F0" ) )
  82.       else
  83.          aIPXLocn[ 1 ] := aReg[ DI ]
  84.          aIPXLocn[ 2 ] := aReg[ ES ]
  85.          lRet := .t.
  86.       endif
  87.    else
  88.       _fnSetErr( EINT86 )
  89.    endif
  90.  
  91.    return lRet
  92.  
  93. /* ----------------------------------------------------------------- */
  94.  
  95. function _fnipxLoc()
  96.    return aclone( aIPXLocn )
  97.