pike.git/
src/
builtin_functions.c
Branch:
Tag:
Non-build tags
All tags
No tags
2019-01-26
2019-01-26 14:06:52 by Henrik Grubbström (Grubba) <grubba@grubba.org>
1ec679e6fe28dcfb86de753d42f26d29989bd986 (
25
lines) (+
25
/-
0
)
[
Show
|
Annotate
]
Branch:
master
Documentation: Moved doc for {base,dir}name().
1683:
return -1; }
+
/*! @decl string dirname(string path)
+
*!
+
*! Returns all but the last segment of a path. Some example inputs and
+
*! outputs:
+
*!
+
*! @xml{<matrix>
+
*! <r><c><b>Expression</b></c><c><b>Value</b></c></r>
+
*! <r><c>dirname("/a/b")</c><c>"/a"</c></r>
+
*! <r><c>dirname("/a/")</c><c>"/a"</c></r>
+
*! <r><c>dirname("/a")</c><c>"/"</c></r>
+
*! <r><c>dirname("/")</c><c>"/"</c></r>
+
*! <r><c>dirname("")</c><c>""</c></r>
+
*! </matrix>@}
+
*!
+
*! @seealso
+
*! @[basename()], @[explode_path()]
+
*/
PMOD_EXPORT void f_dirname(INT32 args) { struct pike_string *s = NULL;
1708:
stack_pop_n_elems_keep_top(args); }
+
/*! @decl string basename(string path)
+
*!
+
*! Returns the last segment of a path.
+
*!
+
*! @seealso
+
*! @[dirname()], @[explode_path()]
+
*/
PMOD_EXPORT void f_basename(INT32 args) { struct pike_string *s = NULL;