thorsson_cups 0.0.29 → 0.0.30
Sign up to get free protection for your applications and to get access to all the features.
- data/ext/cups.c +5 -7
- metadata +3 -3
data/ext/cups.c
CHANGED
@@ -443,7 +443,6 @@ static VALUE cups_cancel_print(int argc, VALUE* argv, VALUE self)
|
|
443
443
|
*/
|
444
444
|
static VALUE cups_get_device_uri(VALUE self, VALUE printerName)
|
445
445
|
{
|
446
|
-
// Don't have to lift a finger unless the printer exists.
|
447
446
|
if (!printer_exists(printerName))
|
448
447
|
{
|
449
448
|
rb_raise(rb_eRuntimeError, "The printer or destination doesn't exist!");
|
@@ -458,21 +457,20 @@ static VALUE cups_get_device_uri(VALUE self, VALUE printerName)
|
|
458
457
|
char *printer;
|
459
458
|
|
460
459
|
printer = RSTRING_PTR(printerName);
|
461
|
-
|
460
|
+
|
462
461
|
request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES);
|
463
462
|
httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL, "localhost", 0, "/printers/%s", printer);
|
464
463
|
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
|
465
|
-
|
464
|
+
|
466
465
|
if ((response = cupsDoRequest(http, request, "/")) != NULL)
|
467
466
|
{
|
468
467
|
if((attr = ippFindAttribute(response, "device-uri", IPP_TAG_URI)) != NULL)
|
469
468
|
{
|
470
|
-
|
471
|
-
|
469
|
+
// //int c = 0;
|
470
|
+
// // sprintf(location, "%s", attr->values[0].string.text);
|
472
471
|
}
|
473
472
|
ippDelete(response);
|
474
|
-
}
|
475
|
-
|
473
|
+
}
|
476
474
|
return Qtrue;
|
477
475
|
}
|
478
476
|
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 30
|
9
|
+
version: 0.0.30
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Ivan Turkovic
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-01-
|
18
|
+
date: 2011-01-21 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|