| 237 | static void write_anything(int ttype, VALUE value, VALUE protocol, VALUE field_info); |
| 238 | |
| 239 | VALUE 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 | |
| 250 | static void write_container(int ttype, VALUE field_info, VALUE value, VALUE protocol) { |
| 251 | long sz, i; |
no test coverage detected