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/libfdisk/src/context.c
struct fdisk_label* fdisk_get_label(struct fdisk_context* cxt, const char* name)
{
    size_t i;

    assert(cxt);

    if (!name)
        return cxt->label;
    else if (strcasecmp(name, "mbr") == 0)
        name = "dos";

    for (i = 0; i < cxt->nlabels; i++)
        if (cxt->labels[i] && strcasecmp(cxt->labels[i]->name, name) == 0)
            return cxt->labels[i];

    DBG(CXT, ul_debugobj(cxt, "failed to found %s label driver", name));
    return NULL;
}
/**
 * fdisk_get_label:
 * @cxt: context instance
 * @name: label name (e.g. "gpt")
 *
 * If no @name specified then returns the current context label.
 *
 * The label is allocated and maintained within the context #cxt. There is
 * nothing like reference counting for labels, you cannot deallocate the
 * label.
 *
 * Returns: label struct or NULL in case of error.
 */
@cxt: context instance
@name: label name

If no @name specified then returns the current context label.

The label is allocated and maintained within the context #cxt. There is
nothing like reference counting for labels, you cannot deallocate the
label.

label struct or NULL in case of error.
@cxt : context instance @name : label name If no @name specified then returns the current context label . The label is allocated and maintained within the context #cxt . There is nothing like reference counting for labels you cannot deallocate the label . label struct or NULL in case of error .
struct fdisk_label* fdisk_get_label(struct fdisk_context* cxt, const char* name)
{
    size_t i;
    assert(cxt);
    if (!name)
        return cxt->label;
    else if (strcasecmp(name, "mbr") == 0)
        name = "dos";
    for (i = 0; i < cxt->nlabels; i++)
        if (cxt->labels[i] && strcasecmp(cxt->labels[i]->name, name) == 0)
            return cxt->labels[i];
    DBG(CXT, ul_debugobj(cxt, "failed to found %s label driver", name));
    return NULL;
}
struct fdisk_label * fdisk_get_label ( struct fdisk_context * cxt , const char * name ) { size_t i ; assert ( cxt ) ; if ( ! name ) return cxt -> label ; else if ( strcasecmp ( name , " " ) == 0 ) name = " " ; for ( i = 0 ; i < cxt -> nlabels ; i ++ ) if ( cxt -> labels [ i ] && strcasecmp ( cxt -> labels [ i ] -> name , name ) == 0 ) return cxt -> labels [ i ] ; DBG ( CXT , ul_debugobj ( cxt , " " , name ) ) ; return NULL ; }
fdisk_get_label:
 @cxt: context instance
 @name: label name (e.g.
fdisk_get_label : @cxt : context instance @name : label name ( e . g .