/*
- * "$Id: lpmove.c 6649 2007-07-11 21:46:42Z mike $"
+ * "$Id$"
*
- * "lpmove" command for the Common UNIX Printing System (CUPS).
+ * "lpmove" command for CUPS.
*
- * Copyright 2007 by Apple Inc.
+ * Copyright 2007-2010 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* Include necessary headers...
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <cups/string.h>
-#include <cups/cups.h>
-#include <cups/i18n.h>
-#include <cups/debug.h>
+#include <cups/cups-private.h>
/*
dest = NULL;
dests = NULL;
- http = NULL;
job = NULL;
jobid = 0;
num_dests = 0;
#ifdef HAVE_SSL
cupsSetEncryption(HTTP_ENCRYPT_REQUIRED);
- if (http)
- httpEncryption(http, HTTP_ENCRYPT_REQUIRED);
#else
_cupsLangPrintf(stderr,
- _("%s: Sorry, no encryption support compiled in!\n"),
+ _("%s: Sorry, no encryption support."),
argv[0]);
#endif /* HAVE_SSL */
break;
case 'h' : /* Connect to host */
- if (http)
- {
- httpClose(http);
- http = NULL;
- }
-
if (argv[i][2] != '\0')
cupsSetServer(argv[i] + 2);
else
if (i >= argc)
{
_cupsLangPuts(stderr,
- _("Error: need hostname after \'-h\' option!\n"));
+ _("Error: need hostname after \"-h\" option."));
return (1);
}
break;
default :
- _cupsLangPrintf(stderr, _("lpmove: Unknown option \'%c\'!\n"),
+ _cupsLangPrintf(stderr, _("lpmove: Unknown option \"%c\"."),
argv[i][1]);
return (1);
}
dest = argv[i];
else
{
- _cupsLangPrintf(stderr, _("lpmove: Unknown argument \'%s\'!\n"),
- argv[i]);
+ _cupsLangPrintf(stderr, _("lpmove: Unknown argument \"%s\"."), argv[i]);
return (1);
}
if ((!jobid && !src) || !dest)
{
- _cupsLangPuts(stdout, _("Usage: lpmove job/src dest\n"));
+ _cupsLangPuts(stdout, _("Usage: lpmove job/src dest"));
return (1);
}
- if (!http)
- {
- http = httpConnectEncrypt(cupsServer(), ippPort(), cupsEncryption());
+ http = httpConnectEncrypt(cupsServer(), ippPort(), cupsEncryption());
- if (http == NULL)
- {
- _cupsLangPrintf(stderr,
- _("lpmove: Unable to connect to server: %s\n"),
- strerror(errno));
- return (1);
- }
+ if (http == NULL)
+ {
+ _cupsLangPrintf(stderr, _("lpmove: Unable to connect to server: %s"),
+ strerror(errno));
+ return (1);
}
return (move_job(http, src, jobid, dest));
if (cupsLastError() > IPP_OK_CONFLICT)
{
- _cupsLangPrintf(stderr, "lpmove: %s\n", cupsLastErrorString());
+ _cupsLangPrintf(stderr, "lpmove: %s", cupsLastErrorString());
return (1);
}
else
/*
- * End of "$Id: lpmove.c 6649 2007-07-11 21:46:42Z mike $".
+ * End of "$Id$".
*/