diff options
Diffstat (limited to 'sqwebmail/filter.h')
| -rw-r--r-- | sqwebmail/filter.h | 67 | 
1 files changed, 67 insertions, 0 deletions
| diff --git a/sqwebmail/filter.h b/sqwebmail/filter.h new file mode 100644 index 0000000..f68fa0b --- /dev/null +++ b/sqwebmail/filter.h @@ -0,0 +1,67 @@ +/* +*/ +#ifndef	filter_h +#define	filter_h + +/* +** Copyright 1998 - 2011 Double Precision, Inc.  See COPYING for +** distribution information. +*/ + + +/* +	The filter set of function is used to format message text for +	display. The message text gets converted from unicode to the +	display character set, and excessively long lines get truncated to +	some reasonable value. + +	Special characters: <, >, &, and " get replaced by their HTML +	entities. + + +	filter(ptr, cnt) - repeated calls to this function are used to +	supply text being filtered. + +	filter_end() - is called when the end of the text being filtered +	is reached. + +*/ + +#if	HAVE_CONFIG_H +#undef	PACKAGE +#undef	VERSION +#include	"config.h" +#endif + +#if	HAVE_UNISTD_H +#include	<unistd.h> +#endif + +#include	<stdlib.h> + +#include	"unicode/unicode.h" + +struct filter_info { +	libmail_u_convert_handle_t handle; + +	int conversion_error; + +	unicode_char prevchar; + +	size_t u_w; + +	void (*handler_func)(const char *, size_t, void *); +	void *func_arg; + +	size_t linesize; +}; + +void	filter_start(struct filter_info *, const char *, +		     void (*)(const char *, size_t, void *), void *); +void	filter(struct filter_info *, +	       const unicode_char *, size_t); +void	filter_passthru(struct filter_info *info, +			const unicode_char *ptr, size_t cnt); +void	filter_end(struct filter_info *info); + +#endif | 
