mlumish | b892a27 | 2014-12-09 16:28:23 -0800 | [diff] [blame] | 1 | #ifndef NET_GRPC_PHP_GRPC_CALL_H_ |
| 2 | #define NET_GRPC_PHP_GRPC_CALL_H_ |
| 3 | |
| 4 | #ifdef HAVE_CONFIG_H |
| 5 | #include "config.h" |
| 6 | #endif |
| 7 | |
| 8 | #include "php.h" |
| 9 | #include "php_ini.h" |
| 10 | #include "ext/standard/info.h" |
| 11 | #include "php_grpc.h" |
| 12 | |
| 13 | #include "grpc/grpc.h" |
| 14 | |
| 15 | /* Class entry for the Call PHP class */ |
| 16 | zend_class_entry *grpc_ce_call; |
| 17 | |
| 18 | /* Wrapper struct for grpc_call that can be associated with a PHP object */ |
| 19 | typedef struct wrapped_grpc_call { |
| 20 | zend_object std; |
| 21 | |
mlumish | 34cd1f0 | 2015-01-02 13:32:41 -0800 | [diff] [blame^] | 22 | bool owned; |
mlumish | b892a27 | 2014-12-09 16:28:23 -0800 | [diff] [blame] | 23 | grpc_call *wrapped; |
| 24 | } wrapped_grpc_call; |
| 25 | |
| 26 | /* Initializes the Call PHP class */ |
| 27 | void grpc_init_call(TSRMLS_D); |
| 28 | |
| 29 | /* Creates a Call object that wraps the given grpc_call struct */ |
mlumish | 34cd1f0 | 2015-01-02 13:32:41 -0800 | [diff] [blame^] | 30 | zval *grpc_php_wrap_call(grpc_call *wrapped, bool owned); |
mlumish | b892a27 | 2014-12-09 16:28:23 -0800 | [diff] [blame] | 31 | |
| 32 | /* Creates and returns a PHP associative array of metadata from a C array of |
| 33 | * call metadata */ |
| 34 | zval *grpc_call_create_metadata_array(int count, grpc_metadata *elements); |
| 35 | |
| 36 | #endif /* NET_GRPC_PHP_GRPC_CHANNEL_H_ */ |