Add libinklevel (#4335), thanks Raphael
[openwrt/svn-archive/archive.git] / libs / libinklevel / patches / 002-disable_parport.patch
1 --- libinklevel-0.7.3.orig/linux.c 2008-12-10 17:09:05.052017664 +0100
2 +++ libinklevel-0.7.3/linux.c 2008-12-10 17:19:59.362144646 +0100
3 @@ -8,7 +8,9 @@
4
5 #include "inklevel.h"
6
7 +#ifdef WITH_PARPORT
8 #include <ieee1284.h>
9 +#endif
10
11 #include <stdio.h>
12 #include <sys/types.h>
13 @@ -30,7 +32,9 @@ int open_printer_device(const int port,
14
15 int get_device_id(const int port, const char *device_file,
16 const int portnumber, char *device_id) {
17 +#ifdef WITH_PARPORT
18 struct parport_list parports;
19 +#endif
20 char tmp[BUFLEN];
21 char device_file1[256];
22 char device_file2[256];
23 @@ -39,6 +43,7 @@ int get_device_id(const int port, const
24 char *c;
25 int realsize;
26
27 +#ifdef WITH_PARPORT
28 if (port == PARPORT ) {
29 /* check if we have appropiate permissions */
30
31 @@ -71,7 +76,9 @@ int get_device_id(const int port, const
32
33 return COULD_NOT_GET_DEVICE_ID;
34
35 - } else if (port == USB || port == CUSTOM_USB) {
36 + } else
37 +#endif
38 + if (port == USB || port == CUSTOM_USB) {
39
40 if (port == USB) {
41 sprintf(device_file1, "/dev/usb/lp%d", portnumber);
42 @@ -132,8 +139,10 @@ int open_printer_device(const int port,
43 if (port == USB) {
44 sprintf(device_file1, "/dev/usb/lp%d", portnumber);
45 sprintf(device_file2, "/dev/usblp%d", portnumber);
46 +#ifdef WITH_PARPORT
47 } else if (port == PARPORT) {
48 sprintf(device_file1, "/dev/lp%d", portnumber);
49 +#endif
50 } else if (port == CUSTOM_USB) {
51 strncpy(device_file1, device_file, 255);
52 device_file1[255] = '\0';