home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rexxne.zip / REXXNET.TXT < prev    next >
Text File  |  1993-09-13  |  3KB  |  121 lines

  1. REXXNET.DLL
  2.  
  3. Description
  4. RexxNet.DLL is a DLL that supports the Lan Server APIs from Rexx. 
  5. The APIs are replicated to match the standard 'C' call interface
  6. (with a few exceptions, enhancements).  It can be used from OS/2
  7. 1.3 or OS/2 2.x and Lan Server 3.0.
  8.  
  9. DLL Usage
  10. The DLL is used by registering and calling the function
  11. NetLoadFuncs.  When completed, then functions can be dropped by
  12. calling NetDropFuncs.
  13.  
  14. /* REXX */
  15.  
  16. call rxfuncadd 'NetLoadFuncs', 'RexxNet', 'NetLoadFuncs'
  17. call NetLoadFuncs
  18.  
  19. ...
  20.  
  21. call NetDropFuncs
  22. exit
  23.  
  24. API Function Usage
  25. All the APIs callable use the standard 'C' call interface with
  26. the following exceptions:
  27. Any 'buflen' parameter is ignored (and should be omitted if other
  28. fields follow) as the REXX interface has no length limit.
  29. The 'entriesread' parameter is returned as 'Buf.Entries' and any
  30. variable passed is ignored.
  31. The 'totalavail' parameter is ignored and never returned, as the
  32. REXX functions always return the total amount (ie totalavail ==
  33. entriesread and Error 234 should never happen)
  34. All 'reserved' parameter are ignored, but leading reserved
  35. parameters must still be passed.
  36. The 'buf' parameter should be a stem variable.  The values passed
  37. in and returned as the structure field names (ignoring the
  38. leading structure-level identifing code).
  39. If the function called is an Enum function, then Buf.Entries will
  40. contain how many structures were returned and Buf.0.xxx to
  41. Buf.n.xxx will contain the returned structures
  42.  
  43.  
  44. ie the use_info_0 structure is as follows:
  45.      struct use_info_0 { REXX
  46.           ui0_local[DEVLEN + 1]    stem.Local
  47.           ui0_pad   not returned
  48.           ui0_remote     stem.Remote
  49.      }
  50.  
  51. /* REXX */
  52.  
  53. call rxfuncadd 'NetLoadFuncs', 'RexxNet', 'NetLoadFuncs'
  54. call NetLoadFuncs
  55.  
  56. retc = NetUseGetInfo('', 'H:', 1, 'Buf')
  57.  
  58. say Buf.Local '-->' Buf.Remote
  59.  
  60. Buf.Local = 'Z:'
  61. Buf.Remote = '\\Server\Sharename'
  62. Buf.AsgType = 0
  63. Buf.Password = ''
  64.  
  65. retc = NetUseAdd('', 1, 'Buf')
  66. if retc \= 0 then
  67.      say 'Error:' retc NetGetMessage(retc, "NET.MSG")
  68.  
  69. retc = NetUseEnum('', 0, 'Info')
  70.  
  71. do i = 0 to Info.Entries - 1
  72.      say Info.i.Local '-->' Info.i.Remote
  73. end
  74.  
  75. Additional Functions Supplied
  76. For each group of Lan Server APIs there is an additional Info
  77. function that returns a stem variable containing all the field
  78. names for the given level of structure.
  79.  
  80.      NetxxxInfo(level, stem)
  81.  
  82. ie call NetUseInfo(1, 'Info')
  83. would return the following
  84.      Info.0 = 7
  85.      Info.1 = 'Local'
  86.      Info.2 = 'Remote'
  87.      Info.3 = 'Password'
  88.      Info.4 = 'Status'
  89.      Info.5 = 'Asg_Type'
  90.      Info.6 = 'RefCount'
  91.      Info.7 = 'UseCount'
  92.  
  93. Also the function:
  94.      int NetGetMessage(errcode, Messagefile)
  95.  
  96. is supplied.  This is the DosGetMessage API from OS/2 and will
  97. return the String message associated with the errcode from the
  98. given message file.  If no messagefile is given then OSO001.MSG
  99. is used.  The Net functions will return an error code >2100 if a
  100. network error occured, and if so 'NET.MSG' can be used as the
  101. messagefile for the standard error message.
  102.  
  103. Supported APIs
  104. The following is the list of API groups currently supported:
  105.  
  106.      NetUse
  107.      NetUser
  108.      NetGroup
  109.      NetAlias
  110.      NetDomain (NetGetDCName and NetLogonEnum)
  111.      NetWksta  (All except NetWkstaSetUID2)
  112.      NetErrorLog
  113.      NetAccess
  114.      NetShare
  115.      NetApp
  116.      NetService
  117.      upmeulgn and upmeulgn
  118.      NetGetMessage
  119.  
  120.  
  121.