15#ifndef MRBC_SRC_C_STRING_H_
16#define MRBC_SRC_C_STRING_H_
34#if !defined(MRBC_STRING_SIZE_T)
35#define MRBC_STRING_SIZE_T uint16_t
39#define RSTRING_LEN(str) mrbc_string_size(&str)
40#define RSTRING_PTR(str) mrbc_string_cstr(&str)
75int mrbc_string_utf8_size(
const char *str);
76int mrbc_string_char_size(
const char *str,
int len);
77int mrbc_string_chars2bytes(
mrbc_value *src,
int off,
int idx);
78int mrbc_string_bytes2chars(
const mrbc_value *src,
int byte_index);
106 if( res != 0 )
return res;
struct RObject mrbc_value
Value object. Default version.
int mrbc_string_index(const mrbc_value *src, const mrbc_value *pattern, int offset)
void mrbc_string_delete(mrbc_value *str)
mrbc_value mrbc_string_new(mrbc_vm *vm, const void *src, int len)
mrbc_value mrbc_string_new_alloc(mrbc_vm *vm, void *buf, int len)
void mrbc_string_clear(mrbc_value *str)
mrbc_value mrbc_string_dup(mrbc_vm *vm, mrbc_value *s1)
mrbc_value mrbc_string_add(mrbc_vm *vm, const mrbc_value *s1, const mrbc_value *s2)
int mrbc_string_chomp(mrbc_value *src)
int mrbc_string_append_cbuf(mrbc_value *s1, const void *s2, int len2)
int mrbc_string_upcase(mrbc_value *str)
int mrbc_string_downcase(mrbc_value *str)
int mrbc_string_append(mrbc_value *s1, const mrbc_value *s2)
int mrbc_string_strip(mrbc_value *src, int mode)
struct RString mrbc_string
String object.
static char * mrbc_string_cstr(const mrbc_value *v)
static int mrbc_string_compare(const mrbc_value *v1, const mrbc_value *v2)
static int mrbc_string_append_cstr(mrbc_value *s1, const char *s2)
#define MRBC_STRING_SIZE_T
static mrbc_value mrbc_string_new_cstr(mrbc_vm *vm, const char *src)
static int mrbc_string_size(const mrbc_value *str)
uint8_t * data
pointer to allocated buffer.
MRBC_STRING_SIZE_T size
string length.
mruby/c value definitions
struct VM mrbc_vm
Virtual Machine.
Global configuration of mruby/c VM's.