summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
a66618f)
Print jobs maintain two job identifiers, the jobid allocated by the
spoolss layer (pj->jobid), and the job identifier defined by the
printing backend (pj->sysjob).
Printer job queues currently only contain a single job identifier
variable (queue->job), the variable is sometimes representative of the
spoolss layer job identifier, and more often representative of the
printing backend id.
This change renames the queue job identifier from queue->job to
queue->sysjob, in preparation for a change to only store the printing
backend identifier.
};
typedef struct _print_queue_struct {
};
typedef struct _print_queue_struct {
- int job; /* normally the UNIX jobid -- see note in
+ int sysjob; /* normally the UNIX jobid -- see note in
printing.c:traverse_fn_delete() */
int size;
int page_count;
printing.c:traverse_fn_delete() */
int size;
int page_count;
- buf->job = atoi(tok[JOBTOK]);
+ buf->sysjob = atoi(tok[JOBTOK]);
buf->size = atoi(tok[TOTALTOK]);
buf->status = strequal(tok[RANKTOK],"active")?LPQ_PRINTING:LPQ_QUEUED;
buf->time = time(NULL);
buf->size = atoi(tok[TOTALTOK]);
buf->status = strequal(tok[RANKTOK],"active")?LPQ_PRINTING:LPQ_QUEUED;
buf->time = time(NULL);
- buf->job = atoi(tokarr[LPRNG_JOBTOK]);
+ buf->sysjob = atoi(tokarr[LPRNG_JOBTOK]);
buf->size = atoi(tokarr[LPRNG_TOTALTOK]);
if (strequal(tokarr[LPRNG_RANKTOK],"active")) {
buf->size = atoi(tokarr[LPRNG_TOTALTOK]);
if (strequal(tokarr[LPRNG_RANKTOK],"active")) {
- buf->job = atoi(tok[1]);
+ buf->sysjob = atoi(tok[1]);
buf->status = strequal(tok[0],"HELD")?LPQ_PAUSED:LPQ_QUEUED;
buf->priority = 0;
buf->time = time(NULL);
buf->status = strequal(tok[0],"HELD")?LPQ_PAUSED:LPQ_QUEUED;
buf->priority = 0;
buf->time = time(NULL);
- buf->job = atoi(tok[3]);
+ buf->sysjob = atoi(tok[3]);
buf->status = strequal(tok[2],"RUNNING")?LPQ_PRINTING:LPQ_QUEUED;
buf->priority = 0;
buf->time = time(NULL);
buf->status = strequal(tok[2],"RUNNING")?LPQ_PRINTING:LPQ_QUEUED;
buf->priority = 0;
buf->time = time(NULL);
/* fill things from header line */
buf->time = jobtime;
/* fill things from header line */
buf->time = jobtime;
buf->status = jobstat;
buf->priority = jobprio;
if (jobuser) {
buf->status = jobstat;
buf->priority = jobprio;
if (jobuser) {
- buf->job = atoi(tok[1]);
+ buf->sysjob = atoi(tok[1]);
buf->size = atoi(tok[3]);
if (count > 7 && strequal(tok[7],"on")) {
buf->status = LPQ_PRINTING;
buf->size = atoi(tok[3]);
if (count > 7 && strequal(tok[7],"on")) {
buf->status = LPQ_PRINTING;
- buf->job = atoi(tok[2]);
+ buf->sysjob = atoi(tok[2]);
buf->size = atoi(tok[4]);
buf->status = strequal(tok[3],"active")?LPQ_PRINTING:LPQ_QUEUED;
buf->priority = 0;
buf->size = atoi(tok[4]);
buf->status = strequal(tok[3],"active")?LPQ_PRINTING:LPQ_QUEUED;
buf->priority = 0;
- buf->job = atoi(tok[4]);
+ buf->sysjob = atoi(tok[4]);
buf->size = atoi(tok[7]);
if (strchr_m(tok[7],'K')) {
buf->size = atoi(tok[7]);
if (strchr_m(tok[7],'K')) {
parse_line->space3 = '\0';
trim_char(parse_line->jobname, '\0', ' ');
parse_line->space3 = '\0';
trim_char(parse_line->jobname, '\0', ' ');
- buf->job = atoi(parse_line->jobid);
+ buf->sysjob = atoi(parse_line->jobid);
buf->priority = 0;
buf->size = atoi(parse_line->size);
buf->time = time(NULL);
buf->priority = 0;
buf->size = atoi(parse_line->size);
buf->time = time(NULL);
- buf->job = atoi(parse_line->jobid);
+ buf->sysjob = atoi(parse_line->jobid);
/* Get the job name */
parse_line->space2[0] = '\0';
/* Get the job name */
parse_line->space2[0] = '\0';
while(next_token_talloc(frame, &cline, &tok, NULL)) {
switch (toknum) {
case 0:
while(next_token_talloc(frame, &cline, &tok, NULL)) {
switch (toknum) {
case 0:
+ buf->sysjob = atoi(tok);
break;
case 1:
buf->size = atoi(tok);
break;
case 1:
buf->size = atoi(tok);
temp->size = job_k_octets * 1024;
temp->status = job_status == IPP_JOB_PENDING ? LPQ_QUEUED :
job_status == IPP_JOB_STOPPED ? LPQ_PAUSED :
temp->size = job_k_octets * 1024;
temp->status = job_status == IPP_JOB_PENDING ? LPQ_QUEUED :
job_status == IPP_JOB_STOPPED ? LPQ_PAUSED :
temp->size = job_k_octets * 1024;
temp->status = job_status == IPP_JOB_PENDING ? LPQ_QUEUED :
job_status == IPP_JOB_STOPPED ? LPQ_PAUSED :
temp->size = job_k_octets * 1024;
temp->status = job_status == IPP_JOB_PENDING ? LPQ_QUEUED :
job_status == IPP_JOB_STOPPED ? LPQ_PAUSED :
struct printjob pj, *old_pj;
if (jobid == (uint32)-1)
struct printjob pj, *old_pj;
if (jobid == (uint32)-1)
- jobid = q->job + UNIX_JOB_START;
+ jobid = q->sysjob + UNIX_JOB_START;
/* Preserve the timestamp on an existing unix print job */
/* Preserve the timestamp on an existing unix print job */
pj.pid = (pid_t)-1;
pj.jobid = jobid;
pj.pid = (pid_t)-1;
pj.jobid = jobid;
pj.fd = -1;
pj.starttime = old_pj ? old_pj->starttime : q->time;
pj.status = q->status;
pj.fd = -1;
pj.starttime = old_pj ? old_pj->starttime : q->time;
pj.status = q->status;
/* remove a unix job if it isn't in the system queue any more */
for (i=0;i<ts->qcount;i++) {
/* remove a unix job if it isn't in the system queue any more */
for (i=0;i<ts->qcount;i++) {
- uint32 u_jobid = (ts->queue[i].job + UNIX_JOB_START);
+ uint32 u_jobid = (ts->queue[i].sysjob + UNIX_JOB_START);
if (jobid == u_jobid)
break;
}
if (jobid == u_jobid)
break;
}
FIXME!!! This is the only place where queue->job
represents the SMB jobid --jerry */
FIXME!!! This is the only place where queue->job
represents the SMB jobid --jerry */
- ts->queue[i].job = jobid;
+ ts->queue[i].sysjob = jobid;
ts->queue[i].size = pjob.size;
ts->queue[i].page_count = pjob.page_count;
ts->queue[i].status = pjob.status;
ts->queue[i].size = pjob.size;
ts->queue[i].page_count = pjob.page_count;
ts->queue[i].status = pjob.status;
qcount++;
data.dsize += tdb_pack(NULL, 0, "ddddddff",
qcount++;
data.dsize += tdb_pack(NULL, 0, "ddddddff",
+ (uint32)queue[i].sysjob,
(uint32)queue[i].size,
(uint32)queue[i].page_count,
(uint32)queue[i].status,
(uint32)queue[i].size,
(uint32)queue[i].page_count,
(uint32)queue[i].status,
continue;
len += tdb_pack(data.dptr + len, data.dsize - len, "ddddddff",
continue;
len += tdb_pack(data.dptr + len, data.dsize - len, "ddddddff",
+ (uint32)queue[i].sysjob,
(uint32)queue[i].size,
(uint32)queue[i].page_count,
(uint32)queue[i].status,
(uint32)queue[i].size,
(uint32)queue[i].page_count,
(uint32)queue[i].status,
- pjob->sysjob = queue[i].job;
+ pjob->sysjob = queue[i].sysjob;
/* don't reset the status on jobs to be deleted */
/* don't reset the status on jobs to be deleted */
&qtime,
queue[i].fs_user,
queue[i].fs_file);
&qtime,
queue[i].fs_user,
queue[i].fs_file);
+ queue[i].sysjob = qjob;
queue[i].size = qsize;
queue[i].page_count = qpage_count;
queue[i].status = qstatus;
queue[i].size = qsize;
queue[i].page_count = qpage_count;
queue[i].status = qstatus;
- queue[total_count].job = jobid;
+ queue[total_count].sysjob = jobid;
queue[total_count].size = pjob->size;
queue[total_count].page_count = pjob->page_count;
queue[total_count].status = pjob->status;
queue[total_count].size = pjob->size;
queue[total_count].page_count = pjob->page_count;
queue[total_count].status = pjob->status;
bool found = false;
for (j = 0; j < total_count; j++) {
bool found = false;
for (j = 0; j < total_count; j++) {
- if (queue[j].job == jobid) {
+ if (queue[j].sysjob == jobid) {
+ queue[j].sysjob = jobid;
queue[j].size = pjob->size;
queue[j].page_count = pjob->page_count;
queue[j].status = pjob->status;
queue[j].size = pjob->size;
queue[j].page_count = pjob->page_count;
queue[j].status = pjob->status;
for (i=0;i<njobs;i++) {
bool owner = is_owner(server_info, lp_const_servicename(snum),
for (i=0;i<njobs;i++) {
bool owner = is_owner(server_info, lp_const_servicename(snum),
if (owner || can_job_admin) {
print_job_delete1(server_event_context(), msg_ctx,
if (owner || can_job_admin) {
print_job_delete1(server_event_context(), msg_ctx,
+ snum, queue[i].sysjob);
struct spoolss_PrinterInfo2 *pinfo2,
TALLOC_CTX *mem_ctx)
{
struct spoolss_PrinterInfo2 *pinfo2,
TALLOC_CTX *mem_ctx)
{
- SETUP_SPOOLSS_NOTIFY_DATA_INTEGER(data, queue->job);
+ SETUP_SPOOLSS_NOTIFY_DATA_INTEGER(data, queue->sysjob);
}
/*******************************************************************
}
/*******************************************************************
&queue[j], info,
pinfo2, snum,
&option_type,
&queue[j], info,
pinfo2, snum,
&option_type,
t = gmtime(&queue->time);
t = gmtime(&queue->time);
- r->job_id = queue->job;
+ r->job_id = queue->sysjob;
r->printer_name = talloc_strdup(mem_ctx, lp_servicename(snum));
W_ERROR_HAVE_NO_MEMORY(r->printer_name);
r->printer_name = talloc_strdup(mem_ctx, lp_servicename(snum));
W_ERROR_HAVE_NO_MEMORY(r->printer_name);
t = gmtime(&queue->time);
t = gmtime(&queue->time);
- r->job_id = queue->job;
+ r->job_id = queue->sysjob;
r->printer_name = talloc_strdup(mem_ctx, lp_servicename(snum));
W_ERROR_HAVE_NO_MEMORY(r->printer_name);
r->printer_name = talloc_strdup(mem_ctx, lp_servicename(snum));
W_ERROR_HAVE_NO_MEMORY(r->printer_name);
int position, int snum,
struct spoolss_PrinterInfo2 *pinfo2)
{
int position, int snum,
struct spoolss_PrinterInfo2 *pinfo2)
{
- r->job_id = queue->job;
+ r->job_id = queue->sysjob;
r->next_job_id = 0;
if (next_queue) {
r->next_job_id = 0;
if (next_queue) {
- r->next_job_id = next_queue->job;
+ r->next_job_id = next_queue->sysjob;
bool found = false;
for (i=0; i<count; i++) {
bool found = false;
for (i=0; i<count; i++) {
- if (queue[i].job == (int)jobid) {
+ if (queue[i].sysjob == (int)jobid) {
WERROR result;
for (i=0; i<count; i++) {
WERROR result;
for (i=0; i<count; i++) {
- if (queue[i].job == (int)jobid) {
+ if (queue[i].sysjob == (int)jobid) {