home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Libraries / GUSI / Examples / GUSIPAPTest.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-02-15  |  946 b   |  42 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. Started    :    15Feb93                                Language    :    MPW C
  6. Last        :    15Feb93
  7. *********************************************************************/
  8.  
  9. #include <GUSI.h>
  10. #include <GUSITest.h>
  11. #include <stdio.h>
  12. #include <fcntl.h>
  13. #include <stdlib.h>
  14. #include <errno.h>
  15. #include <string.h>
  16.  
  17. #include "Events.h"
  18.  
  19. extern int GUSIDefaultSpin(spin_msg, long);
  20.  
  21. void Open(char, char, const char *)
  22. {
  23.     sock    =    open("Dev:Printer", O_RDWR);
  24.     
  25.     if (sock == -1)    {
  26.         printf("# open() returned error %s\n", Explain());
  27.         Where();
  28.     }
  29. }
  30.  
  31. main(int argc, char ** argv)
  32. {
  33.     printf("GUSIPAPTest        MN 15Feb93\n\n");
  34.  
  35.     COMMAND('o', 'p', Open,      "",                 "Open connection to printer");
  36.     
  37.     AddSocketCommands();
  38.     
  39.     GUSISetEvents(GUSISIOWEvents);
  40.     RunTest(argc, argv);
  41.     CleanupSockets();
  42. }