Lines Matching +full:rate +full:- +full:lp +full:- +full:ms

1 /*-
2 * SPDX-License-Identifier: BSD-4-Clause
41 #include "lp.cdefs.h" /* A cross-platform version of <sys/cdefs.h> */
48 #include <sys/param.h> /* required for lp.h, but not used here */
50 #include "lp.h"
51 #include "lp.local.h"
82 * cgetent(3): -1 means we could not find what we wanted, -2
83 * means a system error occurred (and errno is set), -3 if a
88 * printcap-reading is consistent across the entire family.
121 case -1: in firstnextmap()
122 *status = -2; in firstnextmap()
124 case -2: in firstnextmap()
125 *status = -3; in firstnextmap()
134 * Return false of error or end-of-database; else true.
187 * This must match the order of declaration of enum filter in lp.h.
202 * and store a malloced copy of it in pp->printer.
211 if ((pp->printer = capdb_canonical_name(bp)) == NULL) in getprintcap_int()
215 CHK(capdb_getaltstr(bp, "af", "acct.file", 0, &pp->acct_file)); in getprintcap_int()
216 CHK(capdb_getaltnum(bp, "br", "tty.rate", 0, &pp->baud_rate)); in getprintcap_int()
218 &pp->conn_timeout)); in getprintcap_int()
220 &pp->daemon_user)); in getprintcap_int()
221 CHK(capdb_getaltstr(bp, "ff", "job.formfeed", DEFFF, &pp->form_feed)); in getprintcap_int()
223 &pp->log_file)); in getprintcap_int()
224 CHK(capdb_getaltstr(bp, "lo", "spool.lock", DEFLOCK, &pp->lock_file)); in getprintcap_int()
225 CHK(capdb_getaltstr(bp, "lp", "tty.device", _PATH_DEFDEVLP, &pp->lp)); in getprintcap_int()
227 &pp->max_copies)); in getprintcap_int()
228 CHK(capdb_getaltstr(bp, "ms", "tty.mode", 0, &pp->mode_set)); in getprintcap_int()
229 CHK(capdb_getaltnum(bp, "mx", "max.blocks", DEFMX, &pp->max_blocks)); in getprintcap_int()
230 CHK(capdb_getaltnum(bp, "pc", "acct.price", 0, &pp->price100)); in getprintcap_int()
232 &pp->page_length)); in getprintcap_int()
234 &pp->page_width)); in getprintcap_int()
235 CHK(capdb_getaltnum(bp, "px", "page.pwidth", 0, &pp->page_pwidth)); in getprintcap_int()
236 CHK(capdb_getaltnum(bp, "py", "page.plength", 0, &pp->page_plength)); in getprintcap_int()
238 &pp->restrict_grp)); in getprintcap_int()
239 CHK(capdb_getaltstr(bp, "rm", "remote.host", 0, &pp->remote_host)); in getprintcap_int()
241 &pp->remote_queue)); in getprintcap_int()
243 &pp->spool_dir)); in getprintcap_int()
244 CHK(capdb_getaltstr(bp, "sr", "stat.recv", 0, &pp->stat_recv)); in getprintcap_int()
245 CHK(capdb_getaltstr(bp, "ss", "stat.send", 0, &pp->stat_send)); in getprintcap_int()
247 &pp->status_file)); in getprintcap_int()
248 CHK(capdb_getaltstr(bp, "tr", "job.trailer", 0, &pp->trailer)); in getprintcap_int()
250 pp->resend_copies = capdb_getaltlog(bp, "rc", "remote.resend_copies"); in getprintcap_int()
251 pp->restricted = capdb_getaltlog(bp, "rs", "daemon.restricted"); in getprintcap_int()
252 pp->short_banner = capdb_getaltlog(bp, "sb", "banner.short"); in getprintcap_int()
253 pp->no_copies = capdb_getaltlog(bp, "sc", "job.no_copies"); in getprintcap_int()
254 pp->no_formfeed = capdb_getaltlog(bp, "sf", "job.no_formfeed"); in getprintcap_int()
255 pp->no_header = capdb_getaltlog(bp, "sh", "banner.disable"); in getprintcap_int()
256 pp->header_last = capdb_getaltlog(bp, "hl", "banner.last"); in getprintcap_int()
257 pp->rw = capdb_getaltlog(bp, "rw", "tty.rw"); in getprintcap_int()
258 pp->tof = !capdb_getaltlog(bp, "fo", "job.topofform"); in getprintcap_int()
266 pp->rp_matches_local = 1; in getprintcap_int()
270 pp->rp_matches_local = 0; in getprintcap_int()
279 &pp->filters[filt])); in getprintcap_int()
287 * made up for them from "lp.h".
322 * Free the dynamically-allocated strings in a `struct printer'.
330 cfree(pp->printer); in free_printer()
331 cfree(pp->acct_file); in free_printer()
333 cfree(pp->filters[filt]); in free_printer()
334 cfree(pp->form_feed); in free_printer()
335 cfree(pp->log_file); in free_printer()
336 cfree(pp->lock_file); in free_printer()
337 cfree(pp->lp); in free_printer()
338 cfree(pp->restrict_grp); in free_printer()
339 cfree(pp->remote_host); in free_printer()
340 cfree(pp->remote_queue); in free_printer()
341 cfree(pp->spool_dir); in free_printer()
342 cfree(pp->stat_recv); in free_printer()
343 cfree(pp->stat_send); in free_printer()
344 cfree(pp->status_file); in free_printer()
345 cfree(pp->trailer); in free_printer()
346 cfree(pp->mode_set); in free_printer()
432 if ((retval = malloc(nameend - bp + 1)) != NULL) { in capdb_canonical_name()
434 strncat(retval, bp, nameend - bp); in capdb_canonical_name()