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
36fabe10
Commit
36fabe10
authored
Dec 01, 2015
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new API function mrb_string_value_len()
parent
0701236d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
include/mruby/string.h
include/mruby/string.h
+2
-1
src/string.c
src/string.c
+7
-0
No files found.
include/mruby/string.h
View file @
36fabe10
...
...
@@ -123,7 +123,8 @@ MRB_API mrb_value mrb_check_string_type(mrb_state *mrb, mrb_value str);
MRB_API
mrb_value
mrb_str_buf_new
(
mrb_state
*
mrb
,
size_t
capa
);
MRB_API
const
char
*
mrb_string_value_cstr
(
mrb_state
*
mrb
,
mrb_value
*
ptr
);
MRB_API
const
char
*
mrb_string_value_ptr
(
mrb_state
*
mrb
,
mrb_value
ptr
);
MRB_API
const
char
*
mrb_string_value_ptr
(
mrb_state
*
mrb
,
mrb_value
str
);
MRB_API
mrb_int
mrb_string_value_len
(
mrb_state
*
mrb
,
mrb_value
str
);
/*
* Duplicates a string object.
...
...
src/string.c
View file @
36fabe10
...
...
@@ -1013,6 +1013,13 @@ mrb_string_value_ptr(mrb_state *mrb, mrb_value ptr)
return
RSTRING_PTR
(
str
);
}
MRB_API
mrb_int
mrb_string_value_len
(
mrb_state
*
mrb
,
mrb_value
ptr
)
{
mrb_value
str
=
mrb_str_to_str
(
mrb
,
ptr
);
return
RSTRING_LEN
(
str
);
}
void
mrb_noregexp
(
mrb_state
*
mrb
,
mrb_value
self
)
{
...
...
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