Module: Bromlife
- Defined in:
- lib/bromlife/version.rb,
lib/bromlife.rb,
ext/bromlife/rb_bromlife.c
Overview
– Copyright © 2026 gemmaro
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <www.gnu.org/licenses/>. ++
Defined Under Namespace
Classes: Element, Error, NodeIter, Parser
Constant Summary collapse
- VERSION =
"0.1.0"- LIBBROMLIFE_VERSION =
rb_int2num_inline (OML_VERSION)
Class Method Summary collapse
Class Method Details
.oml_to_dumped_json ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'ext/bromlife/rb_bromlife.c', line 29
static VALUE
rb_oml_m_oml_to_dumped_json (VALUE self, VALUE source)
{
(void)self;
char *bytes = rb_string_value_ptr (&source);
long len = RSTRING_LEN (source);
size_t json_len;
uint8_t *json_bytes = oml_to_json ((uint8_t *)bytes, (size_t)len, &json_len);
if (!json_bytes)
rb_raise (rb_eError, "failed to convert to JSON");
return rb_str_new ((char *)json_bytes, json_len);
}
|