-char **get_libs(const void *ctx, const char *dir,
- unsigned int *num, char **infofile)
+/* Can return NULL: _info may not support 'libs'. */
+static char **get_one_libs(const void *ctx, const char *dir,
+ char *(*get_info)(const void *ctx, const char *dir))
+{
+ char *cmd, **lines;
+
+ cmd = talloc_asprintf(ctx, "%s libs", get_info(ctx, dir));
+ lines = lines_from_cmd(cmd, "%s", cmd);
+ /* Strip final NULL. */
+ if (lines)
+ lines = talloc_realloc(NULL, lines, char *,
+ talloc_array_length(lines)-1);
+ return lines;
+}
+
+char **get_libs(const void *ctx, const char *dir, bool recurse,
+ char *(*get_info)(const void *ctx, const char *dir))