Back to index

php5  5.3.10
php_imap.h
Go to the documentation of this file.
00001 /*
00002    +----------------------------------------------------------------------+
00003    | PHP Version 5                                                        |
00004    +----------------------------------------------------------------------+
00005    | Copyright (c) 1997-2012 The PHP Group                                |
00006    +----------------------------------------------------------------------+
00007    | This source file is subject to version 3.01 of the PHP license,      |
00008    | that is bundled with this package in the file LICENSE, and is        |
00009    | available through the world-wide-web at the following url:           |
00010    | http://www.php.net/license/3_01.txt                                  |
00011    | If you did not receive a copy of the PHP license and are unable to   |
00012    | obtain it through the world-wide-web, please send a note to          |
00013    | license@php.net so we can mail you a copy immediately.               |
00014    +----------------------------------------------------------------------+
00015    | Authors: Rex Logan           <veebert@dimensional.com>               |
00016    |          Mark Musone         <musone@afterfive.com>                  |
00017    |          Brian Wang          <brian@vividnet.com>                    |
00018    |          Kaj-Michael Lang    <milang@tal.org>                        |
00019    |          Antoni Pamies Olive <toni@readysoft.net>                    |
00020    |          Rasmus Lerdorf      <rasmus@php.net>                        |
00021    |          Chuck Hagenbuch     <chuck@horde.org>                       |
00022    |          Andrew Skalski      <askalski@chekinc.com>                  |
00023    |          Hartmut Holzgraefe  <hholzgra@php.net>                      |
00024    |          Jani Taskinen       <sniper@iki.fi>                         |
00025    |          Daniel R. Kalowsky  <kalowsky@php.net>                      |
00026    | PHP 4.0 updates:  Zeev Suraski <zeev@zend.com>                       |
00027    +----------------------------------------------------------------------+
00028  */
00029 
00030 /* $Id: php_imap.h 321634 2012-01-01 13:15:04Z felipe $ */
00031 
00032 #ifndef PHP_IMAP_H
00033 #define PHP_IMAP_H
00034 
00035 #if HAVE_IMAP
00036 
00037 #if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001)
00038  /* these are used for quota support */
00039 # include "c-client.h"      /* includes mail.h and rfc822.h */
00040 # include "imap4r1.h"       /* location of c-client quota functions */
00041 #else
00042 # include "mail.h"
00043 # include "rfc822.h" 
00044 #endif
00045 
00046 extern zend_module_entry imap_module_entry;
00047 #define imap_module_ptr &imap_module_entry
00048 
00049 
00050 /* Data types */
00051 
00052 #ifdef IMAP41
00053 #define LSIZE text.size
00054 #define LTEXT text.data
00055 #define DTYPE int
00056 #define CONTENT_PART nested.part
00057 #define CONTENT_MSG_BODY nested.msg->body
00058 #define IMAPVER "Imap 4R1"
00059 #else
00060 #define LSIZE size
00061 #define LTEXT text
00062 #define DTYPE char
00063 #define CONTENT_PART contents.part
00064 #define CONTENT_MSG_BODY contents.msg.body
00065 #define IMAPVER "Imap 4"
00066 #endif
00067 
00068 
00069 /* Determines how mm_list() and mm_lsub() are to return their results. */
00070 typedef enum {
00071        FLIST_ARRAY,
00072        FLIST_OBJECT
00073 } folderlist_style_t;
00074 
00075 typedef struct php_imap_le_struct {
00076        MAILSTREAM *imap_stream;
00077        long flags;
00078 } pils;
00079 
00080 typedef struct php_imap_mailbox_struct {
00081        SIZEDTEXT text;
00082        DTYPE delimiter;
00083        long attributes;
00084        struct php_imap_mailbox_struct *next;
00085 } FOBJECTLIST;
00086 
00087 typedef struct php_imap_error_struct {
00088        SIZEDTEXT text;
00089        long errflg;
00090        struct php_imap_error_struct *next;
00091 } ERRORLIST;
00092 
00093 typedef struct _php_imap_message_struct {
00094        unsigned long msgid;
00095        struct _php_imap_message_struct *next;
00096 } MESSAGELIST;
00097  
00098 
00099 /* Functions */
00100 
00101 PHP_MINIT_FUNCTION(imap);
00102 PHP_RINIT_FUNCTION(imap);
00103 PHP_RSHUTDOWN_FUNCTION(imap);
00104 PHP_MINFO_FUNCTION(imap);
00105 
00106 PHP_FUNCTION(imap_open);
00107 PHP_FUNCTION(imap_popen);
00108 PHP_FUNCTION(imap_reopen);
00109 PHP_FUNCTION(imap_num_msg);
00110 PHP_FUNCTION(imap_num_recent);
00111 PHP_FUNCTION(imap_headers);
00112 PHP_FUNCTION(imap_headerinfo);
00113 PHP_FUNCTION(imap_rfc822_parse_headers);
00114 PHP_FUNCTION(imap_body);
00115 PHP_FUNCTION(imap_fetchstructure);
00116 PHP_FUNCTION(imap_fetchbody);
00117 PHP_FUNCTION(imap_fetchmime);
00118 PHP_FUNCTION(imap_savebody);
00119 PHP_FUNCTION(imap_gc);
00120 PHP_FUNCTION(imap_expunge);
00121 PHP_FUNCTION(imap_delete);
00122 PHP_FUNCTION(imap_undelete);
00123 PHP_FUNCTION(imap_check);
00124 PHP_FUNCTION(imap_close);
00125 PHP_FUNCTION(imap_mail_copy);
00126 PHP_FUNCTION(imap_mail_move);
00127 PHP_FUNCTION(imap_createmailbox);
00128 PHP_FUNCTION(imap_renamemailbox);
00129 PHP_FUNCTION(imap_deletemailbox);
00130 PHP_FUNCTION(imap_listmailbox);
00131 PHP_FUNCTION(imap_scanmailbox);
00132 PHP_FUNCTION(imap_subscribe);
00133 PHP_FUNCTION(imap_unsubscribe);
00134 PHP_FUNCTION(imap_append);
00135 PHP_FUNCTION(imap_ping);
00136 PHP_FUNCTION(imap_base64);
00137 PHP_FUNCTION(imap_qprint);
00138 PHP_FUNCTION(imap_8bit);
00139 PHP_FUNCTION(imap_binary);
00140 PHP_FUNCTION(imap_mailboxmsginfo);
00141 PHP_FUNCTION(imap_rfc822_write_address);
00142 PHP_FUNCTION(imap_rfc822_parse_adrlist);
00143 PHP_FUNCTION(imap_setflag_full);
00144 PHP_FUNCTION(imap_clearflag_full);
00145 PHP_FUNCTION(imap_sort);
00146 PHP_FUNCTION(imap_fetchheader);
00147 PHP_FUNCTION(imap_fetchtext);
00148 PHP_FUNCTION(imap_uid);
00149 PHP_FUNCTION(imap_msgno);
00150 PHP_FUNCTION(imap_list);
00151 PHP_FUNCTION(imap_list_full);
00152 PHP_FUNCTION(imap_listscan);
00153 PHP_FUNCTION(imap_lsub);
00154 PHP_FUNCTION(imap_lsub_full);
00155 PHP_FUNCTION(imap_create);
00156 PHP_FUNCTION(imap_rename);
00157 PHP_FUNCTION(imap_status);
00158 PHP_FUNCTION(imap_bodystruct);
00159 PHP_FUNCTION(imap_fetch_overview);
00160 PHP_FUNCTION(imap_mail_compose);
00161 PHP_FUNCTION(imap_alerts);
00162 PHP_FUNCTION(imap_errors);
00163 PHP_FUNCTION(imap_last_error);
00164 PHP_FUNCTION(imap_mail);
00165 PHP_FUNCTION(imap_search);
00166 PHP_FUNCTION(imap_utf8);
00167 PHP_FUNCTION(imap_utf7_decode);
00168 PHP_FUNCTION(imap_utf7_encode);
00169 #ifdef HAVE_IMAP_MUTF7
00170 PHP_FUNCTION(imap_utf8_to_mutf7);
00171 PHP_FUNCTION(imap_mutf7_to_utf8);
00172 #endif
00173 PHP_FUNCTION(imap_mime_header_decode);
00174 PHP_FUNCTION(imap_thread);
00175 PHP_FUNCTION(imap_timeout);
00176 
00177 #if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001)
00178 PHP_FUNCTION(imap_get_quota);
00179 PHP_FUNCTION(imap_get_quotaroot);
00180 PHP_FUNCTION(imap_set_quota);
00181 PHP_FUNCTION(imap_setacl);
00182 PHP_FUNCTION(imap_getacl);
00183 #endif
00184 
00185 
00186 ZEND_BEGIN_MODULE_GLOBALS(imap)
00187        char *imap_user;
00188        char *imap_password;
00189 
00190        STRINGLIST *imap_alertstack;
00191        ERRORLIST *imap_errorstack;
00192 
00193        STRINGLIST *imap_folders;
00194        STRINGLIST *imap_folders_tail;
00195        STRINGLIST *imap_sfolders;
00196        STRINGLIST *imap_sfolders_tail;
00197        MESSAGELIST *imap_messages;
00198        MESSAGELIST *imap_messages_tail;
00199        FOBJECTLIST *imap_folder_objects;
00200        FOBJECTLIST *imap_folder_objects_tail;
00201        FOBJECTLIST *imap_sfolder_objects;
00202        FOBJECTLIST *imap_sfolder_objects_tail;
00203 
00204        folderlist_style_t folderlist_style;
00205        long status_flags;
00206        unsigned long status_messages;
00207        unsigned long status_recent;
00208        unsigned long status_unseen;
00209        unsigned long status_uidnext;
00210        unsigned long status_uidvalidity;
00211 #if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001)
00212        zval **quota_return;
00213        zval *imap_acl_list;
00214 #endif
00215        /* php_stream for php_mail_gets() */
00216        php_stream *gets_stream;
00217 ZEND_END_MODULE_GLOBALS(imap)
00218 
00219 #ifdef ZTS
00220 # define IMAPG(v) TSRMG(imap_globals_id, zend_imap_globals *, v)
00221 #else
00222 # define IMAPG(v) (imap_globals.v)
00223 #endif
00224 
00225 #else
00226 
00227 #define imap_module_ptr NULL
00228 
00229 #endif
00230 
00231 #define phpext_imap_ptr imap_module_ptr
00232 
00233 #endif /* PHP_IMAP_H */