summaryrefslogtreecommitdiff
path: root/processor
diff options
context:
space:
mode:
authorXuefer <xuefer@gmail.com>2014-11-09 06:51:00 +0000
committerXuefer <xuefer@gmail.com>2014-11-09 06:51:00 +0000
commit96285eb7d0e573947add70a3af82838468c1cc8a (patch)
treec95220c2240f3c9dcec2540ea9c5c1b0e9d68dbf /processor
parent977ff39373429681d4bf43a1d7b61b64cd30993a (diff)
downloadxcache-96285eb7d0e573947add70a3af82838468c1cc8a.tar.gz
xcache-96285eb7d0e573947add70a3af82838468c1cc8a.zip
separate plain c code to .h files, update dependencies
git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1556 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
Diffstat (limited to 'processor')
-rw-r--r--processor/string-helper.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/processor/string-helper.h b/processor/string-helper.h
new file mode 100644
index 0000000..101642d
--- /dev/null
+++ b/processor/string-helper.h
@@ -0,0 +1,23 @@
+#define MAX_DUP_STR_LEN 256
+
+static inline size_t xc_zstrlen_char(const_zstr s) /* {{{ */
+{
+ return strlen(ZSTR_S(s));
+}
+/* }}} */
+#ifdef IS_UNICODE
+static inline size_t xc_zstrlen_uchar(zstr s) /* {{{ */
+{
+ return u_strlen(ZSTR_U(s));
+}
+/* }}} */
+static inline size_t xc_zstrlen(int type, const_zstr s) /* {{{ */
+{
+ return type == IS_UNICODE ? xc_zstrlen_uchar(s) : xc_zstrlen_char(s);
+}
+/* }}} */
+#else
+/* {{{ xc_zstrlen */
+#define xc_zstrlen(dummy, s) xc_zstrlen_char(s)
+/* }}} */
+#endif