CVS update: php3/functions
| From: | rasmus | Date: | Fri, 21 Aug 1998 02:56:47 +0000 |
| Subject: | CVS update: php3/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-387@lists.php.net to get a copy of this message | ||
Date: Thursday August 20, 1998 @ 22:56
Author: rasmus
Update of /repository/php3/functions
In directory asf:/export/home/rasmus/php3/functions
Modified Files:
imap.c
Log Message:
Add OP_EXPUNGE flag to imap_open() flags
Index: php3/functions/imap.c
diff -c php3/functions/imap.c:1.16 php3/functions/imap.c:1.17
*** php3/functions/imap.c:1.16 Thu Aug 20 22:35:13 1998
--- php3/functions/imap.c Thu Aug 20 22:56:46 1998
***************
*** 31,37 ****
| Rasmus Lerdorf <rasmus@lerdorf.on.ca> |
+----------------------------------------------------------------------+
*/
! /* $Id: imap.c,v 1.16 1998/08/21 02:35:13 rasmus Exp $ */
#define IMAP41
--- 31,37 ----
| Rasmus Lerdorf <rasmus@lerdorf.on.ca> |
+----------------------------------------------------------------------+
*/
! /* $Id: imap.c,v 1.17 1998/08/21 02:56:46 rasmus Exp $ */
#define IMAP41
***************
*** 79,84 ****
--- 79,87 ----
#define CONTENT_MSG_BODY contents.msg.body
#define IMAPVER "Imap 4"
#endif
+
+ #define PHP_OP_EXPUNGE 32768
+
/*
* this array should be set up as:
* {"PHPScriptFunctionName",dllFunctionName,1}
***************
*** 258,263 ****
--- 261,273 ----
REGISTER_MAIN_LONG_CONSTANT("OP_SECURE", OP_SECURE, CONST_PERSISTENT | CONST_CS);
/* don't do non-secure authentication */
+ /* This is a PHP-specific define added because it seems like a good idea to be able to
+ indicate that the mailbox should be automatically expunged during imap_open in case the
+ script get interrupted and it doesn't get to the imap_close() where this option is
+ normally placed. If the c-client library adds other options and the value for this
+ one conflicts, simply make this one higher at the top of this file */
+ REGISTER_MAIN_LONG_CONSTANT("OP_EXPUNGE", PHP_OP_EXPUNGE, CONST_PERSISTENT |
CONST_CS);
+
/* Close options */
REGISTER_MAIN_LONG_CONSTANT("CL_EXPUNGE", CL_EXPUNGE, CONST_PERSISTENT |
CONST_CS);
***************
*** 360,365 ****
--- 370,377 ----
pval *options;
MAILSTREAM *imap_stream;
pils *imap_le_struct;
+ long flags=NIL;
+ long cl_flags=NIL;
int ind;
int myargc=ARG_COUNT(ht);
***************
*** 370,380 ****
convert_to_string(mailbox);
convert_to_string(user);
convert_to_string(passwd);
! if(myargc ==4) convert_to_long(options);
strcpy(imap_user,user->value.str.val);
strcpy(imap_password,passwd->value.str.val);
imap_stream = NIL;
! imap_stream = mail_open(imap_stream,mailbox->value.str.val,myargc == 4 ?
options->value.lval : NIL);
if (imap_stream == NIL){
php3_error(E_WARNING,"Couldn't open stream %s\n",mailbox->value.str.val);
--- 382,399 ----
convert_to_string(mailbox);
convert_to_string(user);
convert_to_string(passwd);
! if(myargc ==4) {
! convert_to_long(options);
! flags = options->value.lval;
! if(flags & PHP_OP_EXPUNGE) {
! cl_flags = CL_EXPUNGE;
! flags ^= PHP_OP_EXPUNGE;
! }
! }
strcpy(imap_user,user->value.str.val);
strcpy(imap_password,passwd->value.str.val);
imap_stream = NIL;
! imap_stream = mail_open(imap_stream,mailbox->value.str.val,flags);
if (imap_stream == NIL){
php3_error(E_WARNING,"Couldn't open stream %s\n",mailbox->value.str.val);
***************
*** 384,390 ****
struct needs to be malloc'ed and not emalloc'ed */
imap_le_struct = emalloc(sizeof(pils));
imap_le_struct->imap_stream = imap_stream;
! imap_le_struct->flags = NIL;
ind = php3_list_insert(imap_le_struct, le_imap);
RETURN_LONG(ind);
--- 403,409 ----
struct needs to be malloc'ed and not emalloc'ed */
imap_le_struct = emalloc(sizeof(pils));
imap_le_struct->imap_stream = imap_stream;
! imap_le_struct->flags = cl_flags;
ind = php3_list_insert(imap_le_struct, le_imap);
RETURN_LONG(ind);
--
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