summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authorsonots <sonots@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-21 10:33:25 +0000
committersonots <sonots@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-21 10:33:25 +0000
commitec30bc5930d94ca86b9a85a127663ea162d4373f (patch)
tree37ff31304386bf9bb4fa15fd966260f0b9ddbec1 /string.c
parente2a92c54e68f73c1774fd792143b748f6cc4d222 (diff)
* string.c (deleted_prefix_length, deleted_suffix_length):
Add doxygen comment. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/string.c b/string.c
index bea38df4bc..604304fda2 100644
--- a/string.c
+++ b/string.c
@@ -8293,6 +8293,11 @@ chompped_length(VALUE str, VALUE rs)
return len;
}
+/*!
+ * Returns the seperator for arguments of rb_str_chomp.
+ *
+ * @return returns rb_ps ($/) as default, the default value of rb_ps ($/) is "\n".
+ */
static VALUE
chomp_rs(int argc, const VALUE *argv)
{
@@ -9273,6 +9278,15 @@ rb_str_end_with(int argc, VALUE *argv, VALUE str)
return Qfalse;
}
+/*!
+ * Returns the length of the <i>prefix</i> to be deleted in the given <i>str</i>,
+ * returning 0 if <i>str</i> does not start with the <i>prefix</i>.
+ *
+ * @param str the target
+ * @param prefix the prefix
+ * @retval 0 if the given <i>str</i> does not start with the given <i>prefix</i>
+ * @retval Positive-Integer otherwise
+ */
static long
deleted_prefix_length(VALUE str, VALUE prefix)
{
@@ -9339,6 +9353,15 @@ rb_str_delete_prefix(VALUE str, VALUE prefix)
return rb_str_subseq(str, prefixlen, RSTRING_LEN(str) - prefixlen);
}
+/*!
+ * Returns the length of the <i>suffix</i> to be deleted in the given <i>str</i>,
+ * returning 0 if <i>str</i> does not end with the <i>suffix</i>.
+ *
+ * @param str the target
+ * @param suffix the suffix
+ * @retval 0 if the given <i>str</i> does not end with the given suffix</i>
+ * @retval Positive-Integer otherwise
+ */
static long
deleted_suffix_length(VALUE str, VALUE suffix)
{