Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
5077f9ec
Commit
5077f9ec
authored
Apr 29, 2013
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move mrb_shared_string definition to src/string.c
parent
5c68195c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
include/mruby/string.h
include/mruby/string.h
+2
-8
src/string.c
src/string.c
+6
-0
No files found.
include/mruby/string.h
View file @
5077f9ec
...
...
@@ -15,18 +15,12 @@ extern "C" {
extern
const
char
mrb_digitmap
[];
typedef
struct
mrb_shared_string
{
int
refcnt
;
char
*
ptr
;
mrb_int
len
;
}
mrb_shared_string
;
struct
RString
{
MRB_OBJECT_HEADER
;
mrb_int
len
;
union
{
mrb_int
capa
;
mrb_shared_string
*
shared
;
struct
mrb_shared_string
*
shared
;
}
aux
;
char
*
ptr
;
};
...
...
@@ -40,7 +34,7 @@ struct RString {
#define MRB_STR_SHARED 1
#define MRB_STR_STATIC (1<<1)
void
mrb_str_decref
(
mrb_state
*
,
mrb_shared_string
*
);
void
mrb_str_decref
(
mrb_state
*
,
struct
mrb_shared_string
*
);
void
mrb_str_modify
(
mrb_state
*
,
struct
RString
*
);
mrb_value
mrb_str_literal
(
mrb_state
*
,
mrb_value
);
void
mrb_str_concat
(
mrb_state
*
,
mrb_value
,
mrb_value
);
...
...
src/string.c
View file @
5077f9ec
...
...
@@ -23,6 +23,12 @@
const
char
mrb_digitmap
[]
=
"0123456789abcdefghijklmnopqrstuvwxyz"
;
typedef
struct
mrb_shared_string
{
int
refcnt
;
char
*
ptr
;
mrb_int
len
;
}
mrb_shared_string
;
static
mrb_value
str_replace
(
mrb_state
*
mrb
,
struct
RString
*
s1
,
struct
RString
*
s2
);
static
mrb_value
mrb_str_subseq
(
mrb_state
*
mrb
,
mrb_value
str
,
mrb_int
beg
,
mrb_int
len
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment