FreeBSD/sys/boot/ofw/libofw/devicename.c
/* 
 * Point (dev) at an allocated device specifier for the device matching the
 * path in (devspec). If it contains an explicit device specification,
 * use that.  If not, use the default device.
 */
Point (dev) at an allocated device specifier for the device matching the
path in (devspec). If it contains an explicit device specification,
use that.  If not, use the default device.
Point ( dev ) at an allocated device specifier for the device matching the path in ( devspec ) . If it contains an explicit device specification use that . If not use the default device .
int
ofw_getdev(void **vdev, const char *devspec, const char **path)
{
    struct ofw_devdesc **dev = (struct ofw_devdesc **)vdev;
    int				rv;
    if ((devspec == NULL) || 
	((strchr(devspec, '@') == NULL) &&
	(strchr(devspec, ':') == NULL))) {
	if (((rv = ofw_parsedev(dev, getenv("currdev"), NULL)) == 0) &&
	    (path != NULL))
		*path = devspec;
	return(rv);
    }
    return(ofw_parsedev(dev, devspec, path));
}
int ofw_getdev ( void * * vdev , const char * devspec , const char * * path ) { struct ofw_devdesc * * dev = ( struct ofw_devdesc * * ) vdev ; int rv ; if ( ( devspec == NULL ) || ( ( strchr ( devspec , ' ' ) == NULL ) && ( strchr ( devspec , ' ' ) == NULL ) ) ) { if ( ( ( rv = ofw_parsedev ( dev , getenv ( " " ) , NULL ) ) == 0 ) && ( path != NULL ) ) * path = devspec ; return ( rv ) ; } return ( ofw_parsedev ( dev , devspec , path ) ) ; }
Point (dev) at an allocated device specifier for the device matching the
 path in (devspec).
Point ( dev ) at an allocated device specifier for the device matching the path in ( devspec ) .
/*
     * If it looks like this is just a path and no
     * device, go with the current device.
     */ /*
     * Try to parse the device name off the beginning of the devspec
     */