Exemplo n.º 1
0
int
main(int argc, char **argv)
{
	int ch;

	while ((ch = getopt_long(argc, argv, "adh:p:uv",
		    longopts, NULL)) != -1) {
		switch (ch) {
		case 'a':
			all_flag++;
			break;
		case 'd':
			dump_flag++;
			break;
		case 'h':
			linker_hints = optarg;
			break;
		case 'p':
			nomatch_str = optarg;
			break;
		case 'u':
			unbound_flag++;
			break;
		case 'v':
			verbose_flag++;
			break;
		default:
			usage();
		}
	}
	argc -= optind;
	argv += optind;

	if (argc >= 1)
		usage();

	read_linker_hints();
	if (dump_flag) {
		search_hints(NULL, NULL, NULL);
		exit(0);
	}

	if (devinfo_init())
		err(1, "devinfo_init");
	if ((root = devinfo_handle_to_device(DEVINFO_ROOT_DEVICE)) == NULL)
		errx(1, "can't find root device");
	if (nomatch_str != NULL)
		find_nomatch(nomatch_str);
	else
		devinfo_foreach_device_child(root, find_unmatched, (void *)0);
	devinfo_free();
}
Exemplo n.º 2
0
static int
acpi0_present(void)
{
	struct devinfo_dev *root;
	int found;

	found = 0;
	devinfo_init();
	root = devinfo_handle_to_device(DEVINFO_ROOT_DEVICE);
	if (root != NULL)
		found = devinfo_foreach_device_child(root, acpi0_check, NULL);
	devinfo_free();
	return found;
}