Lines Matching +full:enable +full:- +full:remote +full:- +full:sense
1 /*-
2 * SPDX-License-Identifier: BSD-4-Clause
41 #include "lp.cdefs.h" /* A cross-platform version of <sys/cdefs.h> */
78 * new-line to null and leaves it in line.
122 if ((dirp = opendir(pp->spool_dir)) == NULL) { in getq()
124 return (-1); in getq()
143 if (d->d_name[0] != 'c' || d->d_name[1] != 'f') in getq()
146 statres = stat(d->d_name, &stbuf); in getq()
150 entrysz = sizeof(struct jobqueue) - sizeof(q->job_cfname) + in getq()
151 strlen(d->d_name) + 1; in getq()
155 q->job_matched = 0; in getq()
156 q->job_processed = 0; in getq()
157 q->job_time = stbuf.st_mtime; in getq()
158 strcpy(q->job_cfname, d->d_name); in getq()
172 queue[nitems-1] = q; in getq()
183 return (-1); in getq()
197 if (qe1->job_time < qe2->job_time) in compar()
198 return (-1); in compar()
199 if (qe1->job_time > qe2->job_time) in compar()
202 * At this point, the two files have the same last-modification time. in compar()
208 if ((qe1->job_cfname[3] == '9') && (qe2->job_cfname[3] == '0')) in compar()
209 return (-1); in compar()
210 if ((qe1->job_cfname[3] == '0') && (qe2->job_cfname[3] == '9')) in compar()
212 return (strcmp(qe1->job_cfname, qe2->job_cfname)); in compar()
220 * provides a non-null value for ''hostpp', then this returns a pointer to
224 * but some implementations have that as an extra file-sequence letter, and
242 jnum = jnum * 10 + (*cp - '0'); in calc_jobnum()
254 jnum = jnum * 10 + (*cp - '0'); in calc_jobnum()
286 if (pp->lock_file[0] == '/') in lock_file_name()
287 strlcpy(buf, pp->lock_file, len); in lock_file_name()
289 snprintf(buf, len, "%s/%s", pp->spool_dir, pp->lock_file); in lock_file_name()
304 if (pp->status_file[0] == '/') in status_file_name()
305 strlcpy(buf, pp->status_file, len); in status_file_name()
307 snprintf(buf, len, "%s/%s", pp->spool_dir, pp->status_file); in status_file_name()
317 * XXX - Note that this works by changing access-bits on the
335 * Find what the current access-bits are. in set_qstate()
360 failmsg = "set queue-changed"; in set_qstate()
382 failmsg = "enable queuing"; in set_qstate()
388 failmsg = "enable printing"; in set_qstate()
453 /* routine to get a current timestamp, optionally in a standard-fmt string */
471 /* nanosec-aware rtn failed, fall back to microsec-aware rtn */ in lpd_gettime()
474 tsp->tv_sec = btime.tv_sec; in lpd_gettime()
475 tsp->tv_nsec = btime.tv_usec * 1000; in lpd_gettime()
478 /* caller may not need a character-ized version */ in lpd_gettime()
483 localtime(&tsp->tv_sec)); in lpd_gettime()
487 * (timezone as [+-]hhmm ) like %Z (timezone as characters), or in lpd_gettime()
496 if ((*destp != '+') && (*destp != '-')) { in lpd_gettime()
501 tzhr--; in lpd_gettime()
502 strcpy(savday, destp + strlen(destp) - 4); in lpd_gettime()
503 snprintf(destp, (destp - tempstr), "%+03d%02d", in lpd_gettime()
504 (-1*tzhr), tzmin % 60); in lpd_gettime()
517 /* routines for writing transfer-statistic records */
530 * filename could be coming from a remote-host, and thus might in trstat_init()
533 memset(pp->jobnum, 0, sizeof(pp->jobnum)); in trstat_init()
534 pp->jobnum[0] = '0'; in trstat_init()
538 destp = &(pp->jobnum[0]); in trstat_init()
546 * save those away along with the file-number */ in trstat_init()
547 pp->jobdfnum = filenum; in trstat_init()
548 lpd_gettime(&pp->tr_start, pp->tr_timestr, (size_t)TIMESTR_SIZE); in trstat_init()
565 remspace = eostat - xStr; \ in trstat_write()
568 lpd_gettime(&pp->tr_done, NULL, (size_t)0); in trstat_write()
569 trtime = DIFFTIME_TS(pp->tr_done, pp->tr_start); in trstat_write()
576 statfname = pp->stat_send; in trstat_write()
582 statfname = pp->stat_recv; in trstat_write()
593 statfname = pp->stat_send; in trstat_write()
596 if (pp->lp) recvdev = pp->lp; in trstat_write()
606 * the original-host and userid are found out by reading thru the in trstat_write()
607 * cf (control-file) for the job. Unfortunately, on incoming jobs in trstat_write()
608 * the df's (data-files) are sent before the matching cf, so the in trstat_write()
609 * orighost & userid are generally not-available for incoming jobs. in trstat_write()
611 * (it would be nice to create a work-around for that..) in trstat_write()
625 * <tstamp> - time the transfer started in trstat_write()
626 * <ptrqueue> - name of the printer queue (the short-name...) in trstat_write()
627 * <hname> - hostname the file originally came from (the in trstat_write()
629 * <xxx> - id of job from that host (generally three digits) in trstat_write()
630 * <n> - file count (# of file within job) in trstat_write()
631 * <rectype> - 4-byte field indicating the type of transfer in trstat_write()
635 * user=<userid> - user who sent the job (if known) in trstat_write()
636 * secs=<n> - seconds it took to transfer the file in trstat_write()
637 * bytes=<n> - number of bytes transferred (ie, "bytecount") in trstat_write()
638 * bps=<n.n>e<n> - Bytes/sec (if the transfer was "big enough" in trstat_write()
640 * ! top=<str> - type of printer (if the type is defined in in trstat_write()
643 * ! qls=<n> - queue-length at start of send/print-ing a job in trstat_write()
644 * ! qle=<n> - queue-length at end of send/print-ing a job in trstat_write()
645 * sip=<addr> - IP address of sending host, only included when in trstat_write()
647 * shost=<hname> - sending host (if that does != the original host) in trstat_write()
648 * rhost=<hname> - hostname receiving the file (ie, "destination") in trstat_write()
649 * rdev=<dev> - device receiving the file, when the file is being in trstat_write()
650 * send to a device instead of a remote host. in trstat_write()
661 * in some sense "optional", or their order may vary. "Optional" may in trstat_write()
662 * mean in the sense that different SITES might choose to have other in trstat_write()
668 pp->tr_timestr, pp->printer, lprhost, pp->jobnum, in trstat_write()
669 pp->jobdfnum, rectype); in trstat_write()
718 strcpy(statline+STATLINE_SIZE-2, "\n"); in trstat_write()
744 if (pp && pp->printer) in fatal()
745 (void)printf("%s: ", pp->printer); in fatal()
766 * had never been open()-ed. */ in closeallfds()