cvs: /php3/functions imap.c imap.h

From: Date: Tue, 14 Dec 1999 04:19:24 +0000
Subject: cvs: /php3/functions imap.c imap.h
Groups: php.dev 
Request: Send a blank email to php-dev+get-13671@lists.php.net to get a copy of this message
musone Mon Dec 13 23:19:24 1999 EDT Modified files: /php3/functions imap.c imap.h Log: added utf8 decoding for QP encoded headers Index: php3/functions/imap.c diff -u php3/functions/imap.c:1.72 php3/functions/imap.c:1.73 --- php3/functions/imap.c:1.72 Wed Nov 3 11:02:03 1999 +++ php3/functions/imap.c Mon Dec 13 23:19:24 1999 @@ -33,7 +33,7 @@ | Andrew Skalski <askalski@chek.com> | +----------------------------------------------------------------------+ */ -/* $Id: imap.c,v 1.72 1999/11/03 16:02:03 askalski Exp $ */ +/* $Id: imap.c,v 1.73 1999/12/14 04:19:24 musone Exp $ */ #define IMAP41 @@ -195,6 +195,7 @@ {"imap_errors", php3_imap_errors, NULL}, {"imap_last_error", php3_imap_last_error, NULL}, {"imap_search", php3_imap_search, NULL}, + {"imap_utf8", php3_imap_utf8, NULL}, {NULL, NULL, NULL} }; @@ -2484,6 +2485,31 @@ if(addresstmp->adl) add_property_string(&tovals,"adl",addresstmp->adl,1); add_next_index_object(return_value, tovals); } while ((addresstmp = addresstmp->next)); +} +/* }}} */ + + + +/* {{{ proto string imap_utf8(string string) + convert a string to UTF8 */ +void php3_imap_utf8(INTERNAL_FUNCTION_PARAMETERS) +{ + pval *string; + int argc; + SIZEDTEXT src,dest; + src.data=NULL; + src.size=0; + dest.data=NULL; + dest.size=0; + + argc=ARG_COUNT(ht); + if ( argc != 1 || getParameters( ht, argc, &string) == FAILURE ) { + WRONG_PARAM_COUNT; + } + convert_to_string(string); + cpytxt(&src,string->value.str.val,string->value.str.len); + utf8_mime2text(&src,&dest); + RETURN_STRINGL(dest.data,strlen(dest.data),1); } /* }}} */ Index: php3/functions/imap.h diff -u php3/functions/imap.h:1.12 php3/functions/imap.h:1.13 --- php3/functions/imap.h:1.12 Sat Jul 24 15:06:16 1999 +++ php3/functions/imap.h Mon Dec 13 23:19:24 1999 @@ -1,4 +1,4 @@ -/* $Id: imap.h,v 1.12 1999/07/24 19:06:16 rasmus Exp $ */ +/* $Id: imap.h,v 1.13 1999/12/14 04:19:24 musone Exp $ */ #ifndef _INCLUDED_IMAP_H #define _INCLUDED_IMAP_H @@ -77,7 +77,7 @@ void php3_imap_errors(INTERNAL_FUNCTION_PARAMETERS); void php3_imap_last_error(INTERNAL_FUNCTION_PARAMETERS); void php3_imap_search(INTERNAL_FUNCTION_PARAMETERS); - +void php3_imap_utf8(INTERNAL_FUNCTION_PARAMETERS); #else #define php3_imap_module_ptr NULL #endif /* HAVE_IMAP */

« previous php.dev (#13671) next »