CVS update: php3/functions
| From: | musone | Date: | Fri, 21 Aug 1998 16:27:52 +0000 |
| Subject: | CVS update: php3/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-420@lists.php.net to get a copy of this message | ||
Date: Friday August 21, 1998 @ 12:27
Author: musone
Update of /repository/php3/functions
In directory asf:/tmp/cvs-serv27854
Modified Files:
imap.c
Log Message:
made imap_append return valid values
imap_fetchstructure now takes in optional flags
imap_binary hopefully works
Index: php3/functions/imap.c
diff -c php3/functions/imap.c:1.20 php3/functions/imap.c:1.21
*** php3/functions/imap.c:1.20 Fri Aug 21 01:25:57 1998
--- php3/functions/imap.c Fri Aug 21 12:27:52 1998
***************
*** 31,37 ****
| Rasmus Lerdorf <rasmus@lerdorf.on.ca> |
+----------------------------------------------------------------------+
*/
! /* $Id: imap.c,v 1.20 1998/08/21 05:25:57 musone Exp $ */
#define IMAP41
--- 31,37 ----
| Rasmus Lerdorf <rasmus@lerdorf.on.ca> |
+----------------------------------------------------------------------+
*/
! /* $Id: imap.c,v 1.21 1998/08/21 16:27:52 musone Exp $ */
#define IMAP41
***************
*** 455,485 ****
void php3_imap_append(INTERNAL_FUNCTION_PARAMETERS)
{
! pval *streamind,*folder, *message,*flags;
! int ind, ind_type;
! pils *imap_le_struct;
! STRING st;
! int myargc=ARG_COUNT(ht);
!
! if ( myargc < 3 || myargc > 4 || getParameters( ht, myargc, &streamind, &folder,
&message,&flags) == FAILURE) {
! WRONG_PARAM_COUNT;
! }
!
! convert_to_long(streamind);
! convert_to_string(folder);
! convert_to_string(message);
! if (myargc == 4) convert_to_long(flags);
! ind = streamind->value.lval;
!
imap_le_struct = (pils *)php3_list_find( ind, &ind_type );
!
if ( !imap_le_struct || ind_type != le_imap ) {
! php3_error(E_WARNING, "Unable to find stream pointer");
! RETURN_FALSE;
}
INIT (&st,mail_string,(void *) message->value.str.val,message->value.str.len);
! mail_append_full(imap_le_struct->imap_stream,
folder->value.str.val,myargc==4?flags->value.str.val:NIL,NIL,&st);
! RETURN_TRUE;
}
void php3_imap_num_msg(INTERNAL_FUNCTION_PARAMETERS)
--- 455,491 ----
void php3_imap_append(INTERNAL_FUNCTION_PARAMETERS)
{
! pval *streamind,*folder, *message,*flags;
! int ind, ind_type;
! pils *imap_le_struct;
! STRING st;
! int myargc=ARG_COUNT(ht);
!
! if ( myargc < 3 || myargc > 4 || getParameters( ht, myargc, &streamind, &folder,
&message,&flags) == FAILURE) {
! WRONG_PARAM_COUNT;
! }
!
! convert_to_long(streamind);
! convert_to_string(folder);
! convert_to_string(message);
! if (myargc == 4) convert_to_long(flags);
! ind = streamind->value.lval;
!
imap_le_struct = (pils *)php3_list_find( ind, &ind_type );
!
if ( !imap_le_struct || ind_type != le_imap ) {
! php3_error(E_WARNING, "Unable to find stream pointer");
! RETURN_FALSE;
}
INIT (&st,mail_string,(void *) message->value.str.val,message->value.str.len);
! if(mail_append_full(imap_le_struct->imap_stream,
folder->value.str.val,myargc==4?flags->value.str.val:NIL,NIL,&st))
! {
! RETURN_TRUE;
! }
! else
! {
! RETURN_FALSE;
! }
}
void php3_imap_num_msg(INTERNAL_FUNCTION_PARAMETERS)
***************
*** 1295,1308 ****
pval *streamind, *folder;
int ind, ind_type;
pils *imap_le_struct;
!
! if (ARG_COUNT(ht)!=2 || getParameters(ht,2,&streamind,&folder) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_long(streamind);
convert_to_string(folder);
-
ind = streamind->value.lval;
imap_le_struct = (pils *)php3_list_find(ind, &ind_type);
--- 1301,1313 ----
pval *streamind, *folder;
int ind, ind_type;
pils *imap_le_struct;
! int myargc=ARG_COUNT(ht);
! if (myargc !=2 || getParameters(ht,myargc,&streamind,&folder) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_long(streamind);
convert_to_string(folder);
ind = streamind->value.lval;
imap_le_struct = (pils *)php3_list_find(ind, &ind_type);
***************
*** 1415,1431 ****
void php3_imap_fetchstructure(INTERNAL_FUNCTION_PARAMETERS)
{
! pval *streamind, *msgno;
int ind, ind_type;
pils *imap_le_struct;
BODY *body;
!
! if ( ARG_COUNT(ht) != 2 || getParameters( ht, 2, &streamind, &msgno ) == FAILURE ) {
WRONG_PARAM_COUNT;
}
convert_to_long( streamind );
convert_to_long( msgno );
object_init(return_value);
ind = streamind->value.lval;
--- 1420,1437 ----
void php3_imap_fetchstructure(INTERNAL_FUNCTION_PARAMETERS)
{
! pval *streamind, *msgno,*flags;
int ind, ind_type;
pils *imap_le_struct;
BODY *body;
! int myargc=ARG_COUNT(ht);
! if ( myargc < 2 || myargc > 3 || getParameters( ht, myargc, &streamind, &msgno
,&flags) == FAILURE ) {
WRONG_PARAM_COUNT;
}
convert_to_long( streamind );
convert_to_long( msgno );
+ if(myargc == 3) convert_to_long(flags);
object_init(return_value);
ind = streamind->value.lval;
***************
*** 1437,1443 ****
RETURN_FALSE;
}
! mail_fetchstructure( imap_le_struct->imap_stream, msgno->value.lval, &body );
if ( !body ) {
php3_error( E_WARNING, "No body information available" );
--- 1443,1449 ----
RETURN_FALSE;
}
! mail_fetchstructure_full( imap_le_struct->imap_stream, msgno->value.lval, &body ,myargc
== 3 ? flags->value.lval : NIL);
if ( !body ) {
php3_error( E_WARNING, "No body information available" );
***************
*** 1478,1484 ****
php3_error( E_WARNING, "No body information available" );
RETURN_FALSE;
}
! RETVAL_STRING( body ,1);
}
void php3_imap_base64(INTERNAL_FUNCTION_PARAMETERS)
--- 1484,1490 ----
php3_error( E_WARNING, "No body information available" );
RETURN_FALSE;
}
! RETVAL_STRINGL( body ,len,1);
}
void php3_imap_base64(INTERNAL_FUNCTION_PARAMETERS)
***************
*** 1532,1548 ****
void php3_imap_binary(INTERNAL_FUNCTION_PARAMETERS)
{
pval *text,*length;
! #if 0
! char *decode;
! FILE *fp;
! int x;
! char *dest;
! unsigned long newlength;
! #endif
!
! if ( ARG_COUNT(ht) != 2 || getParameters( ht, 2, &text,&length) == FAILURE ) {
WRONG_PARAM_COUNT;
}
}
--- 1538,1550 ----
void php3_imap_binary(INTERNAL_FUNCTION_PARAMETERS)
{
pval *text,*length;
! unsigned long len;
! if ( ARG_COUNT(ht) != 1 || getParameters( ht, 1, &text) == FAILURE ) {
WRONG_PARAM_COUNT;
}
+ convert_to_string(text);
+ RETVAL_STRINGL(rfc822_binary(text->value.str.val,text->value.str.len,&len),len,1);
+
}
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net