CVS update: php3/functions
| From: | musone | Date: | Fri, 21 Aug 1998 19:12:45 +0000 |
| Subject: | CVS update: php3/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-438@lists.php.net to get a copy of this message | ||
Date: Friday August 21, 1998 @ 15:12
Author: musone
Update of /repository/php3/functions
In directory asf:/tmp/cvs-serv1996
Modified Files:
imap.c imap.h
Log Message:
added imap_status
also added aliases for the start of the move to make
the imap_ functions in-sync with the c-client mail_ functions.
Index: php3/functions/imap.c
diff -c php3/functions/imap.c:1.23 php3/functions/imap.c:1.24
*** php3/functions/imap.c:1.23 Fri Aug 21 14:36:31 1998
--- php3/functions/imap.c Fri Aug 21 15:12:45 1998
***************
*** 31,37 ****
| Rasmus Lerdorf <rasmus@lerdorf.on.ca> |
+----------------------------------------------------------------------+
*/
! /* $Id: imap.c,v 1.23 1998/08/21 18:36:31 rasmus Exp $ */
#define IMAP41
--- 31,37 ----
| Rasmus Lerdorf <rasmus@lerdorf.on.ca> |
+----------------------------------------------------------------------+
*/
! /* $Id: imap.c,v 1.24 1998/08/21 19:12:45 musone Exp $ */
#define IMAP41
***************
*** 148,153 ****
--- 148,159 ----
{"imap_fetchtext", php3_imap_body, NULL},
{"imap_uid", php3_imap_uid, NULL},
{"imap_msgno",php3_imap_msgno, NULL},
+ {"imap_list", php3_imap_list, NULL},
+ {"imap_scan", php3_imap_listscan, NULL},
+ {"imap_lsub", php3_imap_lsub, NULL},
+ {"imap_create", php3_imap_createmailbox, NULL},
+ {"imap_rename", php3_imap_renamemailbox, NULL},
+ {"imap_status", php3_imap_status, NULL},
{NULL, NULL, NULL}
};
***************
*** 171,176 ****
--- 177,188 ----
char imap_password[80]="";
STRINGLIST *imap_folders=NIL;
STRINGLIST *imap_sfolders=NIL;
+ long status_flags;
+ unsigned long status_messages;
+ unsigned long status_recent;
+ unsigned long status_unseen;
+ unsigned long status_uidnext;
+ unsigned long status_uidvalidity;
MAILSTREAM *mail_close_it (pils *imap_le_struct)
{
***************
*** 1811,1816 ****
--- 1823,1868 ----
RETURN_LONG(mail_msgno(imap_le_struct->imap_stream, msgno->value.lval));
}
+
+ void php3_imap_status(INTERNAL_FUNCTION_PARAMETERS)
+ {
+ pval *streamind, *mbx, *flags;
+ int ind, ind_type;
+ pils *imap_le_struct;
+ int myargc=ARG_COUNT(ht);
+ if (myargc < 2 || myargc > 3 ||
getParameters(ht,myargc,&streamind,&mbx,&flags) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ }
+
+ convert_to_long(streamind);
+ convert_to_string(mbx);
+ if(myargc == 3) 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;
+ }
+
+ if(object_init(return_value) == FAILURE){
+ RETURN_FALSE;
+ }
+ if(mail_status(imap_le_struct->imap_stream, mbx->value.str.val,myargc == 3 ?
flags->value.lval : NIL))
+ {
+ add_property_long(return_value,"flags",status_flags);
+ if(status_flags & SA_MESSAGES)
add_property_long(return_value,"messages",status_messages);
+ if(status_flags & SA_RECENT)
add_property_long(return_value,"recent",status_recent);
+ if(status_flags & SA_UNSEEN)
add_property_long(return_value,"unseen",status_unseen);
+ if(status_flags & SA_UIDNEXT)
add_property_long(return_value,"uidnext",status_uidnext);
+ if(status_flags & SA_UIDVALIDITY)
add_property_long(return_value,"uidvalidity",status_uidvalidity);
+ }
+ else
+ {
+ RETURN_FALSE;
+ }
+ }
/* Interfaces to C-client */
***************
*** 1882,1887 ****
--- 1934,1946 ----
void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
{
+ status_flags=status->flags;
+ if(status_flags & SA_MESSAGES) status_messages=status->messages;
+ if(status_flags & SA_RECENT) status_recent=status->recent;
+ if(status_flags & SA_UNSEEN) status_unseen=status->unseen;
+ if(status_flags & SA_UIDNEXT) status_uidnext=status->uidnext;
+ if(status_flags & SA_UIDVALIDITY) status_uidvalidity=status->uidvalidity;
+
}
void mm_log (char *string,long errflg)
Index: php3/functions/imap.h
diff -c php3/functions/imap.h:1.4 php3/functions/imap.h:1.5
*** php3/functions/imap.h:1.4 Fri Aug 7 09:27:15 1998
--- php3/functions/imap.h Fri Aug 21 15:12:45 1998
***************
*** 62,67 ****
--- 62,68 ----
void php3_imap_uid(INTERNAL_FUNCTION_PARAMETERS);
void php3_imap_msgno(INTERNAL_FUNCTION_PARAMETERS);
void php3_imap_fetchtext_full(INTERNAL_FUNCTION_PARAMETERS);
+ void php3_imap_status(INTERNAL_FUNCTION_PARAMETERS);
#else
#define php3_imap_module_ptr NULL
--
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