aboutsummaryrefslogtreecommitdiff
path: root/dpi/dpiutil.h
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2010-08-20 23:24:19 +0200
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2010-08-20 23:24:19 +0200
commitf5c598b518d1f906148534d015f50075d3e8242d (patch)
tree21dd70add5b366c3dd80641b77f6b18e0baa009e /dpi/dpiutil.h
parente98d02a01ffeb18ede86af025e51ae1ec011c75a (diff)
parent5f0fc0e48b8cbee7e1795935da0abff6627fd498 (diff)
merge
Diffstat (limited to 'dpi/dpiutil.h')
-rw-r--r--dpi/dpiutil.h45
1 files changed, 7 insertions, 38 deletions
diff --git a/dpi/dpiutil.h b/dpi/dpiutil.h
index fa3dfb86..d939ddcb 100644
--- a/dpi/dpiutil.h
+++ b/dpi/dpiutil.h
@@ -5,7 +5,7 @@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
*/
@@ -28,43 +28,6 @@ extern "C" {
#endif /* __cplusplus */
-#define BUFLEN 256
-#define TOUT 300
-
-
-/* Streamed Sockets API (not mandatory) ----------------------------------*/
-
-typedef struct _SockHandler SockHandler;
-struct _SockHandler {
- int fd_in;
- int fd_out;
- /* FILE *in; --Unused. The stream functions block when reading. */
- FILE *out;
-
- char *buf; /* internal buffer */
- uint_t buf_sz; /* data size */
- uint_t buf_max; /* allocated size */
- uint_t flush_sz; /* max size before flush */
-};
-
-SockHandler *sock_handler_new(int fd_in, int fd_out, int flush_sz);
-int sock_handler_write(SockHandler *sh, int flush,
- const char *Data,size_t DataSize);
-int sock_handler_write_str(SockHandler *sh, int flush, const char *str);
-char *sock_handler_read(SockHandler *sh);
-void sock_handler_close(SockHandler *sh);
-void sock_handler_free(SockHandler *sh);
-
-#define sock_handler_printf(sh, flush, ...) \
- D_STMT_START { \
- Dstr *dstr = dStr_sized_new(128); \
- dStr_sprintf(dstr, __VA_ARGS__); \
- sock_handler_write(sh, flush, dstr->str, dstr->len); \
- dStr_free(dstr, 1); \
- } D_STMT_END
-
-/* ----------------------------------------------------------------------- */
-
/*
* Escape URI characters in 'esc_set' as %XX sequences.
* Return value: New escaped string.
@@ -72,6 +35,12 @@ void sock_handler_free(SockHandler *sh);
char *Escape_uri_str(const char *str, const char *p_esc_set);
/*
+ * Unescape %XX sequences in a string.
+ * Return value: a new unescaped string
+ */
+char *Unescape_uri_str(const char *str);
+
+/*
* Escape unsafe characters as html entities.
* Return value: New escaped string.
*/