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

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