Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
f0eee5f2
There was an error fetching the commit references. Please try again later.
Commit
f0eee5f2
authored
10 years ago
by
Yuki Yugui Sonoda
Browse files
Options
Downloads
Patches
Plain Diff
Make some functions static
They don't need to be extern
parent
99eb9f94
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/ruby/ext/grpc/rb_call.c
+10
-9
10 additions, 9 deletions
src/ruby/ext/grpc/rb_call.c
src/ruby/ext/grpc/rb_grpc.c
+6
-6
6 additions, 6 deletions
src/ruby/ext/grpc/rb_grpc.c
with
16 additions
and
15 deletions
src/ruby/ext/grpc/rb_call.c
+
10
−
9
View file @
f0eee5f2
...
...
@@ -53,7 +53,6 @@ VALUE grpc_rb_eCallError = Qnil;
a timeout. */
static
VALUE
grpc_rb_eOutOfTime
=
Qnil
;
/* grpc_rb_sBatchResult is struct class used to hold the results of a batch
* call. */
static
VALUE
grpc_rb_sBatchResult
;
...
...
@@ -98,7 +97,7 @@ static VALUE sym_cancelled;
static
VALUE
hash_all_calls
;
/* Destroys a Call. */
void
grpc_rb_call_destroy
(
void
*
p
)
{
static
void
grpc_rb_call_destroy
(
void
*
p
)
{
grpc_call
*
call
=
NULL
;
VALUE
ref_count
=
Qnil
;
if
(
p
==
NULL
)
{
...
...
@@ -200,7 +199,7 @@ static VALUE grpc_rb_call_set_metadata(VALUE self, VALUE metadata) {
it's capacity should have been computed via a prior call to
grpc_rb_md_ary_fill_hash_cb
*/
int
grpc_rb_md_ary_fill_hash_cb
(
VALUE
key
,
VALUE
val
,
VALUE
md_ary_obj
)
{
static
int
grpc_rb_md_ary_fill_hash_cb
(
VALUE
key
,
VALUE
val
,
VALUE
md_ary_obj
)
{
grpc_metadata_array
*
md_ary
=
NULL
;
int
array_length
;
int
i
;
...
...
@@ -239,7 +238,8 @@ int grpc_rb_md_ary_fill_hash_cb(VALUE key, VALUE val, VALUE md_ary_obj) {
/* grpc_rb_md_ary_capacity_hash_cb is the hash iteration callback used
to pre-compute the capacity a grpc_metadata_array.
*/
int
grpc_rb_md_ary_capacity_hash_cb
(
VALUE
key
,
VALUE
val
,
VALUE
md_ary_obj
)
{
static
int
grpc_rb_md_ary_capacity_hash_cb
(
VALUE
key
,
VALUE
val
,
VALUE
md_ary_obj
)
{
grpc_metadata_array
*
md_ary
=
NULL
;
/* Construct a metadata object from key and value and add it */
...
...
@@ -257,7 +257,7 @@ int grpc_rb_md_ary_capacity_hash_cb(VALUE key, VALUE val, VALUE md_ary_obj) {
/* grpc_rb_md_ary_convert converts a ruby metadata hash into
a grpc_metadata_array.
*/
void
grpc_rb_md_ary_convert
(
VALUE
md_ary_hash
,
grpc_metadata_array
*
md_ary
)
{
static
void
grpc_rb_md_ary_convert
(
VALUE
md_ary_hash
,
grpc_metadata_array
*
md_ary
)
{
VALUE
md_ary_obj
=
Qnil
;
if
(
md_ary_hash
==
Qnil
)
{
return
;
/* Do nothing if the expected has value is nil */
...
...
@@ -313,7 +313,8 @@ VALUE grpc_rb_md_ary_to_h(grpc_metadata_array *md_ary) {
/* grpc_rb_call_check_op_keys_hash_cb is a hash iteration func that checks
each key of an ops hash is valid.
*/
int
grpc_rb_call_check_op_keys_hash_cb
(
VALUE
key
,
VALUE
val
,
VALUE
ops_ary
)
{
static
int
grpc_rb_call_check_op_keys_hash_cb
(
VALUE
key
,
VALUE
val
,
VALUE
ops_ary
)
{
/* Update the capacity; the value is an array, add capacity for each value in
* the array */
if
(
TYPE
(
key
)
!=
T_FIXNUM
)
{
...
...
@@ -342,7 +343,7 @@ int grpc_rb_call_check_op_keys_hash_cb(VALUE key, VALUE val, VALUE ops_ary) {
/* grpc_rb_op_update_status_from_server adds the values in a ruby status
struct to the 'send_status_from_server' portion of an op.
*/
void
grpc_rb_op_update_status_from_server
(
grpc_op
*
op
,
static
void
grpc_rb_op_update_status_from_server
(
grpc_op
*
op
,
grpc_metadata_array
*
md_ary
,
VALUE
status
)
{
VALUE
code
=
rb_struct_aref
(
status
,
sym_code
);
...
...
@@ -594,7 +595,7 @@ static VALUE grpc_rb_call_run_batch(VALUE self, VALUE cqueue, VALUE tag,
return
result
;
}
void
Init_grpc_error_codes
()
{
static
void
Init_grpc_error_codes
()
{
/* Constants representing the error codes of grpc_call_error in grpc.h */
VALUE
grpc_rb_mRpcErrors
=
rb_define_module_under
(
grpc_rb_mGrpcCore
,
"RpcErrors"
);
...
...
@@ -646,7 +647,7 @@ void Init_grpc_error_codes() {
rb_obj_freeze
(
rb_error_code_details
);
}
void
Init_grpc_op_codes
()
{
static
void
Init_grpc_op_codes
()
{
/* Constants representing operation type codes in grpc.h */
VALUE
grpc_rb_mCallOps
=
rb_define_module_under
(
grpc_rb_mGrpcCore
,
"CallOps"
);
...
...
This diff is collapsed.
Click to expand it.
src/ruby/ext/grpc/rb_grpc.c
+
6
−
6
View file @
f0eee5f2
...
...
@@ -150,7 +150,7 @@ gpr_timespec grpc_rb_time_timeval(VALUE time, int interval) {
return
t
;
}
void
Init_grpc_status_codes
()
{
static
void
Init_grpc_status_codes
()
{
/* Constants representing the status codes or grpc_status_code in status.h */
VALUE
grpc_rb_mStatusCodes
=
rb_define_module_under
(
grpc_rb_mGrpcCore
,
"StatusCodes"
);
...
...
@@ -199,7 +199,7 @@ static ID id_inspect;
static
ID
id_to_s
;
/* Converts a wrapped time constant to a standard time. */
VALUE
grpc_rb_time_val_to_time
(
VALUE
self
)
{
static
VALUE
grpc_rb_time_val_to_time
(
VALUE
self
)
{
gpr_timespec
*
time_const
=
NULL
;
Data_Get_Struct
(
self
,
gpr_timespec
,
time_const
);
return
rb_funcall
(
rb_cTime
,
id_at
,
2
,
INT2NUM
(
time_const
->
tv_sec
),
...
...
@@ -207,17 +207,17 @@ VALUE grpc_rb_time_val_to_time(VALUE self) {
}
/* Invokes inspect on the ctime version of the time val. */
VALUE
grpc_rb_time_val_inspect
(
VALUE
self
)
{
static
VALUE
grpc_rb_time_val_inspect
(
VALUE
self
)
{
return
rb_funcall
(
grpc_rb_time_val_to_time
(
self
),
id_inspect
,
0
);
}
/* Invokes to_s on the ctime version of the time val. */
VALUE
grpc_rb_time_val_to_s
(
VALUE
self
)
{
static
VALUE
grpc_rb_time_val_to_s
(
VALUE
self
)
{
return
rb_funcall
(
grpc_rb_time_val_to_time
(
self
),
id_to_s
,
0
);
}
/* Adds a module with constants that map to gpr's static timeval structs. */
void
Init_grpc_time_consts
()
{
static
void
Init_grpc_time_consts
()
{
VALUE
grpc_rb_mTimeConsts
=
rb_define_module_under
(
grpc_rb_mGrpcCore
,
"TimeConsts"
);
grpc_rb_cTimeVal
=
...
...
@@ -244,7 +244,7 @@ void Init_grpc_time_consts() {
id_tv_nsec
=
rb_intern
(
"tv_nsec"
);
}
void
grpc_rb_shutdown
(
void
*
vm
)
{
grpc_shutdown
();
}
static
void
grpc_rb_shutdown
(
void
*
vm
)
{
grpc_shutdown
();
}
/* Initialize the GRPC module structs */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment