FreeBSD/sys/boot/powerpc/ps3/devicename.c
int
ps3_getdev(void **vdev, const char *devspec, const char **path)
{
	struct ps3_devdesc **dev = (struct ps3_devdesc **)vdev;
	int rv = 0;

	/*
	 * If it looks like this is just a path and no
	 * device, go with the current device.
	 */
	if ((devspec == NULL) || (devspec[0] == '/') ||
	    (strchr(devspec, ':') == NULL)) {
		rv = ps3_parsedev(dev, getenv("currdev"), NULL);

		if (rv == 0 && path != NULL)
			*path = devspec;
		return(rv);
	}

	/*
	 * Try to parse the device name off the beginning of the devspec.
	 */
	return (ps3_parsedev(dev, devspec, path));
}
/*
 * 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
ps3_getdev(void **vdev, const char *devspec, const char **path)
{
	struct ps3_devdesc **dev = (struct ps3_devdesc **)vdev;
	int rv = 0;
	if ((devspec == NULL) || (devspec[0] == '/') ||
	    (strchr(devspec, ':') == NULL)) {
		rv = ps3_parsedev(dev, getenv("currdev"), NULL);
		if (rv == 0 && path != NULL)
			*path = devspec;
		return(rv);
	}
	return (ps3_parsedev(dev, devspec, path));
}
int ps3_getdev ( void * * vdev , const char * devspec , const char * * path ) { struct ps3_devdesc * * dev = ( struct ps3_devdesc * * ) vdev ; int rv = 0 ; if ( ( devspec == NULL ) || ( devspec [ 0 ] == ' ' ) || ( strchr ( devspec , ' ' ) == NULL ) ) { rv = ps3_parsedev ( dev , getenv ( " " ) , NULL ) ; if ( rv == 0 && path != NULL ) * path = devspec ; return ( rv ) ; } return ( ps3_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.
	 */