Skip to content

Commit 1cb7099

Browse files
Update all occurances of PHPAPI to PHP_REDIS_API (Win32 compat)
1 parent fb05979 commit 1cb7099

File tree

3 files changed

+84
-84
lines changed

3 files changed

+84
-84
lines changed

cluster_library.c

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ static int cluster_send_multi(redisCluster *c, short slot TSRMLS_DC) {
309309
* here because we know we'll only have sent MULTI to the master nodes. We can't
310310
* failover inside a transaction, as we don't know if the transaction will only
311311
* be readonly commands, or contain write commands as well */
312-
PHPAPI int cluster_send_exec(redisCluster *c, short slot TSRMLS_DC) {
312+
PHP_REDIS_API int cluster_send_exec(redisCluster *c, short slot TSRMLS_DC) {
313313
int retval;
314314

315315
/* Send exec */
@@ -324,7 +324,7 @@ PHPAPI int cluster_send_exec(redisCluster *c, short slot TSRMLS_DC) {
324324
return retval;
325325
}
326326

327-
PHPAPI int cluster_send_discard(redisCluster *c, short slot TSRMLS_DC) {
327+
PHP_REDIS_API int cluster_send_discard(redisCluster *c, short slot TSRMLS_DC) {
328328
if (cluster_send_direct(SLOT_SOCK(c,slot), RESP_DISCARD_CMD,
329329
sizeof(RESP_DISCARD_CMD)-1, TYPE_LINE TSRMLS_CC))
330330
{
@@ -656,7 +656,7 @@ cluster_node_create(redisCluster *c, char *host, size_t host_len,
656656
}
657657

658658
/* Attach a slave to a master */
659-
PHPAPI int
659+
PHP_REDIS_API int
660660
cluster_node_add_slave(redisClusterNode *master, redisClusterNode *slave)
661661
{
662662
ulong index;
@@ -748,7 +748,7 @@ static int cluster_map_slots(redisCluster *c, clusterReply *r) {
748748
}
749749

750750
/* Free a redisClusterNode structure */
751-
PHPAPI void cluster_free_node(redisClusterNode *node) {
751+
PHP_REDIS_API void cluster_free_node(redisClusterNode *node) {
752752
if(node->slaves) {
753753
zend_hash_destroy(node->slaves);
754754
efree(node->slaves);
@@ -786,7 +786,7 @@ static RedisSock *cluster_get_asking_sock(redisCluster *c TSRMLS_DC) {
786786
}
787787

788788
/* Initialize seeds */
789-
PHPAPI int
789+
PHP_REDIS_API int
790790
cluster_init_seeds(redisCluster *cluster, HashTable *ht_seeds) {
791791
RedisSock *redis_sock;
792792
char *str, *psep, key[1024];
@@ -830,7 +830,7 @@ cluster_init_seeds(redisCluster *cluster, HashTable *ht_seeds) {
830830
}
831831

832832
/* Initial mapping of our cluster keyspace */
833-
PHPAPI int
833+
PHP_REDIS_API int
834834
cluster_map_keyspace(redisCluster *c TSRMLS_DC) {
835835
RedisSock **seed;
836836
clusterReply *slots=NULL;
@@ -973,7 +973,7 @@ static int cluster_check_response(redisCluster *c, REDIS_REPLY_TYPE *reply_type
973973
}
974974

975975
/* Disconnect from each node we're connected to */
976-
PHPAPI void cluster_disconnect(redisCluster *c TSRMLS_DC) {
976+
PHP_REDIS_API void cluster_disconnect(redisCluster *c TSRMLS_DC) {
977977
redisClusterNode **node;
978978

979979
for(zend_hash_internal_pointer_reset(c->nodes);
@@ -1206,7 +1206,7 @@ static void cluster_update_slot(redisCluster *c TSRMLS_DC) {
12061206
/* Abort any transaction in process, by sending DISCARD to any nodes that
12071207
* have active transactions in progress. If we can't send DISCARD, we need
12081208
* to disconnect as it would leave us in an undefined state. */
1209-
PHPAPI int cluster_abort_exec(redisCluster *c TSRMLS_DC) {
1209+
PHP_REDIS_API int cluster_abort_exec(redisCluster *c TSRMLS_DC) {
12101210
clusterFoldItem *fi = c->multi_head;
12111211

12121212
/* Loop through our fold items */
@@ -1232,7 +1232,7 @@ PHPAPI int cluster_abort_exec(redisCluster *c TSRMLS_DC) {
12321232
/* Iterate through our slots, looking for the host/port in question. This
12331233
* should perform well enough as in almost all situations, a few or a few
12341234
* dozen servers will map all the slots */
1235-
PHPAPI short cluster_find_slot(redisCluster *c, const char *host,
1235+
PHP_REDIS_API short cluster_find_slot(redisCluster *c, const char *host,
12361236
unsigned short port)
12371237
{
12381238
int i;
@@ -1251,7 +1251,7 @@ PHPAPI short cluster_find_slot(redisCluster *c, const char *host,
12511251
}
12521252

12531253
/* Send a command to a specific slot */
1254-
PHPAPI int cluster_send_slot(redisCluster *c, short slot, char *cmd,
1254+
PHP_REDIS_API int cluster_send_slot(redisCluster *c, short slot, char *cmd,
12551255
int cmd_len, REDIS_REPLY_TYPE rtype TSRMLS_DC)
12561256
{
12571257
/* Point our cluster to this slot and it's socket */
@@ -1284,7 +1284,7 @@ PHPAPI int cluster_send_slot(redisCluster *c, short slot, char *cmd,
12841284

12851285
/* Send a command to given slot in our cluster. If we get a MOVED or ASK error
12861286
* we attempt to send the command to the node as directed. */
1287-
PHPAPI short cluster_send_command(redisCluster *c, short slot, const char *cmd,
1287+
PHP_REDIS_API short cluster_send_command(redisCluster *c, short slot, const char *cmd,
12881288
int cmd_len TSRMLS_DC)
12891289
{
12901290
int resp, timedout=0;
@@ -1372,7 +1372,7 @@ PHPAPI short cluster_send_command(redisCluster *c, short slot, const char *cmd,
13721372
* consumed. */
13731373

13741374
/* RAW bulk response handler */
1375-
PHPAPI void cluster_bulk_raw_resp(INTERNAL_FUNCTION_PARAMETERS,
1375+
PHP_REDIS_API void cluster_bulk_raw_resp(INTERNAL_FUNCTION_PARAMETERS,
13761376
redisCluster *c, void *ctx)
13771377
{
13781378
char *resp;
@@ -1393,7 +1393,7 @@ PHPAPI void cluster_bulk_raw_resp(INTERNAL_FUNCTION_PARAMETERS,
13931393
}
13941394

13951395
/* BULK response handler */
1396-
PHPAPI void cluster_bulk_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
1396+
PHP_REDIS_API void cluster_bulk_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
13971397
void *ctx)
13981398
{
13991399
char *resp;
@@ -1425,7 +1425,7 @@ PHPAPI void cluster_bulk_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
14251425
}
14261426

14271427
/* Bulk response where we expect a double */
1428-
PHPAPI void cluster_dbl_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
1428+
PHP_REDIS_API void cluster_dbl_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
14291429
void *ctx)
14301430
{
14311431
char *resp;
@@ -1447,7 +1447,7 @@ PHPAPI void cluster_dbl_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
14471447

14481448
/* A boolean response. If we get here, we've consumed the '+' reply
14491449
* type and will now just verify we can read the OK */
1450-
PHPAPI void cluster_bool_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
1450+
PHP_REDIS_API void cluster_bool_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
14511451
void *ctx)
14521452
{
14531453
// Check that we have +OK
@@ -1461,7 +1461,7 @@ PHPAPI void cluster_bool_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
14611461
}
14621462

14631463
/* Boolean response, specialized for PING */
1464-
PHPAPI void cluster_ping_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
1464+
PHP_REDIS_API void cluster_ping_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
14651465
void *ctx)
14661466
{
14671467
if(c->reply_type != TYPE_LINE || c->reply_len != 4 ||
@@ -1474,7 +1474,7 @@ PHPAPI void cluster_ping_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
14741474
}
14751475

14761476
/* 1 or 0 response, for things like SETNX */
1477-
PHPAPI void cluster_1_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
1477+
PHP_REDIS_API void cluster_1_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
14781478
void *ctx)
14791479
{
14801480
// Validate our reply type, and check for a zero
@@ -1486,7 +1486,7 @@ PHPAPI void cluster_1_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
14861486
}
14871487

14881488
/* Generic integer response */
1489-
PHPAPI void cluster_long_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
1489+
PHP_REDIS_API void cluster_long_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
14901490
void *ctx)
14911491
{
14921492
if(c->reply_type != TYPE_INT) {
@@ -1496,7 +1496,7 @@ PHPAPI void cluster_long_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
14961496
}
14971497

14981498
/* TYPE response handler */
1499-
PHPAPI void cluster_type_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
1499+
PHP_REDIS_API void cluster_type_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
15001500
void *ctx)
15011501
{
15021502
// Make sure we got the right kind of response
@@ -1521,7 +1521,7 @@ PHPAPI void cluster_type_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
15211521
}
15221522

15231523
/* SUBSCRIBE/PSCUBSCRIBE handler */
1524-
PHPAPI void cluster_sub_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
1524+
PHP_REDIS_API void cluster_sub_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
15251525
void *ctx)
15261526
{
15271527
subscribeContext *sctx = (subscribeContext*)ctx;
@@ -1647,7 +1647,7 @@ PHPAPI void cluster_sub_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
16471647
}
16481648

16491649
/* UNSUBSCRIBE/PUNSUBSCRIBE */
1650-
PHPAPI void cluster_unsub_resp(INTERNAL_FUNCTION_PARAMETERS,
1650+
PHP_REDIS_API void cluster_unsub_resp(INTERNAL_FUNCTION_PARAMETERS,
16511651
redisCluster *c, void *ctx)
16521652
{
16531653
subscribeContext *sctx = (subscribeContext*)ctx;
@@ -1731,7 +1731,7 @@ static void cluster_mbulk_variant_resp(clusterReply *r, zval *z_ret)
17311731

17321732
/* Variant response handling, for things like EVAL and various other responses
17331733
* where we just map the replies from Redis type values to PHP ones directly. */
1734-
PHPAPI void cluster_variant_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
1734+
PHP_REDIS_API void cluster_variant_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
17351735
void *ctx)
17361736
{
17371737
clusterReply *r;
@@ -1801,7 +1801,7 @@ PHPAPI void cluster_variant_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
18011801
}
18021802

18031803
/* Generic MULTI BULK response processor */
1804-
PHPAPI void cluster_gen_mbulk_resp(INTERNAL_FUNCTION_PARAMETERS,
1804+
PHP_REDIS_API void cluster_gen_mbulk_resp(INTERNAL_FUNCTION_PARAMETERS,
18051805
redisCluster *c, mbulk_cb cb, void *ctx)
18061806
{
18071807
zval *z_result;
@@ -1838,7 +1838,7 @@ PHPAPI void cluster_gen_mbulk_resp(INTERNAL_FUNCTION_PARAMETERS,
18381838
}
18391839

18401840
/* HSCAN, SSCAN, ZSCAN */
1841-
PHPAPI int cluster_scan_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
1841+
PHP_REDIS_API int cluster_scan_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
18421842
REDIS_SCAN_TYPE type, long *it)
18431843
{
18441844
char *pit;
@@ -1895,7 +1895,7 @@ PHPAPI int cluster_scan_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
18951895
}
18961896

18971897
/* INFO response */
1898-
PHPAPI void cluster_info_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
1898+
PHP_REDIS_API void cluster_info_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
18991899
void *ctx)
19001900
{
19011901
zval *z_result;
@@ -1921,7 +1921,7 @@ PHPAPI void cluster_info_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
19211921
}
19221922

19231923
/* CLIENT LIST response */
1924-
PHPAPI void cluster_client_list_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
1924+
PHP_REDIS_API void cluster_client_list_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
19251925
void *ctx)
19261926
{
19271927
zval *z_result;
@@ -1946,7 +1946,7 @@ PHPAPI void cluster_client_list_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster
19461946
}
19471947

19481948
/* MULTI BULK response loop where we might pull the next one */
1949-
PHPAPI zval *cluster_zval_mbulk_resp(INTERNAL_FUNCTION_PARAMETERS,
1949+
PHP_REDIS_API zval *cluster_zval_mbulk_resp(INTERNAL_FUNCTION_PARAMETERS,
19501950
redisCluster *c, int pull, mbulk_cb cb)
19511951
{
19521952
zval *z_result;
@@ -1978,7 +1978,7 @@ PHPAPI zval *cluster_zval_mbulk_resp(INTERNAL_FUNCTION_PARAMETERS,
19781978
}
19791979

19801980
/* MULTI MULTI BULK reply (for EXEC) */
1981-
PHPAPI void cluster_multi_mbulk_resp(INTERNAL_FUNCTION_PARAMETERS,
1981+
PHP_REDIS_API void cluster_multi_mbulk_resp(INTERNAL_FUNCTION_PARAMETERS,
19821982
redisCluster *c, void *ctx)
19831983
{
19841984
MAKE_STD_ZVAL(c->multi_resp);
@@ -2015,7 +2015,7 @@ PHPAPI void cluster_multi_mbulk_resp(INTERNAL_FUNCTION_PARAMETERS,
20152015
}
20162016

20172017
/* Generic handler for MGET */
2018-
PHPAPI void cluster_mbulk_mget_resp(INTERNAL_FUNCTION_PARAMETERS,
2018+
PHP_REDIS_API void cluster_mbulk_mget_resp(INTERNAL_FUNCTION_PARAMETERS,
20192019
redisCluster *c, void *ctx)
20202020
{
20212021
clusterMultiCtx *mctx = (clusterMultiCtx*)ctx;
@@ -2049,7 +2049,7 @@ PHPAPI void cluster_mbulk_mget_resp(INTERNAL_FUNCTION_PARAMETERS,
20492049
}
20502050

20512051
/* Handler for MSETNX */
2052-
PHPAPI void cluster_msetnx_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
2052+
PHP_REDIS_API void cluster_msetnx_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
20532053
void *ctx)
20542054
{
20552055
clusterMultiCtx *mctx = (clusterMultiCtx*)ctx;
@@ -2085,7 +2085,7 @@ PHPAPI void cluster_msetnx_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
20852085
}
20862086

20872087
/* Handler for DEL */
2088-
PHPAPI void cluster_del_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
2088+
PHP_REDIS_API void cluster_del_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
20892089
void *ctx)
20902090
{
20912091
clusterMultiCtx *mctx = (clusterMultiCtx*)ctx;
@@ -2114,7 +2114,7 @@ PHPAPI void cluster_del_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
21142114
}
21152115

21162116
/* Handler for MSET */
2117-
PHPAPI void cluster_mset_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
2117+
PHP_REDIS_API void cluster_mset_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
21182118
void *ctx)
21192119
{
21202120
clusterMultiCtx *mctx = (clusterMultiCtx*)ctx;
@@ -2144,15 +2144,15 @@ PHPAPI void cluster_mset_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
21442144
}
21452145

21462146
/* Raw MULTI BULK reply */
2147-
PHPAPI void
2147+
PHP_REDIS_API void
21482148
cluster_mbulk_raw_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c, void *ctx)
21492149
{
21502150
cluster_gen_mbulk_resp(INTERNAL_FUNCTION_PARAM_PASSTHRU, c,
21512151
mbulk_resp_loop_raw, NULL);
21522152
}
21532153

21542154
/* Unserialize all the things */
2155-
PHPAPI void
2155+
PHP_REDIS_API void
21562156
cluster_mbulk_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c, void *ctx)
21572157
{
21582158
cluster_gen_mbulk_resp(INTERNAL_FUNCTION_PARAM_PASSTHRU, c,
@@ -2161,7 +2161,7 @@ cluster_mbulk_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c, void *ctx)
21612161

21622162
/* For handling responses where we get key, value, key, value that
21632163
* we will turn into key => value, key => value. */
2164-
PHPAPI void
2164+
PHP_REDIS_API void
21652165
cluster_mbulk_zipstr_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
21662166
void *ctx)
21672167
{
@@ -2170,7 +2170,7 @@ cluster_mbulk_zipstr_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
21702170
}
21712171

21722172
/* Handling key,value to key=>value where the values are doubles */
2173-
PHPAPI void
2173+
PHP_REDIS_API void
21742174
cluster_mbulk_zipdbl_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
21752175
void *ctx)
21762176
{
@@ -2179,7 +2179,7 @@ cluster_mbulk_zipdbl_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
21792179
}
21802180

21812181
/* Associate multi bulk response (for HMGET really) */
2182-
PHPAPI void
2182+
PHP_REDIS_API void
21832183
cluster_mbulk_assoc_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
21842184
void *ctx)
21852185
{

0 commit comments

Comments
 (0)