/*
- * "$Id: lpadmin.c 177 2006-06-21 00:20:03Z jlovell $"
+ * "$Id: lpadmin.c 7720 2008-07-11 22:46:21Z mike $"
*
* "lpadmin" command for the Common UNIX Printing System (CUPS).
*
+ * Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
- * property of Easy Software Products and are protected by Federal
- * copyright law. Distribution and use rights are outlined in the file
- * "LICENSE.txt" which should have been included with this file. If this
- * file is missing or damaged please contact Easy Software Products
- * at:
- *
- * Attn: CUPS Licensing Information
- * Easy Software Products
- * 44141 Airport View Drive, Suite 204
- * Hollywood, Maryland 20636 USA
- *
- * Voice: (301) 373-9600
- * EMail: cups-info@cups.org
- * WWW: http://www.cups.org
+ * property of Apple Inc. and are protected by Federal copyright
+ * law. Distribution and use rights are outlined in the file "LICENSE.txt"
+ * which should have been included with this file. If this file is
+ * file is missing or damaged, see the license at "http://www.cups.org/".
*
* Contents:
*
cups_option_t *options; /* Options */
+ _cupsSetLocale(argv);
+
http = NULL;
printer = NULL;
num_options = 0;
attr = ippAddStrings(request, IPP_TAG_PRINTER, IPP_TAG_URI,
"member-uris", members->num_values + 1, NULL, NULL);
for (i = 0; i < members->num_values; i ++)
- attr->values[i].string.text = strdup(members->values[i].string.text);
+ attr->values[i].string.text = _cupsStrAlloc(members->values[i].string.text);
- attr->values[i].string.text = strdup(uri);
+ attr->values[i].string.text = _cupsStrAlloc(uri);
}
else
- attr = ippAddString(request, IPP_TAG_PRINTER, IPP_TAG_URI, "member-uris", NULL, uri);
+ ippAddString(request, IPP_TAG_PRINTER, IPP_TAG_URI, "member-uris", NULL,
+ uri);
/*
* Then send the request...
for (j = 0, k = 0; j < members->num_values; j ++)
if (j != i)
- attr->values[k ++].string.text = strdup(members->values[j].string.text);
+ attr->values[k ++].string.text =
+ _cupsStrAlloc(members->values[j].string.text);
}
/*
if ((fd = cupsTempFd(tempfile, sizeof(tempfile))) < 0)
{
- _cupsLangPrintf(stderr,
- _("lpadmin: Unable to create temporary file: %s\n"),
- strerror(errno));
+ _cupsLangPrintError(_("ERROR: Unable to create temporary file"));
return (1);
}
if ((protocol = cupsGetOption("protocol", num_options, options)) != NULL)
{
if (!strcasecmp(protocol, "bcp"))
- ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "port-monitor",
+ ippAddString(request, IPP_TAG_PRINTER, IPP_TAG_NAME, "port-monitor",
NULL, "bcp");
else if (!strcasecmp(protocol, "tbcp"))
- ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "port-monitor",
+ ippAddString(request, IPP_TAG_PRINTER, IPP_TAG_NAME, "port-monitor",
NULL, "tbcp");
}
if ((outfd = cupsTempFd(tempfile, sizeof(tempfile))) < 0)
{
- _cupsLangPrintf(stderr,
- _("lpadmin: Unable to create temporary file - %s\n"),
- strerror(errno));
+ _cupsLangPrintError(_("ERROR: Unable to create temporary file"));
ippDelete(request);
unlink(ppdfile);
return (1);
/*
- * End of "$Id: lpadmin.c 177 2006-06-21 00:20:03Z jlovell $".
+ * End of "$Id: lpadmin.c 7720 2008-07-11 22:46:21Z mike $".
*/