home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / MISC / PBAPI10.ZIP / APIDOCS.ZIP / MCONF.DOC < prev    next >
Text File  |  1998-02-21  |  14KB  |  358 lines

  1. Author....... : Gary Price
  2. Copyrighted by: Freejack's Software 1997-98
  3.  
  4. MCONF_DAT API for TriBBS v10.x/11.x written in PowerBasic v3.5
  5. ---------------------------------------------------------------------------
  6.  
  7. The MCONF_DAT unit is used to manipulate data in the MCONF.DAT data file
  8. found in node 1's MWORK directory. The MCONF_DAT unit is declared in
  9. PBAPI10.INC as follows:
  10.  
  11. NetworkBit.bit1 & NetworkBit.bit2 BIT Assignments:
  12.  TriBBS allows a sysop to add up to 16 different Networks.
  13.  Depending on the bit position 0 or 1, means that a certain Message
  14.  Conference belongs to a certain network.
  15.  
  16. NetworkBit.bit1 BIT Assignment:
  17.     0 = Points to network name defined in Network.dat  0 = No, 1 = Yes
  18.     1 = Points to network name defined in Network.dat  0 = No, 1 = Yes
  19.     2 = Points to network name defined in Network.dat  0 = No, 1 = Yes
  20.     3 = Points to network name defined in Network.dat  0 = No, 1 = Yes
  21.     4 = Points to network name defined in Network.dat  0 = No, 1 = Yes
  22.     5 = Points to network name defined in Network.dat  0 = No, 1 = Yes
  23.     6 = Points to network name defined in Network.dat  0 = No, 1 = Yes
  24.     7 = Points to network name defined in Network.dat  0 = No, 1 = Yes
  25. NetworkBit.bit2 BIT Assignment:
  26.     0 = Points to network name defined in Network.dat  0 = No, 1 = Yes
  27.     1 = Points to network name defined in Network.dat  0 = No, 1 = Yes
  28.     2 = Points to network name defined in Network.dat  0 = No, 1 = Yes
  29.     3 = Points to network name defined in Network.dat  0 = No, 1 = Yes
  30.     4 = Points to network name defined in Network.dat  0 = No, 1 = Yes
  31.     5 = Points to network name defined in Network.dat  0 = No, 1 = Yes
  32.     6 = Points to network name defined in Network.dat  0 = No, 1 = Yes
  33.     7 = Points to network name defined in Network.dat  0 = No, 1 = Yes
  34.  
  35. Sub Type Structure for Network Flag BitFields
  36. TYPE NetworkBit
  37.   bit1  AS BYTE
  38.   bit2  AS BYTE
  39. END TYPE
  40.  
  41. ---------------------------------------------------------------------------
  42.  
  43. Mconf.dat BitFields Breakdown
  44.  
  45. MconfBit.bit1 BIT Assignment
  46.     0 = NetworkedConferenceFlag                  0 = No, 1 = Yes
  47.     1 = PrivateConferenceFlag                    0 = No, 1 = Yes
  48.     2 = FidoStyleNetMailFlag                     0 = No, 1 = Yes
  49.     3 = AliasConferenceFlag                      0 = No, 1 = Yes
  50.     4 = UserDeleteFlag                           0 = Not Allowed, 1 = Allowed
  51.     5 = TriPackBackupFlag                        0 = No, 1 = Yes
  52.     6 = DisablePrivateMessagesFlag               0 = Yes, 1 = No
  53.     7 = DisablePublicMessagesFlag                0 = Yes, 1 = No
  54.  
  55. NOTE!
  56.  MconfBit.bit6 & MconfBit.bit7 both can be set to Yes, but only one may be
  57.  set to No, with the other set to Yes.
  58.  
  59.  MconfBit.bit2 to MconfBit.bit10 - All bits are set to 0  (Reserved)
  60.  
  61. Sub Type Structure for 10 byte BitFields
  62. TYPE MconfBit
  63.   bit1  AS BYTE
  64.   bit2  AS BYTE
  65.   bit3  AS BYTE
  66.   bit4  AS BYTE
  67.   bit5  AS BYTE
  68.   bit6  AS BYTE
  69.   bit7  AS BYTE
  70.   bit8  AS BYTE
  71.   bit9  AS BYTE
  72.   bit10 AS BYTE
  73. END TYPE
  74.  
  75. ---------------------------------------------------------------------------
  76.  
  77. File Name: "MCONF.DAT"
  78. TYPE MCONF
  79.   ConfName                  AS STRING * 41
  80.   ReadSecurityLevel         AS INTEGER
  81.   PostSecurityLevel         AS INTEGER
  82.   TriPackNumberOfDaysToSave AS INTEGER
  83.   HighestMessageNumber      AS LONG
  84.   NetworkBitFields          AS NetworkBit
  85.   MconfBitFields            AS MconfBit
  86.   ReservedDataArea          AS STRING * 961
  87. END TYPE
  88.  
  89. DIM MconfBit AS MconfBit   
  90. DIM MCONF    AS SHARED MCONF
  91. DIM mc       AS SHARED MCONF PTR
  92.  
  93. mc = VARPTR32(MCONF)
  94. LSET MCONF = MCONF  
  95. ---------------------------------------------------------------------------
  96.  
  97. FUNCTION's below are from the MCONF.PBU Unit and DECLAREd in PBAPI10.INC.
  98.  
  99. FUNCTION MCONF_DAT_OPEN()
  100. FUNCTION MCONF_DAT_CLOSE()
  101. FUNCTION MCONF_DAT_READ(n AS INTEGER)
  102. FUNCTION MCONF_DAT_WRITE(n AS INTEGER)
  103. FUNCTION MCONF_DAT_Length() AS LONG
  104. FUNCTION MCONF_DAT_OpenRead(n AS INTEGER)
  105. FUNCTION MCONF_DAT_WriteClose(n AS INTEGER)
  106. FUNCTION MCONF_DAT_OpenReadClose(n AS INTEGER)
  107. FUNCTION MCONF_DAT_OpenWriteClose(n AS INTEGER)
  108. FUNCTION MCONF_DAT_Clearit(n AS INTEGER)
  109.  
  110. FUNCTION MCONF_DAT_GetMCN() AS STRING
  111. FUNCTION MCONF_DAT_PutMCN(s AS STRING)
  112. FUNCTION MCONF_DAT_GetNWCN() AS STRING
  113. FUNCTION MCONF_DAT_GetRSL() AS INTEGER
  114. FUNCTION MCONF_DAT_PutRSL(n AS INTEGER)
  115. FUNCTION MCONF_DAT_GetPSL() AS INTEGER
  116. FUNCTION MCONF_DAT_PutPSL(n AS INTEGER)
  117. FUNCTION MCONF_DAT_GetTPNODTS() AS INTEGER
  118. FUNCTION MCONF_DAT_PutTPNODTS(n AS INTEGER)
  119. FUNCTION MCONF_DAT_GetHMN() AS LONG
  120. FUNCTION MCONF_DAT_PutHMN(n AS LONG)
  121. FUNCTION MCONF_DAT_GetNWF(nw AS INTEGER) AS INTEGER
  122. FUNCTION MCONF_DAT_PutNWF(nw AS INTEGER, n AS INTEGER)
  123.  
  124. FUNCTION MCONF_DAT_GetNWCF() AS INTEGER
  125. FUNCTION MCONF_DAT_PutNWCF(n AS INTEGER)
  126. FUNCTION MCONF_DAT_GetPCF() AS INTEGER
  127. FUNCTION MCONF_DAT_PutPCF(n AS INTEGER)
  128. FUNCTION MCONF_DAT_GetFSNM() AS INTEGER
  129. FUNCTION MCONF_DAT_PutFSNM(n AS INTEGER)
  130. FUNCTION MCONF_DAT_GetACF() AS INTEGER
  131. FUNCTION MCONF_DAT_PutACF(n AS INTEGER)
  132. FUNCTION MCONF_DAT_GetUDF() AS INTEGER
  133. FUNCTION MCONF_DAT_PutUDF(n AS INTEGER)
  134. FUNCTION MCONF_DAT_GetTPBF() AS INTEGER
  135. FUNCTION MCONF_DAT_PutTPBF(n AS INTEGER)
  136. FUNCTION MCONF_DAT_GetDPriM() AS INTEGER
  137. FUNCTION MCONF_DAT_PutDPriM(n AS INTEGER)
  138. FUNCTION MCONF_DAT_GetDPubM() AS INTEGER
  139. FUNCTION MCONF_DAT_PutDPubM(n AS INTEGER)
  140.  
  141. ---------------------------------------------------------------------------
  142. IMPORTANT: TBNode1sMainDirectory must be set to node 1's main directory
  143.            before calling to any Function with the "OPEN" command in it. 
  144.  
  145. MCONF_DAT_Open
  146.  The MCONF_DAT_Open Function opens the MCONF.DAT data file in node 1's MWORK
  147.  directory.
  148.  
  149. MCONF_DAT_Close
  150.  The MCONF_DAT_Close Function closes the MCONF.DAT data file in node 1's MWORK
  151.  directory.
  152.  
  153. MCONF_DAT_Read(n AS INTEGER)
  154.  The MCONF_DAT_Read Function reads the record for message conference "n" into
  155.  memory.
  156.  
  157. MCONF_DAT_Write(n AS INTEGER)
  158.  The MCONF_DAT_Write Function updates the record for message conference "n"
  159.  from memory.
  160.  
  161. MCONF_DAT_Length() AS LONG
  162.  The MCONF_DAT_Length Function returns the number of records in the MCONF.DAT
  163.  file.
  164.  
  165. MCONF_DAT_OpenRead(n AS INTEGER)
  166.  The MCONF_DAT_OpenRead Function provides the Functionality of the
  167.  MCONF_DAT_Open and MCONF_DAT_Read Functions in a single Function call.
  168.  
  169. MCONF_DAT_WriteClose(n AS INTEGER)
  170.  The MCONF_DAT_WriteClose Function provides the Functionality of the
  171.  MCONF_DAT_Write and MCONF_DAT_Close Functions in a single Function call.
  172.  
  173. MCONF_DAT_OpenReadClose(n AS INTEGER)
  174.  The MCONF_DAT_OpenReadClose Function provides the Functionality of the
  175.  MCONF_DAT_Open, MCONF_DAT_Read, and MCONF_DAT_Close Functions in a single
  176.  Function call.
  177.  
  178. MCONF_DAT_OpenWriteClose(n AS INTEGER)
  179.  The MCONF_DAT_OpenWriteClose Function provides the Functionality of the
  180.  MCONF_DAT_Open, MCONF_DAT_Write, and MCONF_DAT_Close Functions in a single
  181.  Function call.
  182.  
  183. MCONF_DAT_ClearIt(n AS INTEGER)
  184.  The MCONF_DAT_ClearIt Function sets the entire MCONF_DAT data record to all
  185.  zeros for record 'n', leaving the data record in place, but empty.
  186.  
  187. -----------------------------------------------------------------------------
  188. POINTERS Uses a hidden variable I use called "@mc". Any reference to this is
  189. only for your information for discussion in this doc file. You will not need
  190. to concern yourself trying to use this.. All calls are handled in the main
  191. MCONF.PBU Unit by my routines automatically. In other words, I am trying to
  192. keep Pointers as easy as possible for your use. :)
  193.  
  194. Also, all calls to any Functions which gets data with the string routines
  195. will auto-trim each string's extra spaces and the null terminator, CHR$(0),
  196. off so printing will be easier for you to manipulate. When calling the string
  197. routines to put data back into the string space, all string data will be
  198. resized to fit the MCONF.dat type structure and will add the null terminator
  199. back to the end of the string. Just remember, when working the data in memory
  200. with the pointer calls, you still have to write the data back to the MCONF.dat
  201. in order for the changes to become permanent.
  202.  
  203. -----------------------------------------------------------------------------
  204.  
  205. MCONF_DAT_GetMCN() AS STRING
  206.  This form of the MCONF_DAT_GetMCN function returns a pointer to the
  207.  conference's name string.
  208.  
  209. MCONF_DAT_PutMCN(s AS STRING)
  210.  This form of the MCONF_DAT_PutMCN function sets the conferences's name string
  211.  to the string pointed to by "s". Note that the string pointed to by "s" can
  212.  be no more than 40 characters in length.
  213.  
  214. MCONF_DAT_GetNWCN() AS STRING
  215.  This form of the MCONF_DAT_GetNWCN function returns a pointer to the
  216.  conference's Network name string. NOTE: If the message conference belongs to
  217.  multiple Networks, then it will return a string with all network names that
  218.  this conference belongs to as in this Example: Fidonet, WME, Rime 
  219.  
  220. MCONF_DAT_GetRSL() AS INTEGER
  221.  This form of the MCONF_DAT_GetRSL function returns the conference's read
  222.  security level.
  223.  
  224. MCONF_DAT_PutRSL(n AS INTEGER)
  225.  This form of the MCONF_DAT_PutRSL function sets the conference's read
  226.  security level to "n". "n" must be in the range of 0 to 9999.
  227.  
  228. MCONF_DAT_GetPSL() AS INTEGER
  229.  This form of the MCONF_DAT_GetPSL function returns the conference's post
  230.  security level.
  231.  
  232. MCONF_DAT_PutPSL(n AS INTEGER)
  233.  This form of the MCONF_DAT_PutPSL function sets the conference's post
  234.  security level to "n". "n" must be in the range of 0 to 9999.
  235.  
  236. MCONF_DAT_GetTPNODTS() AS INTEGER
  237.  This form of the MCONF_DAT_GetTPNODTS function returns the conference's
  238.  number of days to save messages for TriPack.
  239.  
  240. MCONF_DAT_PutTPNODTS(n AS INTEGER)
  241.  This form of the MCONF_DAT_PutTPNODTS function sets the conference's number
  242.  of days to save message for TriPack to "n".
  243.  
  244. MCONF_DAT_GetHMN() AS LONG
  245.  This form of the MCONF_DAT_GetHMN function returns the conference's highest
  246.  message number.
  247.  
  248. MCONF_DAT_PutHMN(n AS LONG)
  249.  This form of the MCONF_DAT_PutHMN function sets the conference's highest
  250.  message number to "n".
  251.  
  252. MCONF_DAT_GetNWF(nw AS INTEGER) AS INTEGER
  253.  This form of the MCONF_DAT_GetNWF function returns the conference's network
  254.  flag for network "nw". "nw" represents Message Conference Record.
  255.  
  256. MCONF_DAT_PutNWF(nw AS INTEGER, n AS INTEGER)
  257.  This form of the MCONF_DAT_PutNWF function sets the conference's network
  258.  flag for network "nw" to "n". "n" must be in the range of 0 to 1 as follows:
  259.  
  260.   For "nw" = 1 to 9999
  261.  
  262.   For "n" = 0 or 1:
  263.  
  264.     0 = The conference does not belong to the network.
  265.     1 = The conference belongs to the network.
  266.  
  267. -----------------------------------------------------------------------------
  268. All BIT Fields below have been converted to Integers to allow easier access
  269. and handling.
  270. -----------------------------------------------------------------------------
  271. MCONF_DAT_GetNWCF() AS INTEGER
  272.  This form of the MCONF_DAT_GetNWCF function returns the conference's
  273.  networked conference flag.
  274.  
  275. MCONF_DAT_PutNWCF(n AS INTEGER)
  276.  This form of the MCONF_DAT_PutNWCF function sets the conference's networked
  277.  conference flag to "n". "n" must be in the range of 0 to 1 as follows:
  278.  
  279.     0 = The conference isn't a networked conference.
  280.     1 = The conference is a networked conference.
  281.  
  282. MCONF_DAT_GetPCF() AS INTEGER
  283.  This form of the MCONF_DAT_GetPCF function returns the conference's private
  284.  conference flag.
  285.  
  286. MCONF_DAT_PutPCF(n AS INTEGER)
  287.  This form of the MCONF_DAT_PutPCF function sets the conference's private
  288.  conference flag to "n". "n" must be in the range of 0 to 1 as follows:
  289.  
  290.     0 = The conference isn't a private conference.
  291.     1 = The conference is a private conference.
  292.  
  293. MCONF_DAT_GetFSNM() AS INTEGER
  294.  This form of the MCONF_DAT_GetFSNM function returns the conference's
  295.  Fido-style netmail flag.
  296.  
  297. MCONF_DAT_PutFSNM(n AS INTEGER)
  298.  This form of the MCONF_DAT_PutFSNM function sets the conference's Fido-style
  299.  netmail flag to "n". "n" must be in the range of 0 to 1 as follows:
  300.  
  301.     0 = The conference isn't a Fido-style netmail conference.
  302.     1 = The conference is a Fido-style netmail conference.
  303.  
  304. MCONF_DAT_GetACF() AS INTEGER
  305.  This form of the MCONF_DAT_GetACF function returns the conference's alias
  306.  conference flag.
  307.  
  308. MCONF_DAT_PutACF(n AS INTEGER)
  309.  This form of the MCONF_DAT_PutACF function sets the conference's alias
  310.  conference flag to "n". "n" must be in the range of 0 to 1 as follows:
  311.  
  312.     0 = The conference isn't an alias conference.
  313.     1 = The conference is an alias conference.
  314.  
  315. MCONF_DAT_GetUDF() AS INTEGER
  316.  This form of the MCONF_DAT_GetUDF function returns the conference's user
  317.  delete flag.
  318.  
  319. MCONF_DAT_PutUDF(n AS INTEGER) 
  320.  This form of the MCONF_DAT_PutUDF function sets the conference's user delete
  321.  flag to "n". "n" must be in the range of 0 to 1 as follows:
  322.  
  323.     0 = Users are not allowed to delete messages.
  324.     1 = Users can deleted messages.
  325.  
  326. MCONF_DAT_GetTPBF() AS INTEGER
  327.  This form of the MCONF_DAT_GetTPBF function returns the conference's TriPack
  328.  backup flag.
  329.  
  330. MCONF_DAT_PutTPBF(n AS INTEGER)
  331.  This form of the MCONF_DAT_PutTPBF function sets the conference's TriPack
  332.  backup flag to "n". "n" must be in the range of 0 to 1 as follows:
  333.  
  334.     0 = Do not save backup files while packing the message base.
  335.     1 = Save backup files while packing the message base.
  336.  
  337. MCONF_DAT_GetDPriM() AS INTEGER
  338.  This form of the MCONF_DAT_GetDPriM function returns the conference's disable
  339.  private messages flag.
  340.  
  341. MCONF_DAT_PutDPriM(n AS INTEGER)
  342.  This form of the MCONF_DAT_PutDPriM function sets the conference's disable
  343.  private messages flag to "n". "n" must be in the range of 0 to 1 as follows:
  344.  
  345.     0 = Do not disable private messages.
  346.     1 = Disable private messages.
  347.  
  348. MCONF_DAT_GetDPubM() AS INTEGER
  349.  This form of the MCONF_DAT_GetDPubM function returns the conference's disable
  350.  public message flag.
  351.  
  352. MCONF_DAT_PutDPubM(n AS INTEGER)
  353.  This form of the MCONF_DAT_PutDPubM function sets the conference's disable
  354.  public message flag to "n". "n" must be in the range of 0 to 1 as follows:
  355.  
  356.     0 = Do not disable public messages.
  357.     1 = Disable public messages.
  358.