/***************************************************************************
*
* probe-printer.c : Probe for prnio(7i) printer device information
*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* Licensed under the Academic Free License version 2.1
*
**************************************************************************/
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <errno.h>
#include <string.h>
#include <strings.h>
#include <ctype.h>
#include <stdlib.h>
#include <stdio.h>
#include <dirent.h>
#include <fcntl.h>
#include <unistd.h>
#include <ctype.h>
#include <libhal.h>
#include <logger.h>
#include "printer.h"
static int
{
goto prnio_out;
}
goto prnio_out;
}
if (fd != -1)
return (rc);
}
/*
* It is assumed that all devices that support prnio(7i), also have a link
*/
static char *
prnio_device_name(void)
{
char *devfs_path;
break;
}
}
}
return (result);
}
int
{
char *udi;
char *device_file;
goto out;
if (device_file == NULL)
goto out;
setup_logger();
goto out;
HAL_DEBUG(("Cannot allocate changeset"));
goto out;
}
/* Probe the printer for characteristics via prnio(7i) */
if (ret < 0) {
HAL_DEBUG(("Cannot get prnio data for %s: %s",
goto out;
}
/* Add printer characteristics to the HAL device tree */
if (ret < 0) {
HAL_DEBUG(("Cannot add printer data for %s to %s: %s",
goto out;
}
ret = 0;
out:
}
if (dbus_error_is_set(&error)) {
}
}
return (ret);
}