src/php/ext/grpc/channel.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2015 gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 #ifndef NET_GRPC_PHP_GRPC_CHANNEL_H_
20 #define NET_GRPC_PHP_GRPC_CHANNEL_H_
21 
22 #include "channel_credentials.h"
23 #include "php_grpc.h"
24 
25 #if PHP_MAJOR_VERSION >= 8
26 #define ZEND_HASH_INIT(hash_table, limit, descriptor, zend_bool) _zend_hash_init(hash_table, limit, descriptor, zend_bool);
27 #else
28 #define ZEND_HASH_INIT(hash_table, limit, descriptor, zend_bool) zend_hash_init_ex(hash_table, limit, NULL, descriptor, zend_bool, 0);
29 #endif
30 
31 /* Class entry for the PHP Channel class */
32 extern zend_class_entry *grpc_ce_channel;
33 
34 typedef struct _grpc_channel_wrapper {
36  char *key;
37  char *target;
38  char *args_hashstr;
40  size_t ref_count;
43  wrapped_grpc_channel_credentials *creds;
45 
46 /* Wrapper struct for grpc_channel that can be associated with a PHP object */
47 PHP_GRPC_WRAP_OBJECT_START(wrapped_grpc_channel)
49 PHP_GRPC_WRAP_OBJECT_END(wrapped_grpc_channel)
50 
51 static inline wrapped_grpc_channel
53  return (wrapped_grpc_channel*)((char*)(obj) -
54  XtOffsetOf(wrapped_grpc_channel, std));
55 }
56 
57 /* Initializes the Channel class */
59 
60 /* Iterates through a PHP array and populates args with the contents */
61 int php_grpc_read_args_array(zval *args_array, grpc_channel_args *args
62  TSRMLS_DC);
63 
64 void generate_sha1_str(char *sha1str, char *str, php_grpc_int len);
65 
67  TSRMLS_DC);
68 
69 typedef struct _channel_persistent_le {
72 
73 typedef struct _target_bound_le {
77 
78 #endif /* NET_GRPC_PHP_GRPC_CHANNEL_H_ */
xds_interop_client.str
str
Definition: xds_interop_client.py:487
obj
OPENSSL_EXPORT const ASN1_OBJECT * obj
Definition: x509.h:1671
_grpc_channel_wrapper::creds
wrapped_grpc_channel_credentials * creds
Definition: src/php/ext/grpc/channel.h:43
_channel_persistent_le::channel
grpc_channel_wrapper * channel
Definition: src/php/ext/grpc/channel.h:70
_grpc_channel_wrapper::args
grpc_channel_args args
Definition: src/php/ext/grpc/channel.h:42
channel_credentials.h
_grpc_channel_wrapper::mu
gpr_mu mu
Definition: src/php/ext/grpc/channel.h:41
generate_sha1_str
void generate_sha1_str(char *sha1str, char *str, php_grpc_int len)
Definition: channel.c:167
_target_bound_le::current_count
int current_count
Definition: src/php/ext/grpc/channel.h:75
php_grpc_delete_persistent_list_entry
void php_grpc_delete_persistent_list_entry(char *key, php_grpc_int key_len TSRMLS_DC)
Definition: channel.c:580
grpc_channel_args
Definition: grpc_types.h:132
_grpc_channel_wrapper::wrapped
grpc_channel * wrapped
Definition: src/php/ext/grpc/channel.h:35
_grpc_channel_wrapper::args_hashstr
char * args_hashstr
Definition: src/php/ext/grpc/channel.h:38
wrapped_grpc_channel_from_obj
static wrapped_grpc_channel * wrapped_grpc_channel_from_obj(zend_object *obj)
Definition: src/php/ext/grpc/channel.h:52
channel
wrapped_grpc_channel * channel
Definition: src/php/ext/grpc/call.h:33
asyncio_get_stats.args
args
Definition: asyncio_get_stats.py:40
php_grpc_int
#define php_grpc_int
Definition: php7_wrapper.h:24
_grpc_channel_wrapper::key
char * key
Definition: src/php/ext/grpc/channel.h:36
_channel_persistent_le
Definition: src/php/ext/grpc/channel.h:69
wrapper
grpc_channel_wrapper * wrapper
Definition: src/php/ext/grpc/channel.h:48
php_grpc.h
grpc_channel_wrapper
struct _grpc_channel_wrapper grpc_channel_wrapper
grpc_ce_channel
zend_class_entry * grpc_ce_channel
Definition: channel.c:40
_grpc_channel_wrapper::ref_count
size_t ref_count
Definition: src/php/ext/grpc/channel.h:40
_grpc_channel_wrapper::creds_hashstr
char * creds_hashstr
Definition: src/php/ext/grpc/channel.h:39
key
const char * key
Definition: hpack_parser_table.cc:164
channel_persistent_le_t
struct _channel_persistent_le channel_persistent_le_t
PHP_GRPC_WRAP_OBJECT_END
#define PHP_GRPC_WRAP_OBJECT_END(name)
Definition: php7_wrapper.h:63
PHP_GRPC_WRAP_OBJECT_START
#define PHP_GRPC_WRAP_OBJECT_START(name)
Definition: php7_wrapper.h:61
target_bound_le_t
struct _target_bound_le target_bound_le_t
gpr_mu
pthread_mutex_t gpr_mu
Definition: impl/codegen/sync_posix.h:47
std
Definition: grpcpp/impl/codegen/async_unary_call.h:407
_grpc_channel_wrapper
Definition: src/php/ext/grpc/channel.h:34
_grpc_channel_wrapper::target
char * target
Definition: src/php/ext/grpc/channel.h:37
_target_bound_le::upper_bound
int upper_bound
Definition: src/php/ext/grpc/channel.h:74
grpc_channel
struct grpc_channel grpc_channel
Definition: grpc_types.h:62
php_grpc_read_args_array
int php_grpc_read_args_array(zval *args_array, grpc_channel_args *args TSRMLS_DC)
Definition: channel.c:117
GRPC_STARTUP_FUNCTION
GRPC_STARTUP_FUNCTION(channel)
Definition: channel.c:785
len
int len
Definition: abseil-cpp/absl/base/internal/low_level_alloc_test.cc:46
_target_bound_le
Definition: src/php/ext/grpc/channel.h:73


grpc
Author(s):
autogenerated on Fri May 16 2025 02:57:52