home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / orionful.zip / Docs / Adepttoss.Txt next >
Text File  |  1997-08-28  |  2KB  |  72 lines

  1. This outlines the information of the AdeptToss.Log File
  2. -------------------------------------------------------
  3.  
  4. Adept now keeps track of all net/echo areas in which any
  5. new messages have been posted, and can dump these areas
  6. to a file called AdeptToss.Log on request.
  7.  
  8. GateKpr has also been enhanced to take advantage of this
  9. feature.
  10.  
  11. This is how it works
  12. --------------------
  13.  
  14. Whenever GateKpr is run, it will ask Adept to dump the
  15. current new message (net/echo) areas to AdeptToss.Log so
  16. that it scans only those areas for new mail.
  17.  
  18. Adept will also dump this file on ShutDown.
  19.  
  20. AdeptToss.Log will be created only if any areas (net/echo)
  21. have had any new messages since the last time the
  22. AdeptToss.Log file was dumped.
  23.  
  24. Adept will always append (add) to the AdeptToss.Log, never
  25. erase it. GateKpr will always erase (delete) the AdeptToss.Log
  26. file if it finds one (after processing it).
  27.  
  28.  
  29. Format of the AdeptToss.Log file
  30. --------------------------------
  31.  
  32. The AdeptToss.Log is a plain ASCII file which contains only
  33. the message area number, one, per line ended by a CR LF.
  34.  
  35.  
  36. Tech Details
  37. ------------
  38.  
  39. Adept creates a shared semaphore for the AdeptToss.Log feature
  40. to work seamlessly with GateKpr. GateKpr checks for the
  41. semaphore, and if present, posts to it, which tells Adept to
  42. dump the AdeptToss.Log file.
  43.  
  44. Adept, in turn, makes another post to the event semaphore to
  45. signal to GateKpr that it is done with dumping the log.
  46.  
  47. The following is the code fragment example for anyone who wants
  48. to implement the seamless dumping of the AdeptToss.Log in their
  49. own programs.
  50.  
  51.     APIRET RetCode;
  52.     ULONG PostCt;
  53.     USHORT Tries = 300;
  54.  
  55.     DosOpenEventSem("\\SEM32\\AdeptXBBS\\GateKpr", &AdepTossSEM);
  56.  
  57.     DosResetEventSem( AdepTossSEM, &PostCt );
  58.     DosPostEventSem( AdepTossSEM );
  59.  
  60.     while ( ((RetCode = DosQueryEventSem( AdepTossSEM, &PostCt)) == 0) && Tries-- )
  61.         {
  62.         if ( PostCt >= 3 )
  63.             {
  64.             DosResetEventSem( AdepTossSEM, &PostCt );
  65.             break;
  66.             }
  67.         DosSleep( 1000L );
  68.         }
  69.     }
  70.  
  71.     DosCloseEventSem( AdepTossSEM );
  72.