s3: lib: util: Add file_lines_ploadv().
authorJeremy Allison <jra@samba.org>
Fri, 17 May 2019 05:10:51 +0000 (22:10 -0700)
committerJeremy Allison <jra@samba.org>
Fri, 24 May 2019 19:00:05 +0000 (19:00 +0000)
Not yet used.

Duplicate code to file_lines_pload() except uses vectored
argument list. file_lines_pload() will be removed once all
callers are converted.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13964

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/lib/util_file.c
source3/lib/util_file.h

index cfbcf278caaef47c69a1f413201a7f13e60f0245..eeb749be36cf9b67bc85c98a1af63dd75e5b0db1 100644 (file)
@@ -170,3 +170,18 @@ char **file_lines_pload(TALLOC_CTX *mem_ctx, const char *syscmd,
 
        return file_lines_parse(p, size, numlines, mem_ctx);
 }
+
+char **file_lines_ploadv(TALLOC_CTX *mem_ctx,
+                       char * const argl[],
+                       int *numlines)
+{
+       char *p = NULL;
+       size_t size;
+
+       p = file_ploadv(argl, &size);
+       if (!p) {
+               return NULL;
+       }
+
+       return file_lines_parse(p, size, numlines, mem_ctx);
+}
index 9175ed0dcee093ae5b1249879f92a07978a7360a..85bcf06f38c00054bf2432ef0bfed83a9f686185 100644 (file)
@@ -31,5 +31,8 @@ int file_pload_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
 
 char **file_lines_pload(TALLOC_CTX *mem_ctx, const char *syscmd,
                        int *numlines);
+char **file_lines_ploadv(TALLOC_CTX *mem_ctx,
+                       char * const argl[],
+                       int *numlines);
 
 #endif