diff options
| author | Sam Varshavchik | 2013-08-19 16:39:41 -0400 | 
|---|---|---|
| committer | Sam Varshavchik | 2013-08-25 14:43:51 -0400 | 
| commit | 9c45d9ad13fdf439d44d7443ae75da15ea0223ed (patch) | |
| tree | 7a81a04cb51efb078ee350859a64be2ebc6b8813 /sqwebmail/filter.h | |
| parent | a9520698b770168d1f33d6301463bb70a19655ec (diff) | |
| download | courier-libs-9c45d9ad13fdf439d44d7443ae75da15ea0223ed.tar.bz2 | |
Initial checkin
Imported from subversion report, converted to git. Updated all paths in
scripts and makefiles, reflecting the new directory hierarchy.
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 | 
