return -1;
return 0;
}
-static int namesorter(const void *a, const void *b) {
- const char **sa = (const char**)a;
- const char **sb = (const char**)b;
+static int
+vshNameSorter(const void *a, const void *b)
+{
+ const char **sa = (const char**)a;
+ const char **sb = (const char**)b;
- /* User visible sort, so we want locale-specific case comparison. */
- return strcasecmp(*sa, *sb);
+ /* User visible sort, so we want locale-specific case comparison. */
+ return strcasecmp(*sa, *sb);
}
static double
goto cleanup;
}
- qsort(&names[0], maxname, sizeof(char*), namesorter);
+ qsort(&names[0], maxname, sizeof(char*), vshNameSorter);
}
}
return false;
}
- qsort(&activeNames[0], maxactive, sizeof(char *), namesorter);
+ qsort(&activeNames[0], maxactive, sizeof(char *), vshNameSorter);
}
}
if (inactive) {
return false;
}
- qsort(&inactiveNames[0], maxinactive, sizeof(char*), namesorter);
+ qsort(&inactiveNames[0], maxinactive, sizeof(char*), vshNameSorter);
}
}
vshPrintExtra(ctl, "%-20s %-10s %s\n", _("Name"), _("State"),
return false;
}
- qsort(&activeNames[0], maxactive, sizeof(char *), namesorter);
+ qsort(&activeNames[0], maxactive, sizeof(char *), vshNameSorter);
}
}
if (inactive) {
return false;
}
- qsort(&inactiveNames[0], maxinactive, sizeof(char*), namesorter);
+ qsort(&inactiveNames[0], maxinactive, sizeof(char*), vshNameSorter);
}
}
vshPrintExtra(ctl, "%-20s %-10s %s\n", _("Name"), _("State"),
return false;
}
- qsort(&names[0], numfilters, sizeof(char *), namesorter);
+ qsort(&names[0], numfilters, sizeof(char *), vshNameSorter);
vshPrintExtra(ctl, "%-36s %-20s \n", _("UUID"), _("Name"));
vshPrintExtra(ctl,
}
/* Sort the storage pool names */
- qsort(poolNames, numAllPools, sizeof(*poolNames), namesorter);
+ qsort(poolNames, numAllPools, sizeof(*poolNames), vshNameSorter);
/* Collect the storage pool information for display */
for (i = 0; i < numAllPools; i++) {
}
/* Sort the volume names */
- qsort(&activeNames[0], numVolumes, sizeof(*activeNames), namesorter);
+ qsort(&activeNames[0], numVolumes, sizeof(*activeNames), vshNameSorter);
/* Set aside memory for volume information pointers */
volInfoTexts = vshCalloc(ctl, numVolumes, sizeof(*volInfoTexts));
return false;
}
- qsort(uuids, maxuuids, sizeof(char *), namesorter);
+ qsort(uuids, maxuuids, sizeof(char *), vshNameSorter);
vshPrintExtra(ctl, "%-36s %s\n", _("UUID"), _("Usage"));
vshPrintExtra(ctl, "-----------------------------------------------------------\n");
VIR_FREE(devices);
return false;
}
- qsort(&devices[0], num_devices, sizeof(char*), namesorter);
+ qsort(&devices[0], num_devices, sizeof(char*), vshNameSorter);
if (tree) {
char **parents = vshMalloc(ctl, sizeof(char *) * num_devices);
struct vshNodeList arrays = { devices, parents };