]> xenbits.xensource.com Git - libvirt.git/commitdiff
document virCommandRunRegex function
authorChristian Loehle <cloehle@linutronix.de>
Mon, 23 Nov 2015 14:06:37 +0000 (15:06 +0100)
committerJán Tomko <jtomko@redhat.com>
Tue, 24 Nov 2015 07:23:29 +0000 (08:23 +0100)
Signed-off-by: Ján Tomko <jtomko@redhat.com>
src/util/vircommand.c

index c7f153860887cc737ed17d427c9e4841a9c7f04d..1993bc658d60cfcc7c167f2226ec57a767cb1591 100644 (file)
@@ -2889,12 +2889,25 @@ virCommandSetDryRun(virBufferPtr buf,
 }
 
 #ifndef WIN32
-/*
+/**
+ * virCommandRunRegex:
+ * @cmd: command to run
+ * @nregex: number of regexes to apply
+ * @regex: array of regexes to apply
+ * @nvars: array of numbers of variables each regex will produce
+ * @func: callback function that is called for every line of output,
+ * needs to return 0 on success
+ * @data: additional data that will be passed to the callback function
+ * @prefix: prefix that will be skipped at the beginning of each line
+ *
  * Run an external program.
  *
  * Read its output and apply a series of regexes to each line
  * When the entire set of regexes has matched consecutively
- * then run a callback passing in all the matches
+ * then run a callback passing in all the matches on the current line.
+ *
+ * Returns: 0 on success, -1 on memory allocation error, virCommandRun
+ * error or callback function error
  */
 int
 virCommandRunRegex(virCommandPtr cmd,