summaryrefslogtreecommitdiff
path: root/lib/command.h
diff options
context:
space:
mode:
authorajs <ajs>2005-01-28 20:28:35 +0000
committerajs <ajs>2005-01-28 20:28:35 +0000
commitf6834d4c4031276361465dd19ef1918e239566c8 (patch)
tree67e9eb194ce4cef74654a888c0e165febc0010d2 /lib/command.h
parent8bfb0cba005b37c7b125fe2a34f1819e85d9f59c (diff)
2005-01-28 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* lib/command.h: Document behavior of argv_concat function. * lib/command.c: (argv_concat) Calculate total string length first so we can call malloc just once (instead of realloc'ing to add each string element). (do_echo,config_logmsg) Allow for possible NULL return value from argv_concat.
Diffstat (limited to 'lib/command.h')
-rw-r--r--lib/command.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/command.h b/lib/command.h
index 8fdec98f..eba919cb 100644
--- a/lib/command.h
+++ b/lib/command.h
@@ -322,7 +322,11 @@ void install_default (enum node_type);
void install_element (enum node_type, struct cmd_element *);
void sort_node ();
-char *argv_concat (const char **, int, int);
+/* Concatenates argv[shift] through argv[argc-1] into a single NUL-terminated
+ string with a space between each element (allocated using
+ XMALLOC(MTYPE_TMP)). Returns NULL if shift >= argc. */
+char *argv_concat (const char **argv, int argc, int shift);
+
vector cmd_make_strvec (const char *);
void cmd_free_strvec (vector);
vector cmd_describe_command ();