str.h revision 513928e1d3eb3943c535732d693eadc387a4c2c3
ecc81625167ed96c04c02aa190a1ea5baa65b474Timo Sirainenstring_t *str_new(pool_t pool, size_t initial_size);
ecc81625167ed96c04c02aa190a1ea5baa65b474Timo Sirainen/* Allocate a constant string using the given str as the input data.
c0435c854a0e7246373b9752d163095cc4fbe985Timo Sirainen str pointer is saved directly, so it must not be freed until the returned
ecc81625167ed96c04c02aa190a1ea5baa65b474Timo Sirainen string is no longer used. len must contain strlen(str). */
daf029d2a627daa39d05507140f385162828172eTimo Sirainenstring_t *str_new_const(pool_t pool, const char *str, size_t len);
ecc81625167ed96c04c02aa190a1ea5baa65b474Timo Sirainenstring_t *t_str_new_const(const char *str, size_t len);
ecc81625167ed96c04c02aa190a1ea5baa65b474Timo Sirainenconst unsigned char *str_data(const string_t *str) ATTR_PURE;
ecc81625167ed96c04c02aa190a1ea5baa65b474Timo Sirainenbool str_equals(const string_t *str1, const string_t *str2) ATTR_PURE;
ecc81625167ed96c04c02aa190a1ea5baa65b474Timo Sirainenvoid str_append(string_t *str, const char *cstr);
ecc81625167ed96c04c02aa190a1ea5baa65b474Timo Sirainenvoid str_append_n(string_t *str, const void *cstr, size_t max_len);
2767104d81e97a109f0aa9758792bfa1da325a97Timo Sirainenvoid str_append_data(string_t *str, const void *data, size_t len);
211ed7806d8715ec2280ffbf5d10f0d6e4f1beb2Timo Sirainenvoid str_append_c(string_t *str, unsigned char chr);
211ed7806d8715ec2280ffbf5d10f0d6e4f1beb2Timo Sirainenvoid str_append_str(string_t *dest, const string_t *src);
2767104d81e97a109f0aa9758792bfa1da325a97Timo Sirainen/* Append printf()-like data */
2767104d81e97a109f0aa9758792bfa1da325a97Timo Sirainenvoid str_printfa(string_t *str, const char *fmt, ...)
2767104d81e97a109f0aa9758792bfa1da325a97Timo Sirainenvoid str_vprintfa(string_t *str, const char *fmt, va_list args)
c0435c854a0e7246373b9752d163095cc4fbe985Timo Sirainenvoid str_insert(string_t *str, size_t pos, const char *cstr);