Groonga 3.0.9 Source Code Document
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
groonga
vendor
mruby-eeac4be
include
mruby
string.h
Go to the documentation of this file.
1
/*
2
** mruby/string.h - String class
3
**
4
** See Copyright Notice in mruby.h
5
*/
6
7
#ifndef MRUBY_STRING_H
8
#define MRUBY_STRING_H
9
10
#if defined(__cplusplus)
11
extern
"C"
{
12
#endif
13
14
#define IS_EVSTR(p,e) ((p) < (e) && (*(p) == '$' || *(p) == '@' || *(p) == '{'))
15
16
extern
const
char
mrb_digitmap
[];
17
18
struct
RString
{
19
MRB_OBJECT_HEADER
;
20
mrb_int
len
;
21
union
{
22
mrb_int
capa
;
23
struct
mrb_shared_string
*
shared
;
24
}
aux
;
25
char
*
ptr
;
26
};
27
28
#define mrb_str_ptr(s) ((struct RString*)(mrb_ptr(s)))
29
#define RSTRING(s) ((struct RString*)(mrb_ptr(s)))
30
#define RSTRING_PTR(s) (RSTRING(s)->ptr)
31
#define RSTRING_LEN(s) (RSTRING(s)->len)
32
#define RSTRING_CAPA(s) (RSTRING(s)->aux.capa)
33
#define RSTRING_END(s) (RSTRING(s)->ptr + RSTRING(s)->len)
34
35
void
mrb_gc_free_str
(
mrb_state
*,
struct
RString
*);
36
void
mrb_str_modify
(
mrb_state
*,
struct
RString
*);
37
mrb_value
mrb_str_literal
(
mrb_state
*,
mrb_value
);
38
void
mrb_str_concat
(
mrb_state
*,
mrb_value
,
mrb_value
);
39
mrb_value
mrb_str_plus
(
mrb_state
*,
mrb_value
,
mrb_value
);
40
mrb_value
mrb_ptr_to_str
(
mrb_state
*,
void
*);
41
mrb_value
mrb_obj_as_string
(
mrb_state
*mrb,
mrb_value
obj);
42
mrb_value
mrb_str_resize
(
mrb_state
*mrb,
mrb_value
str,
mrb_int
len
);
43
mrb_value
mrb_str_substr
(
mrb_state
*mrb,
mrb_value
str,
mrb_int
beg,
mrb_int
len
);
44
mrb_value
mrb_string_type
(
mrb_state
*mrb,
mrb_value
str);
45
mrb_value
mrb_check_string_type
(
mrb_state
*mrb,
mrb_value
str);
46
mrb_value
mrb_str_buf_new
(
mrb_state
*mrb,
mrb_int
capa);
47
mrb_value
mrb_str_buf_cat
(
mrb_state
*mrb,
mrb_value
str,
const
char
*
ptr
,
size_t
len
);
48
49
char
*
mrb_string_value_cstr
(
mrb_state
*mrb,
mrb_value
*
ptr
);
50
char
*
mrb_string_value_ptr
(
mrb_state
*mrb,
mrb_value
ptr
);
51
int
mrb_str_offset
(
mrb_state
*mrb,
mrb_value
str,
int
pos);
52
mrb_value
mrb_str_dup
(
mrb_state
*mrb,
mrb_value
str);
53
mrb_value
mrb_str_intern
(
mrb_state
*mrb,
mrb_value
self
);
54
mrb_value
mrb_str_cat_cstr
(
mrb_state
*,
mrb_value
,
const
char
*);
55
mrb_value
mrb_str_to_inum
(
mrb_state
*mrb,
mrb_value
str,
int
base,
int
badcheck);
56
double
mrb_str_to_dbl
(
mrb_state
*mrb,
mrb_value
str,
int
badcheck);
57
mrb_value
mrb_str_to_str
(
mrb_state
*mrb,
mrb_value
str);
58
mrb_int
mrb_str_hash
(
mrb_state
*mrb,
mrb_value
str);
59
mrb_value
mrb_str_buf_append
(
mrb_state
*mrb,
mrb_value
str,
mrb_value
str2);
60
mrb_value
mrb_str_inspect
(
mrb_state
*mrb,
mrb_value
str);
61
mrb_bool
mrb_str_equal
(
mrb_state
*mrb,
mrb_value
str1,
mrb_value
str2);
62
mrb_value
mrb_str_dump
(
mrb_state
*mrb,
mrb_value
str);
63
mrb_value
mrb_str_cat
(
mrb_state
*mrb,
mrb_value
str,
const
char
*
ptr
,
size_t
len
);
64
mrb_value
mrb_str_append
(
mrb_state
*mrb,
mrb_value
str,
mrb_value
str2);
65
66
int
mrb_str_cmp
(
mrb_state
*mrb,
mrb_value
str1,
mrb_value
str2);
67
char
*
mrb_str_to_cstr
(
mrb_state
*mrb,
mrb_value
str);
68
69
/* For backward compatibility */
70
static
inline
mrb_value
71
mrb_str_cat2(
mrb_state
*mrb,
mrb_value
str,
const
char
*
ptr
) {
72
return
mrb_str_cat_cstr
(mrb, str, ptr);
73
}
74
75
#if defined(__cplusplus)
76
}
/* extern "C" { */
77
#endif
78
79
#endif
/* MRUBY_STRING_H */
Generated on Sun Nov 10 2013 09:49:05 for Groonga 3.0.9 Source Code Document by
1.8.1.2