home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Libraries / GUSI 1.4.1 / GUSI / Examples / GUSIPAPTest.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-25  |  990 b   |  46 lines  |  [TEXT/MPS ]

  1. /*********************************************************************
  2. File        :    GUSI                -    Grand Unified Socket Interface
  3. File        :    GUSIPAPTest        -    Test PAP sockets
  4. Author    :    Matthias Neeracher <neeri@iis.ethz.ch>
  5. Language    :    MPW C
  6.  
  7. $Log: GUSIPAPTest.c,v $
  8. Revision 1.1  1994/02/25  02:47:26  neeri
  9. Initial revision
  10.  
  11. *********************************************************************/
  12.  
  13. #include <GUSI.h>
  14. #include <GUSITest.h>
  15. #include <stdio.h>
  16. #include <fcntl.h>
  17. #include <stdlib.h>
  18. #include <errno.h>
  19. #include <string.h>
  20.  
  21. #include "Events.h"
  22.  
  23. extern int GUSIDefaultSpin(spin_msg, long);
  24.  
  25. void Open(char, char, const char *)
  26. {
  27.     sock    =    open("Dev:Printer", O_RDWR);
  28.     
  29.     if (sock == -1)    {
  30.         printf("# open() returned error %s\n", Explain());
  31.         Where();
  32.     }
  33. }
  34.  
  35. main(int argc, char ** argv)
  36. {
  37.     printf("GUSIPAPTest        MN 15Feb93\n\n");
  38.  
  39.     COMMAND('o', 'p', Open,      "",                 "Open connection to printer");
  40.     
  41.     AddSocketCommands();
  42.     
  43.     GUSISetEvents(GUSISIOWEvents);
  44.     RunTest(argc, argv);
  45.     CleanupSockets();
  46. }