openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/util-linux/2.33.2-r0/util-linux-2.33.2/libmount/src/optstr.c
int mnt_optstr_get_option(const char* optstr, const char* name, char** value,
                          size_t* valsz)
{
    struct libmnt_optloc ol;
    int rc;

    if (!optstr || !name)
        return -EINVAL;

    mnt_init_optloc(&ol);

    rc = mnt_optstr_locate_option((char*)optstr, name, &ol);
    if (!rc)
    {
        if (value)
            *value = ol.value;
        if (valsz)
            *valsz = ol.valsz;
    }
    return rc;
}
/**
 * mnt_optstr_get_option:
 * @optstr: string with a comma separated list of options
 * @name: requested option name
 * @value: returns a pointer to the beginning of the value (e.g. name=VALUE) or
 * NULL
 * @valsz: returns size of the value or 0
 *
 * Returns: 0 on success, 1 when not found the @name or negative number in case
 * of error.
 */
@optstr: string with a comma separated list of options
@name: requested option name
@value: returns a pointer to the beginning of the value  or
NULL
@valsz: returns size of the value or 0

0 on success, 1 when not found the @name or negative number in case
of error.
@optstr : string with a comma separated list of options @name : requested option name @value : returns a pointer to the beginning of the value or NULL @valsz : returns size of the value or 0 0 on success 1 when not found the @name or negative number in case of error .
int mnt_optstr_get_option(const char* optstr, const char* name, char** value,
                          size_t* valsz)
{
    struct libmnt_optloc ol;
    int rc;
    if (!optstr || !name)
        return -EINVAL;
    mnt_init_optloc(&ol);
    rc = mnt_optstr_locate_option((char*)optstr, name, &ol);
    if (!rc)
    {
        if (value)
            *value = ol.value;
        if (valsz)
            *valsz = ol.valsz;
    }
    return rc;
}
int mnt_optstr_get_option ( const char * optstr , const char * name , char * * value , size_t * valsz ) { struct libmnt_optloc ol ; int rc ; if ( ! optstr || ! name ) return - EINVAL ; mnt_init_optloc ( & ol ) ; rc = mnt_optstr_locate_option ( ( char * ) optstr , name , & ol ) ; if ( ! rc ) { if ( value ) * value = ol . value ; if ( valsz ) * valsz = ol . valsz ; } return rc ; }
mnt_optstr_get_option:
 @optstr: string with a comma separated list of options
 @name: requested option name
 @value: returns a pointer to the beginning of the value (e.g.
mnt_optstr_get_option : @optstr : string with a comma separated list of options @name : requested option name @value : returns a pointer to the beginning of the value ( e . g .