@@ -309,7 +309,7 @@ static int cluster_send_multi(redisCluster *c, short slot TSRMLS_DC) {
309
309
* here because we know we'll only have sent MULTI to the master nodes. We can't
310
310
* failover inside a transaction, as we don't know if the transaction will only
311
311
* 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 ) {
313
313
int retval ;
314
314
315
315
/* Send exec */
@@ -324,7 +324,7 @@ PHPAPI int cluster_send_exec(redisCluster *c, short slot TSRMLS_DC) {
324
324
return retval ;
325
325
}
326
326
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 ) {
328
328
if (cluster_send_direct (SLOT_SOCK (c ,slot ), RESP_DISCARD_CMD ,
329
329
sizeof (RESP_DISCARD_CMD )- 1 , TYPE_LINE TSRMLS_CC ))
330
330
{
@@ -656,7 +656,7 @@ cluster_node_create(redisCluster *c, char *host, size_t host_len,
656
656
}
657
657
658
658
/* Attach a slave to a master */
659
- PHPAPI int
659
+ PHP_REDIS_API int
660
660
cluster_node_add_slave (redisClusterNode * master , redisClusterNode * slave )
661
661
{
662
662
ulong index ;
@@ -748,7 +748,7 @@ static int cluster_map_slots(redisCluster *c, clusterReply *r) {
748
748
}
749
749
750
750
/* Free a redisClusterNode structure */
751
- PHPAPI void cluster_free_node (redisClusterNode * node ) {
751
+ PHP_REDIS_API void cluster_free_node (redisClusterNode * node ) {
752
752
if (node -> slaves ) {
753
753
zend_hash_destroy (node -> slaves );
754
754
efree (node -> slaves );
@@ -786,7 +786,7 @@ static RedisSock *cluster_get_asking_sock(redisCluster *c TSRMLS_DC) {
786
786
}
787
787
788
788
/* Initialize seeds */
789
- PHPAPI int
789
+ PHP_REDIS_API int
790
790
cluster_init_seeds (redisCluster * cluster , HashTable * ht_seeds ) {
791
791
RedisSock * redis_sock ;
792
792
char * str , * psep , key [1024 ];
@@ -830,7 +830,7 @@ cluster_init_seeds(redisCluster *cluster, HashTable *ht_seeds) {
830
830
}
831
831
832
832
/* Initial mapping of our cluster keyspace */
833
- PHPAPI int
833
+ PHP_REDIS_API int
834
834
cluster_map_keyspace (redisCluster * c TSRMLS_DC ) {
835
835
RedisSock * * seed ;
836
836
clusterReply * slots = NULL ;
@@ -973,7 +973,7 @@ static int cluster_check_response(redisCluster *c, REDIS_REPLY_TYPE *reply_type
973
973
}
974
974
975
975
/* 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 ) {
977
977
redisClusterNode * * node ;
978
978
979
979
for (zend_hash_internal_pointer_reset (c -> nodes );
@@ -1206,7 +1206,7 @@ static void cluster_update_slot(redisCluster *c TSRMLS_DC) {
1206
1206
/* Abort any transaction in process, by sending DISCARD to any nodes that
1207
1207
* have active transactions in progress. If we can't send DISCARD, we need
1208
1208
* 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 ) {
1210
1210
clusterFoldItem * fi = c -> multi_head ;
1211
1211
1212
1212
/* Loop through our fold items */
@@ -1232,7 +1232,7 @@ PHPAPI int cluster_abort_exec(redisCluster *c TSRMLS_DC) {
1232
1232
/* Iterate through our slots, looking for the host/port in question. This
1233
1233
* should perform well enough as in almost all situations, a few or a few
1234
1234
* 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 ,
1236
1236
unsigned short port )
1237
1237
{
1238
1238
int i ;
@@ -1251,7 +1251,7 @@ PHPAPI short cluster_find_slot(redisCluster *c, const char *host,
1251
1251
}
1252
1252
1253
1253
/* 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 ,
1255
1255
int cmd_len , REDIS_REPLY_TYPE rtype TSRMLS_DC )
1256
1256
{
1257
1257
/* 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,
1284
1284
1285
1285
/* Send a command to given slot in our cluster. If we get a MOVED or ASK error
1286
1286
* 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 ,
1288
1288
int cmd_len TSRMLS_DC )
1289
1289
{
1290
1290
int resp , timedout = 0 ;
@@ -1372,7 +1372,7 @@ PHPAPI short cluster_send_command(redisCluster *c, short slot, const char *cmd,
1372
1372
* consumed. */
1373
1373
1374
1374
/* 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 ,
1376
1376
redisCluster * c , void * ctx )
1377
1377
{
1378
1378
char * resp ;
@@ -1393,7 +1393,7 @@ PHPAPI void cluster_bulk_raw_resp(INTERNAL_FUNCTION_PARAMETERS,
1393
1393
}
1394
1394
1395
1395
/* 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 ,
1397
1397
void * ctx )
1398
1398
{
1399
1399
char * resp ;
@@ -1425,7 +1425,7 @@ PHPAPI void cluster_bulk_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
1425
1425
}
1426
1426
1427
1427
/* 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 ,
1429
1429
void * ctx )
1430
1430
{
1431
1431
char * resp ;
@@ -1447,7 +1447,7 @@ PHPAPI void cluster_dbl_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
1447
1447
1448
1448
/* A boolean response. If we get here, we've consumed the '+' reply
1449
1449
* 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 ,
1451
1451
void * ctx )
1452
1452
{
1453
1453
// Check that we have +OK
@@ -1461,7 +1461,7 @@ PHPAPI void cluster_bool_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
1461
1461
}
1462
1462
1463
1463
/* 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 ,
1465
1465
void * ctx )
1466
1466
{
1467
1467
if (c -> reply_type != TYPE_LINE || c -> reply_len != 4 ||
@@ -1474,7 +1474,7 @@ PHPAPI void cluster_ping_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
1474
1474
}
1475
1475
1476
1476
/* 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 ,
1478
1478
void * ctx )
1479
1479
{
1480
1480
// Validate our reply type, and check for a zero
@@ -1486,7 +1486,7 @@ PHPAPI void cluster_1_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
1486
1486
}
1487
1487
1488
1488
/* 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 ,
1490
1490
void * ctx )
1491
1491
{
1492
1492
if (c -> reply_type != TYPE_INT ) {
@@ -1496,7 +1496,7 @@ PHPAPI void cluster_long_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
1496
1496
}
1497
1497
1498
1498
/* 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 ,
1500
1500
void * ctx )
1501
1501
{
1502
1502
// Make sure we got the right kind of response
@@ -1521,7 +1521,7 @@ PHPAPI void cluster_type_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
1521
1521
}
1522
1522
1523
1523
/* 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 ,
1525
1525
void * ctx )
1526
1526
{
1527
1527
subscribeContext * sctx = (subscribeContext * )ctx ;
@@ -1647,7 +1647,7 @@ PHPAPI void cluster_sub_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
1647
1647
}
1648
1648
1649
1649
/* UNSUBSCRIBE/PUNSUBSCRIBE */
1650
- PHPAPI void cluster_unsub_resp (INTERNAL_FUNCTION_PARAMETERS ,
1650
+ PHP_REDIS_API void cluster_unsub_resp (INTERNAL_FUNCTION_PARAMETERS ,
1651
1651
redisCluster * c , void * ctx )
1652
1652
{
1653
1653
subscribeContext * sctx = (subscribeContext * )ctx ;
@@ -1731,7 +1731,7 @@ static void cluster_mbulk_variant_resp(clusterReply *r, zval *z_ret)
1731
1731
1732
1732
/* Variant response handling, for things like EVAL and various other responses
1733
1733
* 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 ,
1735
1735
void * ctx )
1736
1736
{
1737
1737
clusterReply * r ;
@@ -1801,7 +1801,7 @@ PHPAPI void cluster_variant_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
1801
1801
}
1802
1802
1803
1803
/* 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 ,
1805
1805
redisCluster * c , mbulk_cb cb , void * ctx )
1806
1806
{
1807
1807
zval * z_result ;
@@ -1838,7 +1838,7 @@ PHPAPI void cluster_gen_mbulk_resp(INTERNAL_FUNCTION_PARAMETERS,
1838
1838
}
1839
1839
1840
1840
/* 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 ,
1842
1842
REDIS_SCAN_TYPE type , long * it )
1843
1843
{
1844
1844
char * pit ;
@@ -1895,7 +1895,7 @@ PHPAPI int cluster_scan_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
1895
1895
}
1896
1896
1897
1897
/* 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 ,
1899
1899
void * ctx )
1900
1900
{
1901
1901
zval * z_result ;
@@ -1921,7 +1921,7 @@ PHPAPI void cluster_info_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
1921
1921
}
1922
1922
1923
1923
/* 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 ,
1925
1925
void * ctx )
1926
1926
{
1927
1927
zval * z_result ;
@@ -1946,7 +1946,7 @@ PHPAPI void cluster_client_list_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster
1946
1946
}
1947
1947
1948
1948
/* 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 ,
1950
1950
redisCluster * c , int pull , mbulk_cb cb )
1951
1951
{
1952
1952
zval * z_result ;
@@ -1978,7 +1978,7 @@ PHPAPI zval *cluster_zval_mbulk_resp(INTERNAL_FUNCTION_PARAMETERS,
1978
1978
}
1979
1979
1980
1980
/* 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 ,
1982
1982
redisCluster * c , void * ctx )
1983
1983
{
1984
1984
MAKE_STD_ZVAL (c -> multi_resp );
@@ -2015,7 +2015,7 @@ PHPAPI void cluster_multi_mbulk_resp(INTERNAL_FUNCTION_PARAMETERS,
2015
2015
}
2016
2016
2017
2017
/* 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 ,
2019
2019
redisCluster * c , void * ctx )
2020
2020
{
2021
2021
clusterMultiCtx * mctx = (clusterMultiCtx * )ctx ;
@@ -2049,7 +2049,7 @@ PHPAPI void cluster_mbulk_mget_resp(INTERNAL_FUNCTION_PARAMETERS,
2049
2049
}
2050
2050
2051
2051
/* 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 ,
2053
2053
void * ctx )
2054
2054
{
2055
2055
clusterMultiCtx * mctx = (clusterMultiCtx * )ctx ;
@@ -2085,7 +2085,7 @@ PHPAPI void cluster_msetnx_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
2085
2085
}
2086
2086
2087
2087
/* 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 ,
2089
2089
void * ctx )
2090
2090
{
2091
2091
clusterMultiCtx * mctx = (clusterMultiCtx * )ctx ;
@@ -2114,7 +2114,7 @@ PHPAPI void cluster_del_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
2114
2114
}
2115
2115
2116
2116
/* 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 ,
2118
2118
void * ctx )
2119
2119
{
2120
2120
clusterMultiCtx * mctx = (clusterMultiCtx * )ctx ;
@@ -2144,15 +2144,15 @@ PHPAPI void cluster_mset_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
2144
2144
}
2145
2145
2146
2146
/* Raw MULTI BULK reply */
2147
- PHPAPI void
2147
+ PHP_REDIS_API void
2148
2148
cluster_mbulk_raw_resp (INTERNAL_FUNCTION_PARAMETERS , redisCluster * c , void * ctx )
2149
2149
{
2150
2150
cluster_gen_mbulk_resp (INTERNAL_FUNCTION_PARAM_PASSTHRU , c ,
2151
2151
mbulk_resp_loop_raw , NULL );
2152
2152
}
2153
2153
2154
2154
/* Unserialize all the things */
2155
- PHPAPI void
2155
+ PHP_REDIS_API void
2156
2156
cluster_mbulk_resp (INTERNAL_FUNCTION_PARAMETERS , redisCluster * c , void * ctx )
2157
2157
{
2158
2158
cluster_gen_mbulk_resp (INTERNAL_FUNCTION_PARAM_PASSTHRU , c ,
@@ -2161,7 +2161,7 @@ cluster_mbulk_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c, void *ctx)
2161
2161
2162
2162
/* For handling responses where we get key, value, key, value that
2163
2163
* we will turn into key => value, key => value. */
2164
- PHPAPI void
2164
+ PHP_REDIS_API void
2165
2165
cluster_mbulk_zipstr_resp (INTERNAL_FUNCTION_PARAMETERS , redisCluster * c ,
2166
2166
void * ctx )
2167
2167
{
@@ -2170,7 +2170,7 @@ cluster_mbulk_zipstr_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
2170
2170
}
2171
2171
2172
2172
/* Handling key,value to key=>value where the values are doubles */
2173
- PHPAPI void
2173
+ PHP_REDIS_API void
2174
2174
cluster_mbulk_zipdbl_resp (INTERNAL_FUNCTION_PARAMETERS , redisCluster * c ,
2175
2175
void * ctx )
2176
2176
{
@@ -2179,7 +2179,7 @@ cluster_mbulk_zipdbl_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
2179
2179
}
2180
2180
2181
2181
/* Associate multi bulk response (for HMGET really) */
2182
- PHPAPI void
2182
+ PHP_REDIS_API void
2183
2183
cluster_mbulk_assoc_resp (INTERNAL_FUNCTION_PARAMETERS , redisCluster * c ,
2184
2184
void * ctx )
2185
2185
{
0 commit comments