summaryrefslogtreecommitdiff
path: root/include/asterisk/term.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asterisk/term.h')
-rw-r--r--include/asterisk/term.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/asterisk/term.h b/include/asterisk/term.h
index 3277f0042..8c6cab43e 100644
--- a/include/asterisk/term.h
+++ b/include/asterisk/term.h
@@ -64,6 +64,28 @@ extern "C" {
char *term_color(char *outbuf, const char *inbuf, int fgcolor, int bgcolor, int maxout);
+/*!
+ * \brief Append a color sequence to an ast_str
+ *
+ * \param str The string to append to
+ * \param fgcolor foreground color
+ * \param bgcolor background color
+ *
+ * \retval 0 success
+ * \retval -1 failure
+ */
+int ast_term_color_code(struct ast_str **str, int fgcolor, int bgcolor);
+
+/*!
+ * \brief Write a color sequence to a string
+ *
+ * \param outbuf the location to write to
+ * \param fgcolor foreground color
+ * \param bgcolor background color
+ * \param maxout maximum number of characters to write
+ *
+ * \return outbuf
+ */
char *term_color_code(char *outbuf, int fgcolor, int bgcolor, int maxout);
char *term_strip(char *outbuf, char *inbuf, int maxout);