FreeBSD/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
/*
 * Take a property=value argument string and add it to the given nvlist.
 * Modifies the argument inplace.
 */
Take a property=value argument string and add it to the given nvlist.
Modifies the argument inplace.
Take a property = value argument string and add it to the given nvlist . Modifies the argument inplace .
static int
parseprop(nvlist_t *props, char *propname)
{
	char *propval, *strval;
	if ((propval = strchr(propname, '=')) == NULL) {
		(void) fprintf(stderr, gettext("missing "
		    "'=' for property=value argument\n"));
		return (-1);
	}
	*propval = '\0';
	propval++;
	if (nvlist_lookup_string(props, propname, &strval) == 0) {
		(void) fprintf(stderr, gettext("property '%s' "
		    "specified multiple times\n"), propname);
		return (-1);
	}
	if (nvlist_add_string(props, propname, propval) != 0)
		nomem();
	return (0);
}
static int parseprop ( nvlist_t * props , char * propname ) { char * propval , * strval ; if ( ( propval = strchr ( propname , ' ' ) ) == NULL ) { ( void ) fprintf ( stderr , gettext ( " " " \n " ) ) ; return ( -1 ) ; } * propval = ' \0 ' ; propval ++ ; if ( nvlist_lookup_string ( props , propname , & strval ) == 0 ) { ( void ) fprintf ( stderr , gettext ( " " " \n " ) , propname ) ; return ( -1 ) ; } if ( nvlist_add_string ( props , propname , propval ) != 0 ) nomem ( ) ; return ( 0 ) ; }
Take a property=value argument string and add it to the given nvlist.
Take a property = value argument string and add it to the given nvlist .