diff options
Diffstat (limited to 'include/asterisk/strings.h')
-rw-r--r-- | include/asterisk/strings.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/include/asterisk/strings.h b/include/asterisk/strings.h index 7af92affc..d361293d0 100644 --- a/include/asterisk/strings.h +++ b/include/asterisk/strings.h @@ -310,6 +310,59 @@ char *ast_unescape_semicolon(char *s); char *ast_unescape_c(char *s); /*! + * \brief Escape the 'to_escape' characters in the given string. + * + * \note The given output buffer has to have enough memory allocated to store the + * original string plus any escaped values. + * + * \param dest the escaped string + * \param s the source string to escape + * \param num number of characters to be copied from the source + * \param to_escape an array of characters to escape + * + * \return Pointer to the destination. + */ +char* ast_escape(char *dest, const char *s, size_t num, const char *to_escape); + +/*! + * \brief Escape standard 'C' sequences in the given string. + * + * \note The given output buffer has to have enough memory allocated to store the + * original string plus any escaped values. + * + * \param dest the escaped string + * \param s the source string to escape + * \param num number of characters to be copied from the source + * \param to_escape an array of characters to escape + * + * \return Pointer to the escaped string. + */ +char* ast_escape_c(char *dest, const char *s, size_t num); + +/*! + * \brief Escape the 'to_escape' characters in the given string. + * + * \note Caller is responsible for freeing the returned string + * + * \param s the source string to escape + * \param to_escape an array of characters to escape + * + * \return Pointer to the escaped string or NULL. + */ +char *ast_escape_alloc(const char *s, const char *to_escape); + +/*! + * \brief Escape standard 'C' sequences in the given string. + * + * \note Caller is responsible for freeing the returned string + * + * \param s the source string to escape + * + * \return Pointer to the escaped string or NULL. + */ +char *ast_escape_c_alloc(const char *s); + +/*! \brief Size-limited null-terminating string copy. \param dst The destination buffer. \param src The source string |