summaryrefslogtreecommitdiff
path: root/pjlib/include/pj/string.h
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2005-11-20 19:55:42 +0000
committerBenny Prijono <bennylp@teluu.com>2005-11-20 19:55:42 +0000
commita605c06e12510600a67aaa86ea349037f613e53d (patch)
treecb001ad89f212ffaf6985eadc673230ccd25d7b9 /pjlib/include/pj/string.h
parent66864977389a1a59bf7a5d38fcd62559190bb93e (diff)
Added hex character conversion utility in ctype
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@62 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/include/pj/string.h')
-rw-r--r--pjlib/include/pj/string.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/pjlib/include/pj/string.h b/pjlib/include/pj/string.h
index e1d553a9..44688cbe 100644
--- a/pjlib/include/pj/string.h
+++ b/pjlib/include/pj/string.h
@@ -174,6 +174,32 @@ PJ_IDECL(pj_str_t*) pj_strcpy(pj_str_t *dst, const pj_str_t *src);
PJ_IDECL(pj_str_t*) pj_strcpy2(pj_str_t *dst, const char *src);
/**
+ * Copy source string to destination up to the specified max length.
+ *
+ * @param dst The target string.
+ * @param src The source string.
+ * @param max Maximum characters to copy.
+ *
+ * @return the target string.
+ */
+PJ_IDECL(pj_str_t*) pj_strncpy(pj_str_t *dst, const pj_str_t *src,
+ pj_ssize_t max);
+
+/**
+ * Copy source string to destination up to the specified max length,
+ * and NULL terminate the destination. If source string length is
+ * greater than or equal to max, then max-1 will be copied.
+ *
+ * @param dst The target string.
+ * @param src The source string.
+ * @param max Maximum characters to copy.
+ *
+ * @return the target string.
+ */
+PJ_IDECL(pj_str_t*) pj_strncpy_with_null(pj_str_t *dst, const pj_str_t *src,
+ pj_ssize_t max);
+
+/**
* Duplicate string.
*
* @param pool The pool.
@@ -520,6 +546,7 @@ PJ_INLINE(void*) pj_memchr(const void *buf, int c, pj_size_t size)
return memchr(buf, c, size);
}
+
/**
* @}
*/