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

  1. /*
  2.  * File......: ISNET.PRG
  3.  * Author....: Michael Landesman
  4.  * CIS ID....: 76376,2465
  5.  * Date......: $Date$
  6.  * Revision..: $Revision$
  7.  * Log file..: $Logfile$
  8.  * 
  9.  * This is an original work by Michael Landesman 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_isNet()
  22.  *  $CATEGORY$
  23.  *     Miscellaneous
  24.  *  $ONELINER$
  25.  *     Determine if user is on functioning NetWare node
  26.  *  $SYNTAX$
  27.  *
  28.  *     fn_isNet() -> nStatus
  29.  *
  30.  *  $ARGUMENTS$
  31.  *
  32.  *     None
  33.  *
  34.  *  $RETURNS$
  35.  *
  36.  *     <nStatus>, a numeric, which will be one of:
  37.  *
  38.  *           0     User has shell loaded and is logged in
  39.  *           1     User hasn't loaded IPX
  40.  *           2     User hasn't loaded a shell
  41.  *           3     User is not attached to a server
  42.  *           4     User has no connection id (?)
  43.  *           5     User is not logged in
  44.  *
  45.  *
  46.  *  $DESCRIPTION$
  47.  *
  48.  *     fn_isNet() provides a simple way to determine if the user
  49.  *     running your program is logged in.  if fn_isNet() == 0, 
  50.  *     she's in.
  51.  *
  52.  *  $EXAMPLES$
  53.  *
  54.  *     if !fn_isNet()
  55.  *        qout( "This program requires Novell NetWare." )
  56.  *     endif
  57.  *
  58.  *     if fn_isNet()
  59.  *        qout( "This is not a network version!" )
  60.  *        ft_reboot()   // Take that!
  61.  *     endif
  62.  *
  63.  *  $SEEALSO$
  64.  *     fn_netver(), fn_is3x()
  65.  *  $END$
  66.  */
  67.  
  68. #include "netto.ch"
  69.  
  70. #define in_NETOK        0
  71. #define in_NOIPX        1
  72. #define in_NOSHELL      2
  73. #define in_NOSERVER     3
  74. #define in_NOCONNECTION 4
  75. #define in_NOTLOGGEDIN  5
  76.  
  77. function fn_isNet()
  78.    do case
  79.      case !( fn_ipxInit() )
  80.         return in_NOIPX
  81.      case ( fn_shVer() == "" )
  82.         return in_NOSHELL
  83.      case ( fn_fsname()[1] == "" )
  84.         return in_NOSERVER
  85.      case ( fn_connID()[1][9] == 255 )
  86.         return in_NOCONNECTION
  87.      case ( fn_connInfo()[3] )
  88.         return in_NOTLOGGEDIN
  89.    otherwise
  90.      return in_NETOK
  91.    end case
  92.  
  93.    return nil
  94.