probe-printer.c revision 4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3
42a7bded1b1244af097afdc88654381a3d3879f9jacobs/***************************************************************************
42a7bded1b1244af097afdc88654381a3d3879f9jacobs * probe-printer.c : Probe for prnio(7i) printer device information
42a7bded1b1244af097afdc88654381a3d3879f9jacobs * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
42a7bded1b1244af097afdc88654381a3d3879f9jacobs * Use is subject to license terms.
42a7bded1b1244af097afdc88654381a3d3879f9jacobs * Licensed under the Academic Free License version 2.1
42a7bded1b1244af097afdc88654381a3d3879f9jacobs **************************************************************************/
42a7bded1b1244af097afdc88654381a3d3879f9jacobs#pragma ident "%Z%%M% %I% %E% SMI"
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobsprnio_printer_info(char *device_file, char **manufacturer, char **model,
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs char **description, char **serial_number, char ***command_set)
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs if ((fd = open (device_file, O_RDONLY | O_NONBLOCK)) < 0) {
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs rc = ieee1284_devid_to_printer_info(buf, manufacturer, model,
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs * It is assumed that all devices that support prnio(7i), also have a link
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobsstatic char *
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs if (((devfs_path = getenv("HAL_PROP_SOLARIS_DEVFS_PATH")) != NULL) &&
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs if ((device_file = getenv("HAL_PROP_PRINTER_DEVICE")) == NULL)
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs if ((cs = libhal_device_new_changeset(udi)) == NULL) {
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs /* Probe the printer for characteristics via prnio(7i) */
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs ret = prnio_printer_info(device_file, &manufacturer, &model,
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs /* Add printer characteristics to the HAL device tree */
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs ret = add_printer_info(cs, udi, manufacturer, model, description,
4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3jacobs HAL_DEBUG(("Cannot add printer data for %s to %s: %s",