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

  1. Author....... : Gary Price
  2. Copyrighted by: Freejack's Software 1997-98
  3.  
  4. DOORS_TMP API for TriBBS v10.x/11.x written in PowerBasic v3.5
  5. ---------------------------------------------------------------------------
  6.  
  7. The DOORS_TMP unit is used to manipulate data in the DOORS.TMP data file.
  8. Doors.tmp is created in any node's \NWORK directory when a caller shells to
  9. a door from the BBS, TriBBS will create this temporary file, and then re-read
  10. it back in and then delete it when the caller returns from the door back to
  11. TriBBS. The interaction with this file must be during this time when the
  12. caller is shelled from TriBBS.
  13.  
  14. For testing purposes, you will need to create or grab a copy of Doors.tmp
  15. when a caller is logged on and shelled to a door so you can test this unit.
  16.  
  17. The DOORS_TMP unit is declared in PBAPI10.INC as follows:
  18.  
  19.  Doors.tmp BitFields Breakdown
  20.  
  21.  DoorTmpBit.bit1 BIT Assignment
  22.     0 = ANSIFlag
  23.     1 = FrontEndFlag
  24.     2 = FrontEndHangUpFlag
  25.     3 = UserWindowFlag
  26.     4 = ChatRequestedFlag
  27.     5 = EventPendingFlag
  28.     6 = GoodbyeFromDoorFlag
  29.     7 = ForceBoardDownAfterCallFlag
  30.  
  31.  DoorTmpBit.bit2 Assignment
  32.     0 = RIPscripFlag
  33.     1 = DOORSYSFlag
  34.     2 = ErrorCorrectingConnectionFlag
  35.     3 to 7 Reserved, set to all 0's
  36.  
  37.  DoorTmpBit.bit3 to DoorTmpBit.bit10, Reserved and all bit's set to 0
  38.  
  39.  Sub Type Structure for 10 byte BitFields
  40. TYPE DoorTmpBit
  41.   bit1  AS BYTE
  42.   bit2  AS BYTE
  43.   bit3  AS BYTE
  44.   bit4  AS BYTE
  45.   bit5  AS BYTE
  46.   bit6  AS BYTE
  47.   bit7  AS BYTE
  48.   bit8  AS BYTE
  49.   bit9  AS BYTE
  50.   bit10 AS BYTE
  51. END TYPE
  52.  
  53. File Name: "DOORS.TMP"
  54.  TYPE DOORTMP
  55.     TimeLeftAtLogon           AS INTEGER
  56.     CurrentFileArea           AS INTEGER
  57.     CurrentMessageConference  AS INTEGER
  58.     FrontEndTime              AS INTEGER
  59.     WhereTheDoorWasCalledFrom AS INTEGER
  60.     LanguageNumber            AS INTEGER
  61.     NumberOfFilesFlagged      AS INTEGER
  62.     TimeInDOORSYS             AS INTEGER
  63.     UserRecordNumber          AS LONG
  64.     BaudRate                  AS LONG
  65.     FrontEndBaudRate          AS LONG
  66.     TimeWhenUserLoggedOn      AS LONG
  67.     DoorTmpBitFields          AS DoorTmpBit
  68.  END TYPE
  69.  
  70.  DIM DoorTmpBit AS DoorTmpBit         
  71.  DIM DOORTMP    AS SHARED DOORTMP     
  72.  DIM dt         AS SHARED DOORTMP PTR 
  73.  
  74.  dt = VARPTR32(DOORTMP) 
  75.  LSET DOORTMP = DOORTMP 
  76. ---------------------------------------------------------------------------
  77.  
  78. FUNCTION's below are from the DOORTMP.PBU Unit and DECLAREd in PBAPI10.INC.
  79.  
  80. FUNCTION DOORS_TMP_OPEN() AS INTEGER
  81. FUNCTION DOORS_TMP_CLOSE()
  82. FUNCTION DOORS_TMP_READ()
  83. FUNCTION DOORS_TMP_WRITE()
  84. FUNCTION DOORS_TMP_OpenRead() AS INTEGER
  85. FUNCTION DOORS_TMP_WriteClose()
  86. FUNCTION DOORS_TMP_OpenReadClose() AS INTEGER
  87. FUNCTION DOORS_TMP_OpenWriteClose() AS INTEGER
  88. FUNCTION DOORS_TMP_Clearit() AS INTEGER
  89.  
  90. FUNCTION DOORS_TMP_GetTLAL() AS INTEGER
  91. FUNCTION DOORS_TMP_PutTLAL(n AS INTEGER)
  92. FUNCTION DOORS_TMP_GetCFA() AS INTEGER
  93. FUNCTION DOORS_TMP_PutCFA(n AS INTEGER)
  94. FUNCTION DOORS_TMP_GetCMC() AS INTEGER
  95. FUNCTION DOORS_TMP_PutCMC(n AS INTEGER)
  96. FUNCTION DOORS_TMP_GetFET() AS INTEGER
  97. FUNCTION DOORS_TMP_PutFET(n AS INTEGER)
  98. FUNCTION DOORS_TMP_GetWTDWCF() AS INTEGER
  99. FUNCTION DOORS_TMP_PutWTDWCF(n AS INTEGER)
  100. FUNCTION DOORS_TMP_GetLN() AS INTEGER
  101. FUNCTION DOORS_TMP_PutLN(n AS INTEGER)
  102. FUNCTION DOORS_TMP_GetNOFF() AS INTEGER
  103. FUNCTION DOORS_TMP_PutNOFF(n AS INTEGER)
  104. FUNCTION DOORS_TMP_GetTIDSys() AS INTEGER
  105. FUNCTION DOORS_TMP_PutTIDSys(n AS INTEGER)
  106. FUNCTION DOORS_TMP_GetURN() AS LONG
  107. FUNCTION DOORS_TMP_PutURN(n AS LONG)
  108. FUNCTION DOORS_TMP_GetBR() AS LONG
  109. FUNCTION DOORS_TMP_PutBR(n AS LONG)
  110. FUNCTION DOORS_TMP_GetFEBR() AS LONG
  111. FUNCTION DOORS_TMP_PutFEBR(n AS LONG)
  112. FUNCTION DOORS_TMP_GetTWULO() AS LONG
  113. FUNCTION DOORS_TMP_PutTWULO(n AS LONG)
  114.  
  115. FUNCTION DOORS_TMP_GetAF() AS INTEGER
  116. FUNCTION DOORS_TMP_PutAF(n AS INTEGER)
  117. FUNCTION DOORS_TMP_GetFEF() AS INTEGER
  118. FUNCTION DOORS_TMP_PutFEF(n AS INTEGER)
  119. FUNCTION DOORS_TMP_GetFEHU() AS INTEGER
  120. FUNCTION DOORS_TMP_PutFEHU(n AS INTEGER)
  121. FUNCTION DOORS_TMP_GetUWF() AS INTEGER
  122. FUNCTION DOORS_TMP_PutUWF(n AS INTEGER)
  123. FUNCTION DOORS_TMP_GetCRF() AS INTEGER
  124. FUNCTION DOORS_TMP_PutCRF(n AS INTEGER)
  125. FUNCTION DOORS_TMP_GetEPF() AS INTEGER
  126. FUNCTION DOORS_TMP_PutEPF(n AS INTEGER)
  127. FUNCTION DOORS_TMP_GetGFD() AS INTEGER
  128. FUNCTION DOORS_TMP_PutGFD(n AS INTEGER)
  129. FUNCTION DOORS_TMP_GetFBDAC() AS INTEGER
  130. FUNCTION DOORS_TMP_PutFBDAC(n AS INTEGER)
  131. FUNCTION DOORS_TMP_GetRIP() AS INTEGER
  132. FUNCTION DOORS_TMP_PutRIP(n AS INTEGER)
  133. FUNCTION DOORS_TMP_GetDSF() AS INTEGER
  134. FUNCTION DOORS_TMP_PutDSF(n AS INTEGER)
  135. FUNCTION DOORS_TMP_GetECC() AS INTEGER
  136. FUNCTION DOORS_TMP_PutECC(n AS INTEGER)
  137.  
  138. ---------------------------------------------------------------------------
  139.  ** EXTERNAL FUNCTION USED BY DOORS.TMP UNIT BELOW **
  140.  
  141. FUNCTION Exist(BYVAL Filename AS STRING) AS INTEGER
  142.  
  143. -----------------------------------------------------------------------------
  144.  
  145. IMPORTANT: TBNodesMainDirectory must be set to the node's main directory
  146. before calling to any of these functions.
  147.  
  148. Since the Doors.tmp file is only created when a caller shells out from TriBBS
  149. into a door, I have set the functions that contains any of the "OPEN"
  150. statements to first verify that the Doors.tmp does exist in the current node's
  151. \NWORK directory. This will help solve two problems. First of all, we don't
  152. want to create a 0 byte Doors.tmp file in the \NWORK directory, this causes
  153. TriBBS to do weird things.. :) Second, if the Doors.tmp file is not currently
  154. in the node's \NWORK directory, you don't want your program to hang or lock
  155. up tring to read in data.
  156.  
  157. DOORS_TMP_Open() AS INTEGER
  158.  The DOORS_TMP_Open function opens the DOORS.TMP data file in the current
  159.  node's NWORK directory. Also, this function will return either 0 or 1
  160.  depending if the file exists or not.
  161.  
  162.     0 = Doors.tmp does not exist and file was not open.
  163.     1 = Doors.tmp did exist and the file was opened.
  164.  
  165. DOORS_TMP_Close()
  166.  The DOORS_TMP_Close function closes the DOORS.TMP data file in the current
  167.  node's NWORK directory.
  168.  
  169. DOORS_TMP_Read()
  170.  The DOORS_TMP_Read function reads the DOORS.TMP data file into memory.
  171.  
  172. DOORS_TMP_Write()
  173.  The DOORS_TMP_Write function updates the DOORS.TMP data file from memory.
  174.  
  175. DOORS_TMP_OpenRead() AS INTEGER
  176.  The DOORS_TMP_OpenRead function provides the functionality of the
  177.  DOORS_TMP_Open and DOORS_TMP_Read functions in a single function call. Also,
  178.  this function will return either 0 or 1 depending if the file exists or not.
  179.  
  180.     0 = Doors.tmp does not exist and file was not open.
  181.     1 = Doors.tmp did exist and the file was opened.
  182.  
  183. DOORS_TMP_WriteClose()
  184.  The DOORS_TMP_WriteClose function provides the functionality of the
  185.  DOORS_TMP_Write and DOORS_TMP_Close functions in a single function call.
  186.  
  187. DOORS_TMP_OpenReadClose() AS INTEGER
  188.  The DOORS_TMP_OpenReadClose function provides the functionality of the
  189.  DOORS_TMP_Open, DOORS_TMP_Read, and DOORS_TMP_Close functions in a single
  190.  function call. Also, this function will return either 0 or 1 depending if
  191.  the file exists or not.
  192.  
  193.     0 = Doors.tmp does not exist and file was not open.
  194.     1 = Doors.tmp did exist and the file was opened.
  195.  
  196. DOORS_TMP_OpenWriteClose() AS INTEGER
  197.  The DOORS_TMP_OpenWriteClose function provides the functionality of the
  198.  DOORS_TMP_Open, DOORS_TMP_Write, and DOORS_TMP_Close functions in a single
  199.  function call. this function will return either 0 or 1 depending if the file
  200.  exists or not.
  201.  
  202.     0 = Doors.tmp does not exist and file was not open.
  203.     1 = Doors.tmp did exist and the file was opened.
  204.  
  205.  
  206. DOORS_TMP_ClearIt() AS INTEGER
  207.  The DOORS_TMP_ClearIt function sets the entire DOORS_TMP data record to all
  208.  zeros. Also, this function will return either 0 or 1 depending if the file
  209.  exists or not.
  210.  
  211.     0 = Doors.tmp does not exist and file was not open.
  212.     1 = Doors.tmp did exist and the file was opened.
  213.  
  214. -----------------------------------------------------------------------------
  215. POINTERS Uses a hidden variable I use called "@dt". Any reference to this is
  216. only for your information for discussion in this doc file. You will not need
  217. to concern yourself trying to use this.. All calls are handled in the main
  218. DOORTMP.PBU Unit by my routines automatically. In other words, I am trying to
  219. keep Pointers as easy as possible for your use. :)
  220. -----------------------------------------------------------------------------
  221.  
  222. DOORS_TMP_GetTLAL() AS INTEGER
  223.  This form of the DOORS_TMP_GetTLAL function returns the user's time left
  224.  at logon.
  225.  
  226. DOORS_TMP_PutTLAL(n AS INTEGER)
  227.  This form of the DOORS_TMP_PutTLAL function sets the user's time left at
  228.  logon to "n"
  229.  
  230. DOORS_TMP_GetCFA() AS INTEGER
  231.  This form of the DOORS_TMP_GetCFA function returns the user's current file
  232.  area.
  233.  
  234. DOORS_TMP_PutCFA(n AS INTEGER)
  235.  This form of the DOORS_TMP_PutCFA function sets the user's current file area
  236.  to "n".
  237.  
  238. DOORS_TMP_GetCMC() AS INTEGER
  239.  This form of the DOORS_TMP_GetCMC function returns the user's current message
  240.  conference.
  241.  
  242. DOORS_TMP_PutCMC(n AS INTEGER)
  243.  This form of the DOORS_TMP_PutCMC function sets the user's current message
  244.  conference to "n".
  245.  
  246. DOORS_TMP_GetFET() AS INTEGER
  247.  This form of the DOORS_TMP_GetFET function returns the time passed to TriBBS
  248.  by a front end.
  249.  
  250. DOORS_TMP_PutFET(n AS INTEGER)
  251.  This form of the DOORS_TMP_PutFET function sets the time passed to TriBBS by
  252.  a front end to "n".
  253.  
  254. DOORS_TMP_GetWTDWCF() AS INTEGER
  255.  This form of the DOORS_TMP_GetWTDWCF function returns where the door was
  256.  called from.
  257.  
  258. DOORS_TMP_PutWTDWCF(n AS INTEGER)
  259.  This form of the DOORS_TMP_PutWTDWCF function sets where the door was called
  260.  from to "n". "n" must be in the range of 0 to 7 as follows:
  261.  
  262.     0 = Called from doors menu.
  263.     1 = NEWUSER.BAT
  264.     2 = SECnnnn.BAT
  265.     3 = LOGON.BAT
  266.     4 = Called from main menu.
  267.     5 = Called from files menu.
  268.     6 = Called from message menu.
  269.     7 = Called from sysop menu.
  270.  
  271. DOORS_TMP_GetLN() AS INTEGER
  272.  This form of the DOORS_TMP_GetLN function returns the language number.
  273.  
  274. DOORS_TMP_PutLN(n AS INTEGER)
  275.  This form of the DOORS_TMP_PutLN function sets the language number to "n".
  276.  
  277. DOORS_TMP_GetNOFF() AS INTEGER
  278.  This form of the DOORS_TMP_GetNOFF function returns the number of files
  279.  flagged.
  280.  
  281. DOORS_TMP_PutNOFF(n AS INTEGER)
  282.  This form of the DOORS_TMP_PutNOFF function sets the number of files flagged
  283.  to "n".
  284.  
  285. DOORS_TMP_GetTIDSys() AS INTEGER
  286.  This form of the DOORS_TMP_GetTIDSys function returns the caller's time
  287.  remaining when DOOR.SYS was created.
  288.  
  289. DOORS_TMP_PutTIDSys(n AS INTEGER)
  290.  This form of the DOORS_TMP_PutTIDSys function sets the caller's time
  291.  remaining when DOORS.SYS was created to "n".
  292.  
  293. DOORS_TMP_GetURN() AS LONG
  294.  This form of the DOORS_TMP_GetURN function returns the user's record number.
  295.  
  296. DOORS_TMP_PutURN(n AS LONG)
  297.  This form of the DOORS_TMP_PutURN function sets the user's record number
  298.  to "n".
  299.  
  300. DOORS_TMP_GetBR() AS LONG
  301.  This form of the DOORS_TMP_GetBR function returns the baud rate.
  302.  
  303. DOORS_TMP_PutBR(n AS LONG)
  304.  This form of the DOORS_TMP_PutBR function sets the baud rate to "n".
  305.  "n" must be in the range of 0 to 115400.
  306.  
  307. DOORS_TMP_GetFEBR() AS LONG
  308. This form of the DOORS_TMP_GetFEBR returns the front end's baud rate.
  309.  
  310. DOORS_TMP_PutFEBR(n AS LONG)
  311.  This form of the DOORS_TMP_PutFEBR sets the front end's baud rate to "n".
  312.  "n" must be in the range of 0 to 115400.
  313.  
  314. DOORS_TMP_GetTWULO() AS LONG
  315.  This form of the DOORS_TMP_GetTWULO function returns the time when the user
  316.  logged on.
  317.  
  318. DOORS_TMP_PutTWULO(n AS LONG)
  319.  This form of the DOORS_TMP_PutTWULO function sets the time when user logged
  320.  on to "n".
  321.  
  322. DOORS_TMP_GetAF() AS INTEGER
  323.  This form of the DOORS_TMP_GetAF function returns the ANSI flag.
  324.  
  325. DOORS_TMP_PutAF(n AS INTEGER)
  326.  This form of the DOORS_TMP_PutAF function sets the ANSI flag to "n".
  327.  "n" must be in the range of 0 to 1 as follows:
  328.  
  329.     0 = Caller is not using ANSI emulation.
  330.     1 = Caller is using ANSI emulation.
  331.  
  332. DOORS_TMP_GetFEF() AS INTEGER
  333.  This form of the DOORS_TMP_GetFEF function returns the front end flag.
  334.  
  335. DOORS_TMP_PutFEF(n AS INTEGER)
  336.  This form of the DOORS_TMP_PutFEF function sets the front end flag to "n".
  337.  "n" must be in the range of 0 to 1 as follows:
  338.  
  339.     0 = TriBBS was not called from a front end.
  340.     1 = TriBBS was called from a front end.
  341.  
  342. DOORS_TMP_GetFEHU() AS INTEGER
  343.  This form of the DOORS_TMP_GetFEHU function returns the front end hang up
  344.  flag.
  345.  
  346. DOORS_TMP_PutFEHU(n AS INTEGER)
  347.  This form of the DOORS_TMP_PutFEHU function sets the front end hang up flag
  348.  to "n". "n" must be in the range of 0 to 1 as follows:
  349.  
  350.     0 = TriBBS will not hang up on the caller before returning to a front end.
  351.     1 = TriBBS will hang up on the caller before returning to a front end.
  352.  
  353. DOORS_TMP_GetUWF() AS INTEGER
  354.  This form of the DOORS_TMP_GetUWF function returns the user window flag.
  355.  
  356. DOORS_TMP_PutUWF(n AS INTEGER)
  357.  This form of the DOORS_TMP_PutUWF function sets the user window flag to "n".
  358.  "n" must be in the range of 0 to 1 as follows:
  359.  
  360.     0 = The user status window is not being displayed.
  361.     1 = The user status window is being displayed.
  362.  
  363. DOORS_TMP_GetCRF() AS INTEGER
  364.  This form of the DOORS_TMP_GetCRF function returns the chat requested flag.
  365.  
  366. DOORS_TMP_PutCRF(n AS INTEGER)
  367.  This form of the DOORS_TMP_PutCRF function sets the chat requested flag to
  368.  "n". "n" must be in the range of 0 to 1 as follows:
  369.  
  370.     0 = The caller hasn't requested a chat.
  371.     1 = The caller has requested a chat.
  372.  
  373. DOORS_TMP_GetEPF() AS INTEGER
  374.  This form of the DOORS_TMP_GetEPF function returns the event pending flag.
  375.  
  376. DOORS_TMP_PutEPF(n AS INTEGER)
  377.  This form of the DOORS_TMP_PutEPF function sets the event pending flag to
  378.  "n". "n" must be in the range of 0 to 1 as follows:
  379.  
  380.     0 = An event is not pending.
  381.     1 = An event is pending.
  382.  
  383. DOORS_TMP_GetGFD() AS INTEGER
  384.  This form of the DOORS_TMP_GetGFD function returns the goodbye from door
  385.  flag.
  386.  
  387. DOORS_TMP_PutGFD(n AS INTEGER)
  388.   This form of the DOORS_TMP_PutGFD function sets the goodbye from door flag
  389.   to "n". "n" must be in the range of 0 to 1 as follows:
  390.  
  391.     0 = The caller hasn't selected "goodbye" from a door.
  392.     1 = The caller has selected "goodbye" from a door.
  393.  
  394. DOORS_TMP_GetFBDAC() AS INTEGER
  395.  This form of the DOORS_TMP_GetFBDAC function returns the force board down
  396.  after call flag.
  397.  
  398. DOORS_TMP_PutFBDAC(n AS INTEGER)
  399.  This form of the DOORS_TMP_PutFBDAC function sets the force board down after
  400.  call flag to "n". "n" must be in the range of 0 to 1 as follows:
  401.  
  402.     0 = Do not exit TriBBS when the caller is done.
  403.     1 = Exit TriBBS when the caller is done.
  404.  
  405. DOORS_TMP_GetRIP() AS INTEGER
  406.  This form of the DOORS_TMP_GetRIP function returns the RIPscrip flag.
  407.  
  408. DOORS_TMP_PutRIP(n AS INTEGER)
  409.  This form of the DOORS_TMP_PutRIP function sets the RIPscrip flag to "n".
  410.  "n" must be in the range of 0 to 1 as follows:
  411.  
  412.     0 = The caller isn't using RIPscrip emulation.
  413.     1 = The caller is using RIPscrip emulation.
  414.  
  415. DOORS_TMP_GetDSF() AS INTEGER
  416.  This form of the DOORS_TMP_GetDSF function returns the DOOR.SYS flag.
  417.  
  418. DOORS_TMP_PutDSF(n AS INTEGER)
  419.  This form of the DOORS_TMP_PutDSF function sets the DOOR.SYS flag to "n".
  420.  "n" must be in the range of 0 to 1 as follows:
  421.  
  422.     0 = Do not read DOOR.SYS back in after the door.
  423.     1 = Read DOOR.SYS back in after the door.
  424.  
  425. DOORS_TMP_GetECC() AS INTEGER
  426.  This form of the DOORS_TMP_GetECC function returns the error correcting
  427.  connection flag.
  428.  
  429. DOORS_TMP_PutECC(n AS INTEGER)
  430.  This form of the DOORS_TMP_PutECC function sets the error correcting
  431.  connection flag to "n". "n" must be in the range of 0 to 1 as follows:
  432.  
  433.     0 = There is a non-errorcorrecting connection.
  434.     1 = There is an errorcorrecting connection.
  435.  
  436.