openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/sysfsutils/2.1.0-r5/sysfsutils-2.1.0/cmd/systool.c
static void show_attribute(struct sysfs_attribute* attr, int level)
{
    if (!attr)
        return;

    if (show_options & SHOW_ALL_ATTRIB_VALUES)
    {
        indent(level);
        fprintf(stdout, "%-20s= ", attr->name);
        show_attribute_value(attr, level);
    }
    else if ((show_options & SHOW_ATTRIBUTES) ||
             ((show_options & SHOW_ATTRIBUTE_VALUE) &&
              (strcmp(attr->name, attribute_to_show) == 0)))
    {
        indent(level);
        fprintf(stdout, "%-20s", attr->name);
        if (show_options & SHOW_ATTRIBUTE_VALUE && attr->value != NULL &&
            (strcmp(attr->name, attribute_to_show)) == 0)
        {
            fprintf(stdout, "= ");
            show_attribute_value(attr, level);
        }
        else
            fprintf(stdout, "\n");
    }
}
/**
 * show_attribute: prints out a single attribute
 * @attr: attribute to print.
 */
prints out a single attribute
@attr: attribute to print.
prints out a single attribute @attr : attribute to print .
static void show_attribute(struct sysfs_attribute* attr, int level)
{
    if (!attr)
        return;
    if (show_options & SHOW_ALL_ATTRIB_VALUES)
    {
        indent(level);
        fprintf(stdout, "%-20s= ", attr->name);
        show_attribute_value(attr, level);
    }
    else if ((show_options & SHOW_ATTRIBUTES) ||
             ((show_options & SHOW_ATTRIBUTE_VALUE) &&
              (strcmp(attr->name, attribute_to_show) == 0)))
    {
        indent(level);
        fprintf(stdout, "%-20s", attr->name);
        if (show_options & SHOW_ATTRIBUTE_VALUE && attr->value != NULL &&
            (strcmp(attr->name, attribute_to_show)) == 0)
        {
            fprintf(stdout, "= ");
            show_attribute_value(attr, level);
        }
        else
            fprintf(stdout, "\n");
    }
}
static void show_attribute ( struct sysfs_attribute * attr , int level ) { if ( ! attr ) return ; if ( show_options & SHOW_ALL_ATTRIB_VALUES ) { indent ( level ) ; fprintf ( stdout , " " , attr -> name ) ; show_attribute_value ( attr , level ) ; } else if ( ( show_options & SHOW_ATTRIBUTES ) || ( ( show_options & SHOW_ATTRIBUTE_VALUE ) && ( strcmp ( attr -> name , attribute_to_show ) == 0 ) ) ) { indent ( level ) ; fprintf ( stdout , " " , attr -> name ) ; if ( show_options & SHOW_ATTRIBUTE_VALUE && attr -> value != NULL && ( strcmp ( attr -> name , attribute_to_show ) ) == 0 ) { fprintf ( stdout , " " ) ; show_attribute_value ( attr , level ) ; } else fprintf ( stdout , " \n " ) ; } }
show_attribute: prints out a single attribute
 @attr: attribute to print.
show_attribute : prints out a single attribute @attr : attribute to print .