/*
- * "$Id: printers.c 6678 2007-07-16 18:03:35Z mike $"
+ * "$Id: printers.c 6970 2007-09-17 23:58:28Z mike $"
*
* Printer routines for the Common UNIX Printing System (CUPS).
*
cups_array_t *notifiers; /* Notifier array */
char filename[1024], /* Filename */
*notifier; /* Current notifier */
+ cupsd_policy_t *p; /* Current policy */
static const int nups[] = /* number-up-supported values */
{ 1, 2, 4, 6, 9, 16 };
static const int orients[4] =/* orientation-requested-supported values */
CUPS_GET_PPDS,
CUPS_MOVE_JOB,
CUPS_AUTHENTICATE_JOB,
+ CUPS_GET_PPD,
+ CUPS_GET_DOCUMENT,
IPP_RESTART_JOB
};
static const char * const charsets[] =/* charset-supported values */
/* printer-op-policy-supported */
attr = ippAddStrings(CommonData, IPP_TAG_PRINTER, IPP_TAG_NAME,
- "printer-op-policy-supported", NumPolicies, NULL, NULL);
- for (i = 0; i < NumPolicies; i ++)
- attr->values[i].string.text = _cupsStrAlloc(Policies[i]->name);
+ "printer-op-policy-supported", cupsArrayCount(Policies),
+ NULL, NULL);
+ for (i = 0, p = (cupsd_policy_t *)cupsArrayFirst(Policies);
+ p;
+ i ++, p = (cupsd_policy_t *)cupsArrayNext(Policies))
+ attr->values[i].string.text = _cupsStrAlloc(p->name);
+
+ ippAddBoolean(CommonData, IPP_TAG_PRINTER, "server-is-sharing-printers",
+ BrowseLocalProtocols != 0 && Browsing);
}
* data has come from...
*/
- cupsFilePuts(fp, "# This file was automatically generated by cupsd(8) from the\n");
+ cupsFilePuts(fp,
+ "# This file was automatically generated by cupsd(8) from the\n");
cupsFilePrintf(fp, "# %s/printers.conf file. All changes to this file\n",
ServerRoot);
cupsFilePuts(fp, "# will be lost.\n");
if (DefaultPrinter)
cupsFilePrintf(fp, "%s|%s:rm=%s:rp=%s:\n", DefaultPrinter->name,
- DefaultPrinter->info, ServerName, DefaultPrinter->name);
+ DefaultPrinter->info, ServerName,
+ DefaultPrinter->name);
for (p = (cupsd_printer_t *)cupsArrayFirst(Printers);
p;
p = (cupsd_printer_t *)cupsArrayNext(Printers))
if (p != DefaultPrinter)
cupsFilePrintf(fp, "%s|%s:rm=%s:rp=%s:\n", p->name, p->info,
- ServerName, p->name);
+ ServerName, p->name);
break;
case PRINTCAP_SOLARIS:
p;
p = (cupsd_printer_t *)cupsArrayNext(Printers))
cupsFilePrintf(fp, "%s:\\\n"
- "\t:bsdaddr=%s,%s:\\\n"
- "\t:description=%s:\n",
- p->name, ServerName, p->name, p->info ? p->info : "");
+ "\t:bsdaddr=%s,%s:\\\n"
+ "\t:description=%s:\n",
+ p->name, ServerName, p->name,
+ p->info ? p->info : "");
break;
}
}
"number-up-default", 1);
if (!cupsGetOption("orientation-requested", p->num_options, p->options))
- ippAddInteger(p->attrs, IPP_TAG_PRINTER, IPP_TAG_ENUM,
- "orientation-requested-default", IPP_PORTRAIT);
+ ippAddString(p->attrs, IPP_TAG_PRINTER, IPP_TAG_NOVALUE,
+ "orientation-requested-default", NULL, NULL);
if (!cupsGetOption("notify-lease-duration", p->num_options, p->options))
ippAddInteger(p->attrs, IPP_TAG_PRINTER, IPP_TAG_INTEGER,
/*
- * End of "$Id: printers.c 6678 2007-07-16 18:03:35Z mike $".
+ * End of "$Id: printers.c 6970 2007-09-17 23:58:28Z mike $".
*/