main.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. /*
  2. * Copyright 2005 - 2016 Zarafa and its licensors
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU Affero General Public License, version 3,
  6. * as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU Affero General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU Affero General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. *
  16. */
  17. // -*- Mode: C++ -*-
  18. #ifndef __PHP_EXT_MAIN_H
  19. #define __PHP_EXT_MAIN_H
  20. /***************************************************************
  21. * Thread safe global variable
  22. ***************************************************************/
  23. // ZTS is Zend Thread Safety
  24. // but it is not defined, as it seems to be experimental in php4
  25. // and maybe better in php5, but I haven't got the slightest clue yet.
  26. #ifdef ZTS
  27. #include "TSRM.h"
  28. #endif
  29. /***************************************************************
  30. * Variables
  31. ***************************************************************/
  32. #include "globals.h"
  33. /**
  34. * Numeric identifier for the resource type
  35. *
  36. */
  37. static int le_mapi_session;
  38. static int le_mapi_table;
  39. static int le_mapi_rowset;
  40. static int le_mapi_msgstore;
  41. static int le_mapi_addrbook;
  42. static int le_mapi_mailuser;
  43. static int le_mapi_distlist;
  44. static int le_mapi_abcont;
  45. static int le_mapi_folder;
  46. static int le_mapi_message;
  47. static int le_mapi_attachment;
  48. static int le_mapi_property;
  49. static int le_mapi_modifytable;
  50. static int le_istream;
  51. static int le_freebusy_support;
  52. static int le_freebusy_data;
  53. static int le_freebusy_update;
  54. static int le_freebusy_enumblock;
  55. static int le_mapi_exportchanges;
  56. static int le_mapi_importhierarchychanges;
  57. static int le_mapi_importcontentschanges;
  58. static int le_mapi_advisesink;
  59. /**
  60. * When adding or changing a entry here, don't forget to
  61. * add or change the same entry in class.mapi.php
  62. */
  63. static const char name_mapi_session[] = "MAPI Session";
  64. static const char name_mapi_table[] = "MAPI Table";
  65. static const char name_mapi_rowset[] = "MAPI Rowset";
  66. static const char name_mapi_msgstore[] = "MAPI Message Store";
  67. static const char name_mapi_addrbook[] = "MAPI Addressbook";
  68. static const char name_mapi_mailuser[] = "MAPI Mail User";
  69. static const char name_mapi_distlist[] = "MAPI Distribution List";
  70. static const char name_mapi_abcont[] = "MAPI Addressbook Container";
  71. static const char name_mapi_folder[] = "MAPI Folder";
  72. static const char name_mapi_message[] = "MAPI Message";
  73. static const char name_mapi_attachment[] = "MAPI Attachment";
  74. static const char name_mapi_property[] = "MAPI Property";
  75. static const char name_mapi_modifytable[] = "MAPI Exchange Modify Table";
  76. static const char name_istream[] = "IStream Interface";
  77. static const char name_fb_support[] = "Freebusy Support Interface";
  78. static const char name_fb_data[] = "Freebusy Data Interface";
  79. static const char name_fb_update[] = "Freebusy Update Interface";
  80. static const char name_fb_enumblock[] = "Freebusy Enumblock Interface";
  81. static const char name_mapi_exportchanges[] = "ICS Export Changes";
  82. static const char name_mapi_importhierarchychanges[] = "ICS Import Hierarchy Changes";
  83. static const char name_mapi_importcontentschanges[] = "ICS Import Contents Changes";
  84. static const char name_mapi_advisesink[] = "MAPI Advise sink";
  85. /**
  86. * common used variables
  87. */
  88. /***************************************************************
  89. * Function definitions
  90. **************************************************************/
  91. /* All the functions that will be exported (available) must be declared */
  92. PHP_MINIT_FUNCTION(mapi);
  93. PHP_MINFO_FUNCTION(mapi);
  94. PHP_MSHUTDOWN_FUNCTION(mapi);
  95. PHP_RINIT_FUNCTION(mapi);
  96. PHP_RSHUTDOWN_FUNCTION(mapi);
  97. ZEND_FUNCTION(mapi_last_hresult);
  98. ZEND_FUNCTION(mapi_prop_type);
  99. ZEND_FUNCTION(mapi_prop_id);
  100. ZEND_FUNCTION(mapi_is_error);
  101. ZEND_FUNCTION(mapi_make_scode);
  102. ZEND_FUNCTION(mapi_prop_tag);
  103. ZEND_FUNCTION(mapi_createoneoff);
  104. ZEND_FUNCTION(mapi_parseoneoff);
  105. ZEND_FUNCTION(mapi_logon);
  106. ZEND_FUNCTION(mapi_logon_zarafa);
  107. ZEND_FUNCTION(mapi_getmsgstorestable);
  108. ZEND_FUNCTION(mapi_openmsgstore);
  109. ZEND_FUNCTION(mapi_openprofilesection);
  110. ZEND_FUNCTION(mapi_openentry);
  111. ZEND_FUNCTION(mapi_openaddressbook);
  112. ZEND_FUNCTION(mapi_ab_openentry);
  113. ZEND_FUNCTION(mapi_ab_resolvename);
  114. ZEND_FUNCTION(mapi_ab_getdefaultdir);
  115. ZEND_FUNCTION(mapi_msgstore_createentryid);
  116. ZEND_FUNCTION(mapi_msgstore_getarchiveentryid);
  117. ZEND_FUNCTION(mapi_msgstore_openentry);
  118. ZEND_FUNCTION(mapi_msgstore_getreceivefolder);
  119. ZEND_FUNCTION(mapi_msgstore_entryidfromsourcekey);
  120. ZEND_FUNCTION(mapi_msgstore_openmultistoretable);
  121. ZEND_FUNCTION(mapi_msgstore_advise);
  122. ZEND_FUNCTION(mapi_msgstore_unadvise);
  123. ZEND_FUNCTION(mapi_sink_create);
  124. ZEND_FUNCTION(mapi_sink_timedwait);
  125. ZEND_FUNCTION(mapi_table_queryallrows);
  126. ZEND_FUNCTION(mapi_table_queryrows);
  127. ZEND_FUNCTION(mapi_table_getrowcount);
  128. ZEND_FUNCTION(mapi_table_setcolumns);
  129. ZEND_FUNCTION(mapi_table_seekrow);
  130. ZEND_FUNCTION(mapi_table_sort);
  131. ZEND_FUNCTION(mapi_table_restrict);
  132. ZEND_FUNCTION(mapi_table_findrow);
  133. ZEND_FUNCTION(mapi_table_createbookmark);
  134. ZEND_FUNCTION(mapi_table_freebookmark);
  135. ZEND_FUNCTION(mapi_folder_gethierarchytable);
  136. ZEND_FUNCTION(mapi_folder_getcontentstable);
  137. ZEND_FUNCTION(mapi_folder_createmessage);
  138. ZEND_FUNCTION(mapi_folder_createfolder);
  139. ZEND_FUNCTION(mapi_folder_deletefolder);
  140. ZEND_FUNCTION(mapi_folder_deletemessages);
  141. ZEND_FUNCTION(mapi_folder_copymessages);
  142. ZEND_FUNCTION(mapi_folder_copyfolder);
  143. ZEND_FUNCTION(mapi_folder_emptyfolder);
  144. ZEND_FUNCTION(mapi_folder_setreadflags);
  145. ZEND_FUNCTION(mapi_folder_getsearchcriteria);
  146. ZEND_FUNCTION(mapi_folder_setsearchcriteria);
  147. ZEND_FUNCTION(mapi_message_getattachmenttable);
  148. ZEND_FUNCTION(mapi_message_getrecipienttable);
  149. ZEND_FUNCTION(mapi_message_openattach);
  150. ZEND_FUNCTION(mapi_message_createattach);
  151. ZEND_FUNCTION(mapi_message_deleteattach);
  152. ZEND_FUNCTION(mapi_message_modifyrecipients);
  153. ZEND_FUNCTION(mapi_message_submitmessage);
  154. ZEND_FUNCTION(mapi_message_setreadflag);
  155. ZEND_FUNCTION(mapi_attach_openbin);
  156. ZEND_FUNCTION(mapi_attach_openobj);
  157. ZEND_FUNCTION(mapi_getnamesfromids);
  158. ZEND_FUNCTION(mapi_getidsfromnames);
  159. ZEND_FUNCTION(mapi_decompressrtf);
  160. ZEND_FUNCTION(mapi_folder_openmodifytable);
  161. ZEND_FUNCTION(mapi_rules_gettable);
  162. ZEND_FUNCTION(mapi_rules_modifytable);
  163. ZEND_FUNCTION(mapi_stream_write);
  164. ZEND_FUNCTION(mapi_stream_read);
  165. ZEND_FUNCTION(mapi_openpropertytostream);
  166. ZEND_FUNCTION(mapi_stream_stat);
  167. ZEND_FUNCTION(mapi_stream_seek);
  168. ZEND_FUNCTION(mapi_stream_commit);
  169. ZEND_FUNCTION(mapi_stream_setsize);
  170. ZEND_FUNCTION(mapi_stream_create);
  171. // generic functions for the function for every object derived from IMAPIProp (message, attachment, etc...)
  172. ZEND_FUNCTION(mapi_getprops);
  173. ZEND_FUNCTION(mapi_setprops);
  174. ZEND_FUNCTION(mapi_copyto);
  175. //ZEND_FUNCTION(mapi_copyprops);
  176. ZEND_FUNCTION(mapi_openproperty);
  177. ZEND_FUNCTION(mapi_deleteprops);
  178. ZEND_FUNCTION(mapi_savechanges);
  179. ZEND_FUNCTION(mapi_zarafa_createstore);
  180. ZEND_FUNCTION(mapi_zarafa_createuser);
  181. ZEND_FUNCTION(mapi_zarafa_deleteuser);
  182. ZEND_FUNCTION(mapi_zarafa_setuser);
  183. ZEND_FUNCTION(mapi_zarafa_getuser_by_id);
  184. ZEND_FUNCTION(mapi_zarafa_getuser_by_name);
  185. ZEND_FUNCTION(mapi_zarafa_getuserlist);
  186. ZEND_FUNCTION(mapi_zarafa_getquota);
  187. ZEND_FUNCTION(mapi_zarafa_setquota);
  188. ZEND_FUNCTION(mapi_zarafa_creategroup);
  189. ZEND_FUNCTION(mapi_zarafa_deletegroup);
  190. ZEND_FUNCTION(mapi_zarafa_setgroup);
  191. ZEND_FUNCTION(mapi_zarafa_addgroupmember);
  192. ZEND_FUNCTION(mapi_zarafa_deletegroupmember);
  193. ZEND_FUNCTION(mapi_zarafa_getgroup_by_id);
  194. ZEND_FUNCTION(mapi_zarafa_getgroup_by_name);
  195. ZEND_FUNCTION(mapi_zarafa_getgrouplist);
  196. ZEND_FUNCTION(mapi_zarafa_getgrouplistofuser);
  197. ZEND_FUNCTION(mapi_zarafa_getuserlistofgroup);
  198. ZEND_FUNCTION(mapi_zarafa_createcompany);
  199. ZEND_FUNCTION(mapi_zarafa_deletecompany);
  200. ZEND_FUNCTION(mapi_zarafa_getcompany_by_id);
  201. ZEND_FUNCTION(mapi_zarafa_getcompany_by_name);
  202. ZEND_FUNCTION(mapi_zarafa_getcompanylist);
  203. ZEND_FUNCTION(mapi_zarafa_add_company_remote_viewlist);
  204. ZEND_FUNCTION(mapi_zarafa_del_company_remote_viewlist);
  205. ZEND_FUNCTION(mapi_zarafa_get_remote_viewlist);
  206. ZEND_FUNCTION(mapi_zarafa_add_user_remote_adminlist);
  207. ZEND_FUNCTION(mapi_zarafa_del_user_remote_adminlist);
  208. ZEND_FUNCTION(mapi_zarafa_get_remote_adminlist);
  209. ZEND_FUNCTION(mapi_zarafa_add_quota_recipient);
  210. ZEND_FUNCTION(mapi_zarafa_del_quota_recipient);
  211. ZEND_FUNCTION(mapi_zarafa_get_quota_recipientlist);
  212. ZEND_FUNCTION(mapi_zarafa_check_license);
  213. ZEND_FUNCTION(mapi_zarafa_getcapabilities);
  214. // permissions functions
  215. ZEND_FUNCTION(mapi_zarafa_getpermissionrules);
  216. ZEND_FUNCTION(mapi_zarafa_setpermissionrules);
  217. //Freebusy support functions
  218. ZEND_FUNCTION(mapi_freebusysupport_open);
  219. ZEND_FUNCTION(mapi_freebusysupport_close);
  220. ZEND_FUNCTION(mapi_freebusysupport_loaddata);
  221. ZEND_FUNCTION(mapi_freebusysupport_loadupdate);
  222. //Freebusy data functions
  223. ZEND_FUNCTION(mapi_freebusydata_enumblocks);
  224. ZEND_FUNCTION(mapi_freebusydata_getpublishrange);
  225. ZEND_FUNCTION(mapi_freebusydata_setrange);
  226. // Freebusy enumblock
  227. ZEND_FUNCTION(mapi_freebusyenumblock_reset);
  228. ZEND_FUNCTION(mapi_freebusyenumblock_next);
  229. ZEND_FUNCTION(mapi_freebusyenumblock_skip);
  230. ZEND_FUNCTION(mapi_freebusyenumblock_restrict);
  231. // freebusy update
  232. ZEND_FUNCTION(mapi_freebusyupdate_publish);
  233. ZEND_FUNCTION(mapi_freebusyupdate_reset);
  234. ZEND_FUNCTION(mapi_freebusyupdate_savechanges);
  235. // Favorite functions
  236. ZEND_FUNCTION(mapi_favorite_add);
  237. // ICS functions
  238. ZEND_FUNCTION(mapi_exportchanges_config);
  239. ZEND_FUNCTION(mapi_exportchanges_synchronize);
  240. ZEND_FUNCTION(mapi_exportchanges_updatestate);
  241. ZEND_FUNCTION(mapi_exportchanges_getchangecount);
  242. ZEND_FUNCTION(mapi_importcontentschanges_config);
  243. ZEND_FUNCTION(mapi_importcontentschanges_updatestate);
  244. ZEND_FUNCTION(mapi_importcontentschanges_importmessagechange);
  245. ZEND_FUNCTION(mapi_importcontentschanges_importmessagedeletion);
  246. ZEND_FUNCTION(mapi_importcontentschanges_importperuserreadstatechange);
  247. ZEND_FUNCTION(mapi_importcontentschanges_importmessagemove);
  248. ZEND_FUNCTION(mapi_importhierarchychanges_config);
  249. ZEND_FUNCTION(mapi_importhierarchychanges_updatestate);
  250. ZEND_FUNCTION(mapi_importhierarchychanges_importfolderchange);
  251. ZEND_FUNCTION(mapi_importhierarchychanges_importfolderdeletion);
  252. ZEND_FUNCTION(mapi_wrap_importcontentschanges);
  253. ZEND_FUNCTION(mapi_wrap_importhierarchychanges);
  254. ZEND_FUNCTION(mapi_inetmapi_imtoinet);
  255. ZEND_FUNCTION(mapi_inetmapi_imtomapi);
  256. ZEND_FUNCTION(mapi_icaltomapi);
  257. ZEND_FUNCTION(mapi_mapitoical);
  258. ZEND_FUNCTION(mapi_vcftomapi);
  259. ZEND_FUNCTION(mapi_mapitovcf);
  260. ZEND_FUNCTION(mapi_enable_exceptions);
  261. ZEND_FUNCTION(mapi_feature);
  262. #endif