blob: 4151c76512cd998b02396e6789590305aa118bb4 [file] [log] [blame]
mlumishb892a272014-12-09 16:28:23 -08001#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 */
16zend_class_entry *grpc_ce_call;
17
18/* Wrapper struct for grpc_call that can be associated with a PHP object */
19typedef struct wrapped_grpc_call {
20 zend_object std;
21
mlumish34cd1f02015-01-02 13:32:41 -080022 bool owned;
mlumishb892a272014-12-09 16:28:23 -080023 grpc_call *wrapped;
24} wrapped_grpc_call;
25
26/* Initializes the Call PHP class */
27void grpc_init_call(TSRMLS_D);
28
29/* Creates a Call object that wraps the given grpc_call struct */
mlumish34cd1f02015-01-02 13:32:41 -080030zval *grpc_php_wrap_call(grpc_call *wrapped, bool owned);
mlumishb892a272014-12-09 16:28:23 -080031
32/* Creates and returns a PHP associative array of metadata from a C array of
33 * call metadata */
34zval *grpc_call_create_metadata_array(int count, grpc_metadata *elements);
35
36#endif /* NET_GRPC_PHP_GRPC_CHANNEL_H_ */