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_value(struct sysfs_attribute* attr, int level)
{
    if (!attr)
        return;

    if (attr->method & SYSFS_METHOD_SHOW)
    {
        if (isbinaryvalue(attr))
        {
            int i;
            for (i = 0; i < attr->len; i++)
            {
                if (!(i % 16) && (i != 0))
                {
                    fprintf(stdout, "\n");
                    indent(level + 22);
                }
                else if (!(i % 8) && (i != 0))
                    fprintf(stdout, " ");
                fprintf(stdout, " %02x", (unsigned char)attr->value[i]);
            }
            fprintf(stdout, "\n");
        }
        else if (attr->value && strlen(attr->value) > 0)
        {
            remove_end_newline(attr->value);
            fprintf(stdout, "\"%s\"\n", attr->value);
        }
        else
            fprintf(stdout, "\n");
    }
    else
    {
        fprintf(stdout, "<store method only>\n");
    }
}
/**
 * show_attribute_value: prints out single attribute value.
 * @attr: attricute to print.
 */
prints out single attribute value.
@attr: attricute to print.
prints out single attribute value . @attr : attricute to print .
static void show_attribute_value(struct sysfs_attribute* attr, int level)
{
    if (!attr)
        return;
    if (attr->method & SYSFS_METHOD_SHOW)
    {
        if (isbinaryvalue(attr))
        {
            int i;
            for (i = 0; i < attr->len; i++)
            {
                if (!(i % 16) && (i != 0))
                {
                    fprintf(stdout, "\n");
                    indent(level + 22);
                }
                else if (!(i % 8) && (i != 0))
                    fprintf(stdout, " ");
                fprintf(stdout, " %02x", (unsigned char)attr->value[i]);
            }
            fprintf(stdout, "\n");
        }
        else if (attr->value && strlen(attr->value) > 0)
        {
            remove_end_newline(attr->value);
            fprintf(stdout, "\"%s\"\n", attr->value);
        }
        else
            fprintf(stdout, "\n");
    }
    else
    {
        fprintf(stdout, "<store method only>\n");
    }
}
static void show_attribute_value ( struct sysfs_attribute * attr , int level ) { if ( ! attr ) return ; if ( attr -> method & SYSFS_METHOD_SHOW ) { if ( isbinaryvalue ( attr ) ) { int i ; for ( i = 0 ; i < attr -> len ; i ++ ) { if ( ! ( i % 16 ) && ( i != 0 ) ) { fprintf ( stdout , " \n " ) ; indent ( level + 22 ) ; } else if ( ! ( i % 8 ) && ( i != 0 ) ) fprintf ( stdout , " " ) ; fprintf ( stdout , " " , ( unsigned char ) attr -> value [ i ] ) ; } fprintf ( stdout , " \n " ) ; } else if ( attr -> value && strlen ( attr -> value ) > 0 ) { remove_end_newline ( attr -> value ) ; fprintf ( stdout , " \" \" \n " , attr -> value ) ; } else fprintf ( stdout , " \n " ) ; } else { fprintf ( stdout , " \n " ) ; } }
show_attribute_value: prints out single attribute value.
show_attribute_value : prints out single attribute value .