blob: a2202eb8d31a51faa623c93fe5fd64663a245c8d [file] [log] [blame]
nnoble097ef9b2014-12-01 17:06:10 -08001/*
2 *
Jan Tattermusch7897ae92017-06-07 22:57:36 +02003 * Copyright 2015 gRPC authors.
nnoble097ef9b2014-12-01 17:06:10 -08004 *
Jan Tattermusch7897ae92017-06-07 22:57:36 +02005 * 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
nnoble097ef9b2014-12-01 17:06:10 -08008 *
Jan Tattermusch7897ae92017-06-07 22:57:36 +02009 * http://www.apache.org/licenses/LICENSE-2.0
nnoble097ef9b2014-12-01 17:06:10 -080010 *
Jan Tattermusch7897ae92017-06-07 22:57:36 +020011 * 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.
nnoble097ef9b2014-12-01 17:06:10 -080016 *
17 */
18
19#ifndef GRPC_RB_CALL_H_
20#define GRPC_RB_CALL_H_
21
Nicolas "Pixel" Noble357cb812015-05-14 05:33:43 +020022#include <ruby/ruby.h>
23
nnoble097ef9b2014-12-01 17:06:10 -080024#include <grpc/grpc.h>
nnoble097ef9b2014-12-01 17:06:10 -080025
26/* Gets the wrapped call from a VALUE. */
Craig Tillerbaa14a92017-11-03 09:09:36 -070027grpc_call* grpc_rb_get_wrapped_call(VALUE v);
nnoble097ef9b2014-12-01 17:06:10 -080028
29/* Gets the VALUE corresponding to given grpc_call. */
Craig Tillerbaa14a92017-11-03 09:09:36 -070030VALUE grpc_rb_wrap_call(grpc_call* c, grpc_completion_queue* q);
nnoble097ef9b2014-12-01 17:06:10 -080031
32/* Provides the details of an call error */
Craig Tillerbaa14a92017-11-03 09:09:36 -070033const char* grpc_call_error_detail_of(grpc_call_error err);
nnoble097ef9b2014-12-01 17:06:10 -080034
Tim Emiola1dae4ac2015-03-27 17:17:37 -070035/* Converts a metadata array to a hash. */
Craig Tillerbaa14a92017-11-03 09:09:36 -070036VALUE grpc_rb_md_ary_to_h(grpc_metadata_array* md_ary);
Tim Emiola1dae4ac2015-03-27 17:17:37 -070037
murgatroid999946f2b2015-12-04 14:36:27 -080038/* grpc_rb_md_ary_convert converts a ruby metadata hash into
39 a grpc_metadata_array.
40*/
Craig Tillerbaa14a92017-11-03 09:09:36 -070041void grpc_rb_md_ary_convert(VALUE md_ary_hash, grpc_metadata_array* md_ary);
murgatroid999946f2b2015-12-04 14:36:27 -080042
Alexander Polcyn85cc1432017-07-14 16:36:51 -070043void grpc_rb_metadata_array_destroy_including_entries(
Craig Tillerbaa14a92017-11-03 09:09:36 -070044 grpc_metadata_array* md_ary);
Alexander Polcyn85cc1432017-07-14 16:36:51 -070045
Yuki Yugui Sonodaa7d369e2015-04-11 11:48:36 +090046/* grpc_rb_eCallError is the ruby class of the exception thrown during call
nnoble097ef9b2014-12-01 17:06:10 -080047 operations. */
Yuki Yugui Sonodaa7d369e2015-04-11 11:48:36 +090048extern VALUE grpc_rb_eCallError;
nnoble097ef9b2014-12-01 17:06:10 -080049
50/* Initializes the Call class. */
Tim Emiola409e6c82015-02-17 17:46:35 -080051void Init_grpc_call();
nnoble097ef9b2014-12-01 17:06:10 -080052
Craig Tillerb5dcec52015-01-13 11:13:42 -080053#endif /* GRPC_RB_CALL_H_ */