MCPcopy Create free account
hub / github.com/apache/thrift / get_field_value

Function get_field_value

lib/rb/ext/struct.c:239–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237static void write_anything(int ttype, VALUE value, VALUE protocol, VALUE field_info);
238
239VALUE get_field_value(VALUE obj, VALUE field_name) {
240 char name_buf[RSTRING_LEN(field_name) + 2];
241
242 name_buf[0] = '@';
243 strlcpy(&name_buf[1], RSTRING_PTR(field_name), RSTRING_LEN(field_name) + 1);
244
245 VALUE value = rb_ivar_get(obj, rb_intern(name_buf));
246
247 return value;
248}
249
250static void write_container(int ttype, VALUE field_info, VALUE value, VALUE protocol) {
251 long sz, i;

Callers 1

rb_thrift_struct_writeFunction · 0.85

Calls 1

strlcpyFunction · 0.85

Tested by

no test coverage detected