/[rdesktop]/sourceforge.net/trunk/rdesktop/parallel.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/trunk/rdesktop/parallel.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 631 by n-ki, Fri Mar 5 06:48:08 2004 UTC revision 632 by stargo, Fri Mar 5 09:36:49 2004 UTC
# Line 8  Line 8 
8  #include <unistd.h>  #include <unistd.h>
9  #include <fcntl.h>  #include <fcntl.h>
10  #include <sys/ioctl.h>  #include <sys/ioctl.h>
 #include <linux/lp.h>  
11  #include <errno.h>  #include <errno.h>
12    
13    #if defined(__linux__)
14    #include <linux/lp.h>
15    #endif
16    
17  extern int errno;  extern int errno;
18    
19  extern RDPDR_DEVICE g_rdpdr_device[];  extern RDPDR_DEVICE g_rdpdr_device[];
# Line 86  parallel_create(uint32 device_id, uint32 Line 89  parallel_create(uint32 device_id, uint32
89          if (fcntl(parallel_fd, F_SETFL, O_NONBLOCK) == -1)          if (fcntl(parallel_fd, F_SETFL, O_NONBLOCK) == -1)
90                  perror("fcntl");                  perror("fcntl");
91    
92    #if defined(LPABORT)
93            /* Retry on errors */
94          ioctl(parallel_fd, LPABORT, (int) 1);          ioctl(parallel_fd, LPABORT, (int) 1);
95    #endif
96    
97          g_rdpdr_device[device_id].handle = parallel_fd;          g_rdpdr_device[device_id].handle = parallel_fd;
98    
# Line 134  parallel_write(HANDLE handle, uint8 * da Line 140  parallel_write(HANDLE handle, uint8 * da
140                          default:                          default:
141                                  rc = STATUS_DEVICE_POWERED_OFF;                                  rc = STATUS_DEVICE_POWERED_OFF;
142                  }                  }
143    #if defined(LPGETSTATUS)
144                  if (ioctl(handle, LPGETSTATUS, &status) == 0)                  if (ioctl(handle, LPGETSTATUS, &status) == 0)
145                  {                  {
146                          /* coming soon: take care for the printer status */                          /* coming soon: take care for the printer status */
147                          printf("parallel_write: status = %d, errno = %d\n", status, errno);                          printf("parallel_write: status = %d, errno = %d\n", status, errno);
148                  }                  }
149    #endif
150          }          }
151          *result = n;          *result = n;
152          return rc;          return rc;

Legend:
Removed from v.631  
changed lines
  Added in v.632

  ViewVC Help
Powered by ViewVC 1.1.26