Skip to content

Commit

Permalink
Save and load next job-id, printer-config-change-[date-]time, and
Browse files Browse the repository at this point in the history
printer-impressions-completed values.
  • Loading branch information
michaelrsweet committed Feb 1, 2020
1 parent b8de27c commit eddba2f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ LPrint Change History
=====================

v1.0rc1 - February ??, 2020
---------------00----------
---------------------------

- Updated media documentation (Issue #13)
- Now save and load next job-id value for each printer, along with the
printer-config-change-[date-]time and printer-impressions-completed values.
- Fixed some small memory leaks.


Expand Down
15 changes: 15 additions & 0 deletions server-system.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,18 @@ load_config(lprint_system_t *system) // I - System
{
lprintLog(system, LPRINT_LOGLEVEL_ERROR, "Missing value for '%s' on line %d of '%s'.", line, linenum, configfile);
}
else if (!strcmp(line, "ConfigTime"))
{
printer->config_time = (time_t)strtol(value, NULL, 10);
}
else if (!strcmp(line, "ImpCompleted"))
{
printer->impcompleted = atoi(value);
}
else if (!strcmp(line, "NextJobId"))
{
printer->next_job_id = atoi(value);
}
else
{
// Delete any existing attribute...
Expand Down Expand Up @@ -742,6 +754,9 @@ save_config(lprint_system_t *system) // I - System
for (printer = (lprint_printer_t *)cupsArrayFirst(system->printers); printer; printer = (lprint_printer_t *)cupsArrayNext(system->printers))
{
cupsFilePrintf(fp, "Printer %s %d %s %s\n", printer->printer_name, printer->printer_id, printer->device_uri, printer->driver_name);
cupsFilePrintf(fp, "ConfigTime %ld\n", (long)printer->config_time);
cupsFilePrintf(fp, "ImpCompleted %d\n", printer->impcompleted);
cupsFilePrintf(fp, "NextJobId %d\n", printer->next_job_id);
if (printer->driver->mode_supported)
cupsFilePutConf(fp, "label-mode-configured", lprintLabelModeString(printer->driver->mode_configured));
if (printer->driver->tear_offset_supported[0] != printer->driver->tear_offset_supported[1])
Expand Down

0 comments on commit eddba2f

Please sign in to comment.