home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / h / hldevkit.zip / LOGOUT.C < prev    next >
C/C++ Source or Header  |  1992-04-28  |  1KB  |  45 lines

  1. /*
  2.  * logout.c - a program that will log out the current user
  3.  *
  4.  */
  5.  
  6. #include <proto/exec.h>
  7. #include <proto/hotlinks.h>
  8. #include <lattice/stdio.h>
  9. #include <hotlinks/hotlinks.h>
  10.  
  11. /* the hotlink library base pointer */
  12. struct HotLinksBase *HotLinksBase;
  13.  
  14. /* version string */
  15. char     VERSTAG[]="\0$VER: Logout B4 (10.2.91)";
  16.  
  17.  
  18.  
  19. int main()
  20. {
  21.         int hlh;
  22.         
  23.         /* try to open the hotlink library.
  24.          * If the hotlink resident code is not running the library will
  25.          * not be able to be opened.
  26.          */
  27.         if((HotLinksBase=(struct HotLinksBase *)OpenLibrary("hotlinks.library", 0))==0)
  28.         {
  29.                 printf("ERROR - could not open the hotlinks.library\n");
  30.                 exit(20);
  31.         }
  32.         
  33.         /* register this program with the hotlink system */
  34.         hlh = HLRegister(1,0,0);
  35.         
  36.         /* set the user to NULL - unset the current user */
  37.         SetUser(hlh, 0, 0);
  38.         
  39.         /* Unregister this program from the hotlink system */
  40.         UnRegister(hlh);
  41.         
  42.         /* close the library */
  43.         CloseLibrary((struct Library *)HotLinksBase);
  44. }
  45.