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 int show_default_info(void)
{
    char subsys[SYSFS_NAME_LEN];
    struct dlist* list;
    char* cur;
    int retval = 0;

    safestrcpy(subsys, sysfs_mnt_path);
    safestrcat(subsys, "/");
    safestrcat(subsys, SYSFS_BUS_NAME);
    list = sysfs_open_directory_list(subsys);
    if (list)
    {
        fprintf(stdout, "Supported sysfs buses:\n");
        dlist_for_each_data(list, cur, char) fprintf(stdout, "\t%s\n", cur);
        sysfs_close_list(list);
    }

    safestrcpy(subsys, sysfs_mnt_path);
    safestrcat(subsys, "/");
    safestrcat(subsys, SYSFS_CLASS_NAME);
    list = sysfs_open_directory_list(subsys);
    if (list)
    {
        fprintf(stdout, "Supported sysfs classes:\n");
        dlist_for_each_data(list, cur, char) fprintf(stdout, "\t%s\n", cur);
        sysfs_close_list(list);
    }

    safestrcpy(subsys, sysfs_mnt_path);
    safestrcat(subsys, "/");
    safestrcat(subsys, SYSFS_DEVICES_NAME);
    list = sysfs_open_directory_list(subsys);
    if (list)
    {
        fprintf(stdout, "Supported sysfs devices:\n");
        dlist_for_each_data(list, cur, char) fprintf(stdout, "\t%s\n", cur);
        sysfs_close_list(list);
    }

    safestrcpy(subsys, sysfs_mnt_path);
    safestrcat(subsys, "/");
    safestrcat(subsys, SYSFS_MODULE_NAME);
    list = sysfs_open_directory_list(subsys);
    if (list)
    {
        fprintf(stdout, "Supported sysfs modules:\n");
        dlist_for_each_data(list, cur, char) fprintf(stdout, "\t%s\n", cur);
        sysfs_close_list(list);
    }

    return retval;
}
/**
 * show_default_info: prints current buses, classes, and root devices
 *	supported by sysfs.
 * returns 0 with success or 1 with error.
 */
prints current buses, classes, and root devices
supported by sysfs.
returns 0 with success or 1 with error.
prints current buses classes and root devices supported by sysfs . returns 0 with success or 1 with error .
static int show_default_info(void)
{
    char subsys[SYSFS_NAME_LEN];
    struct dlist* list;
    char* cur;
    int retval = 0;
    safestrcpy(subsys, sysfs_mnt_path);
    safestrcat(subsys, "/");
    safestrcat(subsys, SYSFS_BUS_NAME);
    list = sysfs_open_directory_list(subsys);
    if (list)
    {
        fprintf(stdout, "Supported sysfs buses:\n");
        dlist_for_each_data(list, cur, char) fprintf(stdout, "\t%s\n", cur);
        sysfs_close_list(list);
    }
    safestrcpy(subsys, sysfs_mnt_path);
    safestrcat(subsys, "/");
    safestrcat(subsys, SYSFS_CLASS_NAME);
    list = sysfs_open_directory_list(subsys);
    if (list)
    {
        fprintf(stdout, "Supported sysfs classes:\n");
        dlist_for_each_data(list, cur, char) fprintf(stdout, "\t%s\n", cur);
        sysfs_close_list(list);
    }
    safestrcpy(subsys, sysfs_mnt_path);
    safestrcat(subsys, "/");
    safestrcat(subsys, SYSFS_DEVICES_NAME);
    list = sysfs_open_directory_list(subsys);
    if (list)
    {
        fprintf(stdout, "Supported sysfs devices:\n");
        dlist_for_each_data(list, cur, char) fprintf(stdout, "\t%s\n", cur);
        sysfs_close_list(list);
    }
    safestrcpy(subsys, sysfs_mnt_path);
    safestrcat(subsys, "/");
    safestrcat(subsys, SYSFS_MODULE_NAME);
    list = sysfs_open_directory_list(subsys);
    if (list)
    {
        fprintf(stdout, "Supported sysfs modules:\n");
        dlist_for_each_data(list, cur, char) fprintf(stdout, "\t%s\n", cur);
        sysfs_close_list(list);
    }
    return retval;
}
static int show_default_info ( void ) { char subsys [ SYSFS_NAME_LEN ] ; struct dlist * list ; char * cur ; int retval = 0 ; safestrcpy ( subsys , sysfs_mnt_path ) ; safestrcat ( subsys , " " ) ; safestrcat ( subsys , SYSFS_BUS_NAME ) ; list = sysfs_open_directory_list ( subsys ) ; if ( list ) { fprintf ( stdout , " \n " ) ; dlist_for_each_data ( list , cur , char ) fprintf ( stdout , " \t \n " , cur ) ; sysfs_close_list ( list ) ; } safestrcpy ( subsys , sysfs_mnt_path ) ; safestrcat ( subsys , " " ) ; safestrcat ( subsys , SYSFS_CLASS_NAME ) ; list = sysfs_open_directory_list ( subsys ) ; if ( list ) { fprintf ( stdout , " \n " ) ; dlist_for_each_data ( list , cur , char ) fprintf ( stdout , " \t \n " , cur ) ; sysfs_close_list ( list ) ; } safestrcpy ( subsys , sysfs_mnt_path ) ; safestrcat ( subsys , " " ) ; safestrcat ( subsys , SYSFS_DEVICES_NAME ) ; list = sysfs_open_directory_list ( subsys ) ; if ( list ) { fprintf ( stdout , " \n " ) ; dlist_for_each_data ( list , cur , char ) fprintf ( stdout , " \t \n " , cur ) ; sysfs_close_list ( list ) ; } safestrcpy ( subsys , sysfs_mnt_path ) ; safestrcat ( subsys , " " ) ; safestrcat ( subsys , SYSFS_MODULE_NAME ) ; list = sysfs_open_directory_list ( subsys ) ; if ( list ) { fprintf ( stdout , " \n " ) ; dlist_for_each_data ( list , cur , char ) fprintf ( stdout , " \t \n " , cur ) ; sysfs_close_list ( list ) ; } return retval ; }
show_default_info: prints current buses, classes, and root devices
      supported by sysfs.
show_default_info : prints current buses classes and root devices supported by sysfs .