Skip to content

Commit

Permalink
Update build to work with current PAPPL 2.x (master)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelrsweet committed Dec 27, 2023
1 parent 8933709 commit 233e08b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion daemon/cups-locald.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ extern void *LocalDBusService(void *data);

extern const char *LocalDriverAutoAdd(const char *device_info, const char *device_uri, const char *device_id, void *data);
extern bool LocalDriverCallback(pappl_system_t *system, const char *driver_name, const char *device_uri, const char *device_id, pappl_pr_driver_data_t *driver_data, ipp_t **driver_attrs, void *data);
extern bool LocalTransformFilter(pappl_job_t *job, pappl_device_t *device, void *data);
extern bool LocalTransformFilter(pappl_job_t *job, int doc_number, pappl_pr_options_t *options, pappl_device_t *device, void *data);


#endif // !CUPS_LOCALD_H
5 changes: 3 additions & 2 deletions daemon/drivers.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ static bool pcl_rstartjob(pappl_job_t *job, pappl_pr_options_t *options, pappl_d
static bool pcl_rstartpage(pappl_job_t *job, pappl_pr_options_t *options, pappl_device_t *device, unsigned page);
static bool pcl_rwriteline(pappl_job_t *job, pappl_pr_options_t *options, pappl_device_t *device, unsigned y, const unsigned char *pixels);

static bool pclps_print(pappl_job_t *job, pappl_pr_options_t *options, pappl_device_t *device);
static bool pclps_print(pappl_job_t *job, int doc_number, pappl_pr_options_t *options, pappl_device_t *device);
static bool pclps_status(pappl_printer_t *printer);
static bool pclps_update_status(pappl_printer_t *printer, pappl_device_t *device);

Expand Down Expand Up @@ -1285,6 +1285,7 @@ pcl_rwriteline(
static bool // O - `true` on success, `false` on failure
pclps_print(
pappl_job_t *job, // I - Job
int doc_number, // I - Document number (`1`-based)
pappl_pr_options_t *options, // I - Options
pappl_device_t *device) // I - Device
{
Expand All @@ -1297,7 +1298,7 @@ pclps_print(

papplJobSetImpressions(job, 1);

fd = open(papplJobGetFilename(job), O_RDONLY);
fd = open(papplJobGetDocumentFilename(job, doc_number), O_RDONLY);

while ((bytes = read(fd, buffer, sizeof(buffer))) > 0)
{
Expand Down
19 changes: 12 additions & 7 deletions daemon/transform.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ static void process_attr_message(pappl_job_t *job, char *message);

bool // O - `true` on success, `false` on failure
LocalTransformFilter(
pappl_job_t *job, // I - Job
pappl_device_t *device, // I - Output device
void *cbdata) // I - Callback data (not used)
pappl_job_t *job, // I - Job
int doc_number, // I - Document number (1-based)
pappl_pr_options_t *options, // I - Print options
pappl_device_t *device, // I - Output device
void *cbdata) // I - Callback data (not used)
{
size_t i; // Looping var
pappl_printer_t *printer; // Printer for job
Expand Down Expand Up @@ -83,7 +85,7 @@ LocalTransformFilter(

// Setup the command-line arguments...
xargv[0] = "ipptransform";
xargv[1] = papplJobGetFilename(job);
xargv[1] = papplJobGetDocumentFilename(job, doc_number);
xargv[2] = NULL;

// Copy the current environment, then add environment variables for every
Expand All @@ -97,7 +99,7 @@ LocalTransformFilter(
goto transform_failure;
}

if (asprintf(xenvp + xenvc, "CONTENT_TYPE=%s", papplJobGetFormat(job)) > 0)
if (asprintf(xenvp + xenvc, "CONTENT_TYPE=%s", papplJobGetDocumentFormat(job, doc_number)) > 0)
xenvc ++;

if (pdata.format && asprintf(xenvp + xenvc, "OUTPUT_TYPE=%s", pdata.format) > 0)
Expand Down Expand Up @@ -141,8 +143,11 @@ LocalTransformFilter(
// value(s) from the attribute.
const char *name; // Attribute name

if ((attr = papplJobGetAttribute(job, jattrs[i])) == NULL)
continue;
if ((attr = papplJobGetDocumentAttribute(job, doc_number, jattrs[i])) == NULL)
{
if ((attr = papplJobGetAttribute(job, jattrs[i])) == NULL)
continue;
}

name = ippGetName(attr);
valptr = val;
Expand Down

0 comments on commit 233e08b

Please sign in to comment.