void bdrv_iterate_format(void (*it)(void *opaque, const char *name),

                         void *opaque)

{

    BlockDriver *drv;

    int count = 0;

    const char **formats = NULL;



    QLIST_FOREACH(drv, &bdrv_drivers, list) {

        if (drv->format_name) {

            bool found = false;

            int i = count;

            while (formats && i && !found) {

                found = !strcmp(formats[--i], drv->format_name);

            }



            if (!found) {

                formats = g_realloc(formats, (count + 1) * sizeof(char *));

                formats[count++] = drv->format_name;

                it(opaque, drv->format_name);

            }

        }

    }

    g_free(formats);

}

void bdrv_iterate_format(void (*it)(void *opaque, const char *name),

                         void *opaque)

{

    BlockDriver *drv;

    int count = 0;

    const char **formats = NULL;



    QLIST_FOREACH(drv, &bdrv_drivers, list) {

        if (drv->format_name) {

            bool found = false;

            int i = count;

            while (formats && i && !found) {

                found = !strcmp(formats[--i], drv->format_name);

            }



            if (!found) {

                formats = g_realloc(formats, (count + 1) * sizeof(char *));

                formats[count++] = drv->format_name;

                it(opaque, drv->format_name);

            }

        }

    }

    g_free(formats);

}

                formats = g_realloc(formats, (count + 1) * sizeof(char *));
void FUNC_0(void (*VAR_0)(void *VAR_3, const char *VAR_2),

                         void *VAR_3)

{

    BlockDriver *drv;

    int VAR_3 = 0;

    const char **VAR_4 = NULL;



    QLIST_FOREACH(drv, &bdrv_drivers, list) {

        if (drv->format_name) {

            bool found = false;

            int i = VAR_3;

            while (VAR_4 && i && !found) {

                found = !strcmp(VAR_4[--i], drv->format_name);

            }



            if (!found) {

                VAR_4 = g_realloc(VAR_4, (VAR_3 + 1) * sizeof(char *));

                VAR_4[VAR_3++] = drv->format_name;

                VAR_0(VAR_3, drv->format_name);

            }

        }

    }

    g_free(VAR_4);

}

void FUNC_0(void (*VAR_0)(void *VAR_3, const char *VAR_2),
void *VAR_3)
{ BlockDriver *drv; int VAR_3 = 0; const char **VAR_4 = NULL; QLIST_FOREACH(drv, &bdrv_drivers, list) { if (drv->format_name) { bool found = false; int i = VAR_3; while (VAR_4 && i && !found) { found = !strcmp(VAR_4[--i], drv->format_name); } if (!found) { VAR_4 = g_realloc(VAR_4, (VAR_3 + 1) * sizeof(char *)); VAR_4[VAR_3++] = drv->format_name; VAR_0(VAR_3, drv->format_name); } } } g_free(VAR_4); }