1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

(scm_string_p, scm_make_string, scm_read_only_string_p, scm_string_length)

(scm_string_ref, scm_string_set_x, scm_substring, scm_string_append):
Added texinfo markup.
This commit is contained in:
Martin Grabmüller 2001-02-17 11:27:41 +00:00
parent 16bad70540
commit 0d26a824c7

View file

@ -58,8 +58,9 @@
*/ */
SCM_DEFINE (scm_string_p, "string?", 1, 0, 0, SCM_DEFINE (scm_string_p, "string?", 1, 0, 0,
(SCM obj), (SCM obj),
"Returns #t iff OBJ is a string, else returns #f.") "Returns @code{#t} iff @var{obj} is a string, else returns\n"
"@code{#f}.")
#define FUNC_NAME s_scm_string_p #define FUNC_NAME s_scm_string_p
{ {
return SCM_BOOL (SCM_STRINGP (obj)); return SCM_BOOL (SCM_STRINGP (obj));
@ -73,8 +74,8 @@ SCM_DEFINE (scm_string_p, "string?", 1, 0, 0,
*/ */
SCM_DEFINE (scm_read_only_string_p, "read-only-string?", 1, 0, 0, SCM_DEFINE (scm_read_only_string_p, "read-only-string?", 1, 0, 0,
(SCM x), (SCM obj),
"Return true if OBJ can be read as a string,\n\n" "Return true if @var{obj} can be read as a string,\n\n"
"This illustrates the difference between @code{string?} and\n" "This illustrates the difference between @code{string?} and\n"
"@code{read-only-string?}:\n\n" "@code{read-only-string?}:\n\n"
"@example\n" "@example\n"
@ -85,7 +86,7 @@ SCM_DEFINE (scm_read_only_string_p, "read-only-string?", 1, 0, 0,
"@end example") "@end example")
#define FUNC_NAME s_scm_read_only_string_p #define FUNC_NAME s_scm_read_only_string_p
{ {
return SCM_BOOL(SCM_ROSTRINGP (x)); return SCM_BOOL(SCM_ROSTRINGP (obj));
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -96,7 +97,8 @@ SCM_REGISTER_PROC (s_scm_list_to_string, "list->string", 1, 0, 0, scm_string);
SCM_DEFINE (scm_string, "string", 0, 0, 1, SCM_DEFINE (scm_string, "string", 0, 0, 1,
(SCM chrs), (SCM chrs),
"@deffnx primitive list->string chrs\n" "@deffnx primitive list->string chrs\n"
"Returns a newly allocated string composed of the arguments, CHRS.") "Returns a newly allocated string composed of the arguments,\n"
"@var{chrs}.")
#define FUNC_NAME s_scm_string #define FUNC_NAME s_scm_string
{ {
SCM result; SCM result;
@ -223,10 +225,10 @@ scm_makfrom0str_opt (const char *src)
SCM_DEFINE (scm_make_string, "make-string", 1, 1, 0, SCM_DEFINE (scm_make_string, "make-string", 1, 1, 0,
(SCM k, SCM chr), (SCM k, SCM chr),
"Returns a newly allocated string of\n" "Return a newly allocated string of\n"
"length K. If CHR is given, then all elements of the string\n" "length @var{k}. If @var{chr} is given, then all elements of\n"
"are initialized to CHR, otherwise the contents of the\n" "the string are initialized to @var{chr}, otherwise the contents\n"
"STRING are unspecified.\n") "of the @var{string} are unspecified.\n")
#define FUNC_NAME s_scm_make_string #define FUNC_NAME s_scm_make_string
{ {
if (SCM_INUMP (k)) if (SCM_INUMP (k))
@ -258,8 +260,8 @@ SCM_DEFINE (scm_make_string, "make-string", 1, 1, 0,
SCM_DEFINE (scm_string_length, "string-length", 1, 0, 0, SCM_DEFINE (scm_string_length, "string-length", 1, 0, 0,
(SCM string), (SCM string),
"Returns the number of characters in STRING") "Return the number of characters in @var{string}.")
#define FUNC_NAME s_scm_string_length #define FUNC_NAME s_scm_string_length
{ {
SCM_VALIDATE_STRING (1, string); SCM_VALIDATE_STRING (1, string);
@ -269,8 +271,8 @@ SCM_DEFINE (scm_string_length, "string-length", 1, 0, 0,
SCM_DEFINE (scm_string_ref, "string-ref", 2, 0, 0, SCM_DEFINE (scm_string_ref, "string-ref", 2, 0, 0,
(SCM str, SCM k), (SCM str, SCM k),
"Returns character K of STR using zero-origin indexing.\n" "Return character @var{k} of @var{str} using zero-origin\n"
"K must be a valid index of STR.") "indexing. @var{k} must be a valid index of @var{str}.")
#define FUNC_NAME s_scm_string_ref #define FUNC_NAME s_scm_string_ref
{ {
int idx; int idx;
@ -285,8 +287,9 @@ SCM_DEFINE (scm_string_ref, "string-ref", 2, 0, 0,
SCM_DEFINE (scm_string_set_x, "string-set!", 3, 0, 0, SCM_DEFINE (scm_string_set_x, "string-set!", 3, 0, 0,
(SCM str, SCM k, SCM chr), (SCM str, SCM k, SCM chr),
"Stores CHR in element K of STRING and returns an unspecified value.\n" "Store @var{chr} in element @var{k} of @var{str} and return\n"
"K must be a valid index of STR.") "an unspecified value. @var{k} must be a valid index of\n"
"@var{str}.")
#define FUNC_NAME s_scm_string_set_x #define FUNC_NAME s_scm_string_set_x
{ {
#if (SCM_DEBUG_DEPRECATED == 0) #if (SCM_DEBUG_DEPRECATED == 0)
@ -303,12 +306,13 @@ SCM_DEFINE (scm_string_set_x, "string-set!", 3, 0, 0,
SCM_DEFINE (scm_substring, "substring", 2, 1, 0, SCM_DEFINE (scm_substring, "substring", 2, 1, 0,
(SCM str, SCM start, SCM end), (SCM str, SCM start, SCM end),
"Returns a newly allocated string formed from the characters\n" "Return a newly allocated string formed from the characters\n"
"of STR beginning with index START (inclusive) and ending with\n" "of @var{str} beginning with index @var{start} (inclusive) and\n"
"index END (exclusive).\n" "ending with index @var{end} (exclusive).\n"
"STR must be a string, START and END must be exact integers satisfying:\n\n" "@var{str} must be a string, @var{start} and @var{end} must be\n"
"0 <= START <= END <= (string-length STR).") "exact integers satisfying:\n\n"
"0 <= @var{start} <= @var{end} <= (string-length @var{str}).")
#define FUNC_NAME s_scm_substring #define FUNC_NAME s_scm_substring
{ {
long int from; long int from;
@ -330,8 +334,8 @@ SCM_DEFINE (scm_substring, "substring", 2, 1, 0,
SCM_DEFINE (scm_string_append, "string-append", 0, 0, 1, SCM_DEFINE (scm_string_append, "string-append", 0, 0, 1,
(SCM args), (SCM args),
"Returns a newly allocated string whose characters form the\n" "Return a newly allocated string whose characters form the\n"
"concatenation of the given strings, ARGS.") "concatenation of the given strings, @var{args}.")
#define FUNC_NAME s_scm_string_append #define FUNC_NAME s_scm_string_append
{ {
SCM res; SCM res;