home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / progmisc / nfsrc21.zip / NWLSTAT.PRG < prev    next >
Text File  |  1991-08-16  |  2KB  |  84 lines

  1. /*
  2.  * File......: NWLSTAT.PRG
  3.  * Author....: Glenn Scott
  4.  * Date......: $Date:   15 Aug 1991 23:06:04  $
  5.  * Revision..: $Revision:   1.2  $
  6.  * Log file..: $Logfile:   E:/nanfor/src/nwlstat.prv  $
  7.  * 
  8.  * This is an original work by Glenn Scott and is placed in the
  9.  * public domain.
  10.  *
  11.  * Modification history:
  12.  * ---------------------
  13.  *
  14.  * $Log:   E:/nanfor/src/nwlstat.prv  $
  15.  * 
  16.  *    Rev 1.2   15 Aug 1991 23:06:04   GLENN
  17.  * Forest Belt proofread/edited/cleaned up doc
  18.  * 
  19.  *    Rev 1.1   12 Jun 1991 02:19:46   GLENN
  20.  * Documentation correction and check for compatibility with new return
  21.  * value for ft_int86().
  22.  * 
  23.  *    Rev 1.0   01 Apr 1991 01:01:54   GLENN
  24.  * Nanforum Toolkit
  25.  *
  26.  */
  27.  
  28.  
  29. /*  $DOC$
  30.  *  $FUNCNAME$
  31.  *     FT_NWLSTAT()
  32.  *  $CATEGORY$
  33.  *     NetWare
  34.  *  $ONELINER$
  35.  *     Return the current Novell NetWare logical station number
  36.  *  $SYNTAX$
  37.  *     FT_NWLSTAT() -> nStatNum
  38.  *  $ARGUMENTS$
  39.  *     None
  40.  *  $RETURNS$
  41.  *     A numeric corresponding to the current logical station number
  42.  *     assigned by NetWare. 
  43.  *  $DESCRIPTION$
  44.  *     In order to find out information about a particular node logged
  45.  *     in to a NetWare server, you will need the logical 
  46.  *     station number, also known as a "connection number."  This 
  47.  *     function will return that number.  This will be a number from 1 to 100
  48.  *     under NetWare 286, or from 1 to 250 under NetWare 386.  This is *not*
  49.  *     the same as a physical station number.
  50.  *
  51.  *     This function requires FT_INT86().
  52.  *
  53.  *     This function does NOT test for the existence of the NetWare shell.  
  54.  *     The behavior is undefined if no shell is loaded. 
  55.  *  $EXAMPLES$
  56.  *     QOut( "Logical station: " + str( FT_NWLSTAT() ) )
  57.  *  $END$
  58.  */
  59.  
  60. #include "FTINT86.CH"
  61.  
  62. #define DOS         33
  63. #define STATNUM    220
  64.  
  65. #ifdef FT_TEST
  66.   FUNCTION MAIN()
  67.   QOut( "Logical station: " + str( FT_NWLSTAT() ) )
  68.   return ( nil )
  69. #endif
  70.  
  71. FUNCTION FT_NWLSTAT()
  72.   LOCAL aRegs[ INT86_MAX_REGS ]
  73.   LOCAL nStation
  74.  
  75.   aRegs[ AX ] = MAKEHI( STATNUM )
  76.   FT_INT86( DOS, aRegs )
  77.  
  78.   nStation := LOWBYTE( aRegs[ AX ] )
  79.   if nStation < 0
  80.     nStation += 256
  81.   endif
  82.  
  83.   RETURN nStation
  84.