Lines Matching +full:ps +full:- +full:hold

1 /*-
2 * Copyright (c) 2005-2006 The FreeBSD Project
5 * Author: Victor Cruceru <soc-victor@freebsd.org>
66 * This structure is used to hold a SNMP table entry
67 * for HOST-RESOURCES-MIB's hrPrinterTable.
103 entry->index = devEntry->index; in printer_entry_create()
132 if (entry->index == idx) in printer_find_by_index()
149 enum PrinterStatus ps = PS_UNKNOWN; in get_printer_status() local
151 if (pp->lock_file[0] == '/') in get_printer_status()
152 strlcpy(lockfile, pp->lock_file, sizeof(lockfile)); in get_printer_status()
155 pp->spool_dir, pp->lock_file); in get_printer_status()
159 ps = PS_IDLE; in get_printer_status()
163 if (pp->status_file[0] == '/') in get_printer_status()
164 strlcpy(statfile, pp->status_file, sizeof(statfile)); in get_printer_status()
167 pp->spool_dir, pp->status_file); in get_printer_status()
172 ps = PS_UNKNOWN; in get_printer_status()
177 if (fgets(fline, sizeof(fline) -1, f) == NULL) { in get_printer_status()
178 ps = PS_UNKNOWN; in get_printer_status()
183 ps = PS_PRINTING; in get_printer_status()
188 ps = PS_OTHER; in get_printer_status()
199 return (ps); in get_printer_status()
213 if (pp->remote_host != NULL) { in handle_printer()
214 HRDBG("skipped %s -- remote", pp->printer); in handle_printer()
218 if (strncmp(pp->lp, _PATH_DEV, strlen(_PATH_DEV)) != 0) { in handle_printer()
219 HRDBG("skipped %s [device %s] -- remote", pp->printer, pp->lp); in handle_printer()
224 snprintf(dev_only, sizeof(dev_only), "%s", pp->lp + strlen(_PATH_DEV)); in handle_printer()
226 HRDBG("printer %s has device %s", pp->printer, dev_only); in handle_printer()
228 if (stat(pp->lp, &sb) < 0) { in handle_printer()
230 HRDBG("skipped %s -- device %s missing", in handle_printer()
231 pp->printer, pp->lp); in handle_printer()
237 HRDBG("%s not in hrDeviceTable", pp->lp); in handle_printer()
240 HRDBG("%s found in hrDeviceTable", pp->lp); in handle_printer()
241 dev_entry->type = &OIDX_hrDevicePrinter_c; in handle_printer()
243 dev_entry->flags |= HR_DEVICE_IMMUTABLE; in handle_printer()
246 if ((printer_entry = printer_find_by_index(dev_entry->index)) == NULL && in handle_printer()
250 printer_entry->flags |= HR_PRINTER_FOUND; in handle_printer()
251 printer_entry->status = get_printer_status(pp); in handle_printer()
252 memset(printer_entry->detectedErrorState, 0, in handle_printer()
253 sizeof(printer_entry->detectedErrorState)); in handle_printer()
263 HRDBG("---->Getting printers ....."); in hrPrinter_get_OS_entries()
270 HRDBG("---->Got printer %s", pp->printer); in hrPrinter_get_OS_entries()
279 pp->printer ? pp->printer : "<noname?>"); in hrPrinter_get_OS_entries()
328 entry->flags &= ~HR_PRINTER_FOUND; in refresh_printer_tbl()
338 if (!(entry->flags & HR_PRINTER_FOUND)) in refresh_printer_tbl()
359 if ((entry = NEXT_OBJECT_INT(&printer_tbl, &value->var, in op_hrPrinterTable()
362 value->var.len = sub + 1; in op_hrPrinterTable()
363 value->var.subs[sub] = entry->index; in op_hrPrinterTable()
367 if ((entry = FIND_OBJECT_INT(&printer_tbl, &value->var, in op_hrPrinterTable()
373 if ((entry = FIND_OBJECT_INT(&printer_tbl, &value->var, in op_hrPrinterTable()
385 switch (value->var.subs[sub - 1]) { in op_hrPrinterTable()
388 value->v.integer = entry->status; in op_hrPrinterTable()
392 return (string_get(value, entry->detectedErrorState, in op_hrPrinterTable()
393 sizeof(entry->detectedErrorState))); in op_hrPrinterTable()