| 145 | } |
| 146 | |
| 147 | void etf_parser::append_atom_utf8(etf_buffer *b, const char *bytes, size_t size) { |
| 148 | if (size < 255) { |
| 149 | unsigned char buf[2] = {ett_atom_utf8_small, (unsigned char)size}; |
| 150 | buffer_write(b, (const char *)buf, 2); |
| 151 | buffer_write(b, (const char *)bytes, size); |
| 152 | } else { |
| 153 | unsigned char buf[3]; |
| 154 | buf[0] = ett_atom_utf8; |
| 155 | |
| 156 | if (size > 0xFFFF) { |
| 157 | throw dpp::parse_exception(err_etf, "ETF: Atom too large"); |
| 158 | } |
| 159 | |
| 160 | store_16_bits(buf + 1, size); |
| 161 | buffer_write(b, (const char *)buf, 3); |
| 162 | buffer_write(b, (const char *)bytes, size); |
| 163 | } |
| 164 | } |
| 165 | |
| 166 | void etf_parser::append_binary(etf_buffer *b, const char *bytes, size_t size) { |
| 167 | unsigned char buf[5]; |
nothing calls this directly
no test coverage detected