cyrus-sasl: moved to github
[packages.git] / libs / libinklevel / patches / 002-disable_parport.patch
1 --- a/linux.c
2 +++ b/linux.c
3 @@ -16,10 +16,11 @@
4  #include <string.h>
5  #include <sys/ioctl.h>
6  
7 +#ifdef WITH_PARPORT
8  /* ieee1284.h uses HAVE_IEEE1284_H, so we undefine it */
9  #undef HAVE_IEEE1284_H
10  #include <ieee1284.h>
11 -
12 +#endif
13  #include "internal.h"
14  #include "inklevel.h"
15  #include "platform_specific.h"
16 @@ -32,7 +33,9 @@
17  
18  int get_device_id(const int port, const char *device_file, 
19                    const int portnumber, char *device_id) {
20 +#ifdef WITH_PARPORT
21    struct parport_list parports;
22 +#endif
23    char tmp[BUFLEN];
24    char device_file1[256];
25    char device_file2[256];
26 @@ -41,6 +44,7 @@ int get_device_id(const int port, const 
27    char *c;
28    int realsize;
29  
30 +#ifdef WITH_PARPORT
31    if (port == PARPORT ) {
32      /* check if we have appropiate permissions */
33  
34 @@ -73,7 +77,9 @@ int get_device_id(const int port, const 
35  
36      return COULD_NOT_GET_DEVICE_ID;
37  
38 -  } else if (port == USB || port == CUSTOM_USB) {
39 +  } else
40 +#endif
41 +  if (port == USB || port == CUSTOM_USB) {
42  
43      if (port == USB) {
44        sprintf(device_file1, "/dev/usb/lp%d", portnumber);
45 @@ -138,8 +144,10 @@ int open_printer_device(const int port, 
46    if (port == USB) {
47      sprintf(device_file1, "/dev/usb/lp%d", portnumber);
48      sprintf(device_file2, "/dev/usblp%d", portnumber);
49 +#ifdef WITH_PARPORT
50    } else if (port == PARPORT) {
51      sprintf(device_file1, "/dev/lp%d", portnumber);
52 +#endif
53    } else if (port == CUSTOM_USB) {
54      strncpy(device_file1, device_file, 255);
55      device_file1[255] = '\0';