Skip to content

Commit d772102

Browse files
committed
php_mapi: rip PHP-specific types from zcore_client.hpp
Make zcore_client usable without php.h.
1 parent f87975f commit d772102

File tree

3 files changed

+6
-13
lines changed

3 files changed

+6
-13
lines changed

include/gromox/zcore_client.hpp

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
#pragma once
2-
#include "php.h"
3-
#undef slprintf
4-
#undef vslprintf
5-
#undef snprintf
6-
#undef vsnprintf
7-
#undef vasprintf
8-
#undef asprintf
92
#include <cstdint>
103
#include <ctime>
114
#include <vector>
125
#include <gromox/zcore_rpc.hpp>
136

147
struct zcreq;
158
struct zcresp;
16-
extern zend_bool zclient_do_rpc(const zcreq *, zcresp *);
9+
extern bool zclient_do_rpc(const zcreq *, zcresp *);
1710
extern ec_error_t zclient_setpropval(GUID ses, uint32_t obj, gromox::proptag_t, const void *);
1811
extern ec_error_t zclient_getpropval(GUID ses, uint32_t obj, gromox::proptag_t, void **);
1912

@@ -78,9 +71,9 @@ ZCIDL(copyto, (GUID hsession, uint32_t hsrcobject, const PROPTAG_ARRAY *pexclude
7871
ZCIDL(savechanges, (GUID hsession, uint32_t hobject))
7972
ZCIDL(hierarchysync, (GUID hsession, uint32_t hfolder, IDLOUT uint32_t *hobject))
8073
ZCIDL(contentsync, (GUID hsession, uint32_t hfolder, IDLOUT uint32_t *hobject))
81-
ZCIDL(configsync, (GUID hsession, uint32_t hctx, uint32_t flags, const BINARY *pstate, const RESTRICTION *prestriction, IDLOUT zend_bool *b_changed, uint32_t *count))
74+
ZCIDL(configsync, (GUID hsession, uint32_t hctx, uint32_t flags, const BINARY *pstate, const RESTRICTION *prestriction, IDLOUT uint8_t *b_changed, uint32_t *count))
8275
ZCIDL(statesync, (GUID hsession, uint32_t hctx, IDLOUT BINARY *state))
83-
ZCIDL(syncmessagechange, (GUID hsession, uint32_t hctx, IDLOUT zend_bool *b_new, TPROPVAL_ARRAY *proplist))
76+
ZCIDL(syncmessagechange, (GUID hsession, uint32_t hctx, IDLOUT uint8_t *b_new, TPROPVAL_ARRAY *proplist))
8477
ZCIDL(syncfolderchange, (GUID hsession, uint32_t hctx, IDLOUT TPROPVAL_ARRAY *proplist))
8578
ZCIDL(syncreadstatechanges, (GUID hsession, uint32_t hctx, IDLOUT STATE_ARRAY *states))
8679
ZCIDL(syncdeletions, (GUID hsession, uint32_t hctx, uint32_t flags, IDLOUT BINARY_ARRAY *bins))

php_mapi/mapi.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ struct ICS_EXPORT_CTX {
103103
uint32_t hobject;
104104
uint8_t ics_type;
105105
zval pztarget_obj;
106-
zend_bool b_changed;
106+
uint8_t b_changed;
107107
uint32_t progress;
108108
uint32_t sync_steps;
109109
uint32_t total_steps;
@@ -3246,7 +3246,6 @@ static ZEND_FUNCTION(mapi_exportchanges_synchronize)
32463246
{
32473247
ZCL_MEMORY;
32483248
uint32_t flags;
3249-
zend_bool b_new;
32503249
zval *pzresource;
32513250
BINARY_ARRAY bins;
32523251
STATE_ARRAY states;
@@ -3293,6 +3292,7 @@ static ZEND_FUNCTION(mapi_exportchanges_synchronize)
32933292
}
32943293
for (size_t i = 0; i < pctx->sync_steps; ++i, ++pctx->progress) {
32953294
if (ICS_TYPE_CONTENTS == pctx->ics_type) {
3295+
uint8_t b_new = false;
32963296
auto result = zclient_syncmessagechange(
32973297
pctx->hsession, pctx->hobject, &b_new,
32983298
&propvals);

php_mapi/zclient.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ static zend_bool zclient_write_socket(int sockd, const BINARY &pbin)
100100
}
101101
}
102102

103-
zend_bool zclient_do_rpc(const zcreq *prequest, zcresp *presponse)
103+
bool zclient_do_rpc(const zcreq *prequest, zcresp *presponse)
104104
{
105105
BINARY tmp_bin;
106106

0 commit comments

Comments
 (0)