/*
- * "$Id: lprm.c 5023 2006-01-29 14:39:44Z mike $"
+ * "$Id: lprm.c 5878 2006-08-24 15:55:42Z mike $"
*
* "lprm" command for the Common UNIX Printing System (CUPS).
*
ipp_t *request; /* IPP request */
ipp_t *response; /* IPP response */
ipp_op_t op; /* Operation */
- cups_lang_t *language; /* Language */
int num_dests; /* Number of destinations */
- cups_dest_t *dests; /* Destinations */
+ cups_dest_t *dests, /* Destinations */
+ *defdest; /* Default destination */
http_encryption_t encryption; /* Encryption? */
+ _cupsSetLocale();
+
/*
* Setup to cancel individual print jobs...
*/
response = NULL;
http = NULL;
encryption = cupsEncryption();
- language = cupsLangDefault();
- num_dests = cupsGetDests(&dests);
-
- for (i = 0; i < num_dests; i ++)
- if (dests[i].is_default)
- dest = dests[i].name;
/*
* Open a connection to the server...
if ((http = httpConnectEncrypt(cupsServer(), ippPort(), encryption)) == NULL)
{
_cupsLangPuts(stderr, _("lprm: Unable to contact server!\n"));
- cupsFreeDests(num_dests, dests);
return (1);
}
+ num_dests = cupsGetDests2(http, &dests);
+ defdest = cupsGetDest(NULL, NULL, num_dests, dests);
+ dest = defdest ? defdest->name : NULL;
+
/*
* Process command-line arguments...
*/
encryption = HTTP_ENCRYPT_REQUIRED;
httpEncryption(http, encryption);
+ cupsSetEncryption(encryption);
#else
_cupsLangPrintf(stderr,
_("%s: Sorry, no encryption support compiled in!\n"),
break;
case 'h' : /* Connect to host */
- if (http != NULL)
- httpClose(http);
-
if (argv[i][2] != '\0')
cupsSetServer(argv[i] + 2);
else
else
cupsSetServer(argv[i]);
}
+
+ httpClose(http);
+ cupsFreeDests(num_dests, dests);
+
+ if ((http = httpConnectEncrypt(cupsServer(), ippPort(),
+ encryption)) == NULL)
+ {
+ _cupsLangPuts(stderr, _("lprm: Unable to contact server!\n"));
+ return (1);
+ }
+
+ num_dests = cupsGetDests2(http, &dests);
+ defdest = cupsGetDest(NULL, NULL, num_dests, dests);
+ dest = defdest ? defdest->name : NULL;
break;
default :
}
/*
- * If nothing has been cancelled yet, cancel the current job on the specified
+ * If nothing has been canceled yet, cancel the current job on the specified
* (or default) printer...
*/
/*
- * End of "$Id: lprm.c 5023 2006-01-29 14:39:44Z mike $".
+ * End of "$Id: lprm.c 5878 2006-08-24 15:55:42Z mike $".
*/