mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
* eval.[ch] (scm_deval_args): Made static.
* srcprop.c (scm_source_property): Remove redundant SCM_IMP test. * strings.c (scm_c_string2str): Clarified comment. Replaced THINKME by FIXME for uniformness. Removed question about whether arguments need to be protected from garbage collection: Arguments must be protected as any other variable.
This commit is contained in:
parent
f9450cdb14
commit
2493378052
5 changed files with 26 additions and 10 deletions
|
@ -1,3 +1,15 @@
|
||||||
|
2002-01-10 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||||
|
|
||||||
|
* eval.[ch] (scm_deval_args): Made static.
|
||||||
|
|
||||||
|
* srcprop.c (scm_source_property): Remove redundant SCM_IMP
|
||||||
|
test.
|
||||||
|
|
||||||
|
* strings.c (scm_c_string2str): Clarified comment. Replaced
|
||||||
|
THINKME by FIXME for uniformness. Removed question about whether
|
||||||
|
arguments need to be protected from garbage collection: Arguments
|
||||||
|
must be protected as any other variable.
|
||||||
|
|
||||||
2002-01-10 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
2002-01-10 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||||
|
|
||||||
* procs.h (SCM_CLOSURE_BODY): New Macro.
|
* procs.h (SCM_CLOSURE_BODY): New Macro.
|
||||||
|
|
|
@ -1825,7 +1825,7 @@ SCM_DEFINE (scm_evaluator_traps, "evaluator-traps-interface", 0, 1, 0,
|
||||||
}
|
}
|
||||||
#undef FUNC_NAME
|
#undef FUNC_NAME
|
||||||
|
|
||||||
SCM
|
static SCM
|
||||||
scm_deval_args (SCM l, SCM env, SCM proc, SCM *lloc)
|
scm_deval_args (SCM l, SCM env, SCM proc, SCM *lloc)
|
||||||
{
|
{
|
||||||
SCM *results = lloc, res;
|
SCM *results = lloc, res;
|
||||||
|
|
|
@ -184,7 +184,6 @@ SCM_API SCM scm_unmemocopy (SCM form, SCM env);
|
||||||
SCM_API SCM scm_eval_car (SCM pair, SCM env);
|
SCM_API SCM scm_eval_car (SCM pair, SCM env);
|
||||||
SCM_API SCM scm_eval_body (SCM code, SCM env);
|
SCM_API SCM scm_eval_body (SCM code, SCM env);
|
||||||
SCM_API SCM scm_eval_args (SCM i, SCM env, SCM proc);
|
SCM_API SCM scm_eval_args (SCM i, SCM env, SCM proc);
|
||||||
SCM_API SCM scm_deval_args (SCM l, SCM env, SCM proc, SCM *lloc);
|
|
||||||
SCM_API SCM scm_m_quote (SCM xorig, SCM env);
|
SCM_API SCM scm_m_quote (SCM xorig, SCM env);
|
||||||
SCM_API SCM scm_m_begin (SCM xorig, SCM env);
|
SCM_API SCM scm_m_begin (SCM xorig, SCM env);
|
||||||
SCM_API SCM scm_m_if (SCM xorig, SCM env);
|
SCM_API SCM scm_m_if (SCM xorig, SCM env);
|
||||||
|
|
|
@ -222,7 +222,7 @@ SCM_DEFINE (scm_source_property, "source-property", 2, 0, 0,
|
||||||
SCM_WRONG_TYPE_ARG (1, obj);
|
SCM_WRONG_TYPE_ARG (1, obj);
|
||||||
#endif
|
#endif
|
||||||
p = scm_hashq_ref (scm_source_whash, obj, SCM_EOL);
|
p = scm_hashq_ref (scm_source_whash, obj, SCM_EOL);
|
||||||
if (SCM_IMP (p) || !SRCPROPSP (p))
|
if (!SRCPROPSP (p))
|
||||||
goto plist;
|
goto plist;
|
||||||
if (SCM_EQ_P (scm_sym_breakpoint, key)) p = SRCPROPBRK (p);
|
if (SCM_EQ_P (scm_sym_breakpoint, key)) p = SRCPROPBRK (p);
|
||||||
else if (SCM_EQ_P (scm_sym_line, key)) p = SCM_MAKINUM (SRCPROPLINE (p));
|
else if (SCM_EQ_P (scm_sym_line, key)) p = SCM_MAKINUM (SRCPROPLINE (p));
|
||||||
|
|
|
@ -336,6 +336,7 @@ SCM_DEFINE (scm_string_append, "string-append", 0, 0, 1,
|
||||||
}
|
}
|
||||||
#undef FUNC_NAME
|
#undef FUNC_NAME
|
||||||
|
|
||||||
|
|
||||||
/* Converts the given Scheme string OBJ into a C string, containing a copy
|
/* Converts the given Scheme string OBJ into a C string, containing a copy
|
||||||
of OBJ's content with a trailing null byte. If LENP is non-NULL, set
|
of OBJ's content with a trailing null byte. If LENP is non-NULL, set
|
||||||
*LENP to the string's length.
|
*LENP to the string's length.
|
||||||
|
@ -347,8 +348,8 @@ SCM_DEFINE (scm_string_append, "string-append", 0, 0, 1,
|
||||||
Note that Scheme strings may contain arbitrary data, including null
|
Note that Scheme strings may contain arbitrary data, including null
|
||||||
characters. This means that null termination is not a reliable way to
|
characters. This means that null termination is not a reliable way to
|
||||||
determine the length of the returned value. However, the function always
|
determine the length of the returned value. However, the function always
|
||||||
copies the complete contents of OBJ, and sets *LENP to the true length
|
copies the complete contents of OBJ, and sets *LENP to the length of the
|
||||||
of the string (if LENP is non-null). */
|
scheme string (if LENP is non-null). */
|
||||||
char *
|
char *
|
||||||
scm_c_string2str (SCM obj, char *str, size_t *lenp)
|
scm_c_string2str (SCM obj, char *str, size_t *lenp)
|
||||||
{
|
{
|
||||||
|
@ -357,22 +358,26 @@ scm_c_string2str (SCM obj, char *str, size_t *lenp)
|
||||||
SCM_ASSERT (SCM_STRINGP (obj), obj, SCM_ARG1, "scm_c_string2str");
|
SCM_ASSERT (SCM_STRINGP (obj), obj, SCM_ARG1, "scm_c_string2str");
|
||||||
len = SCM_STRING_LENGTH (obj);
|
len = SCM_STRING_LENGTH (obj);
|
||||||
|
|
||||||
/* THINKME: What malloc policy? */
|
|
||||||
if (str == NULL)
|
if (str == NULL)
|
||||||
|
{
|
||||||
|
/* FIXME: Should we use exported wrappers for malloc (and free), which
|
||||||
|
* allow windows DLLs to call the correct freeing function? */
|
||||||
str = (char *) malloc ((len + 1) * sizeof (char));
|
str = (char *) malloc ((len + 1) * sizeof (char));
|
||||||
if (str == NULL)
|
if (str == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
memcpy (str, SCM_STRING_CHARS (obj), len);
|
memcpy (str, SCM_STRING_CHARS (obj), len);
|
||||||
/* THINKME: Is this necessary for arguments? I do not think so... */
|
|
||||||
scm_remember_upto_here_1 (obj);
|
scm_remember_upto_here_1 (obj);
|
||||||
str[len] = '\0';
|
str[len] = '\0';
|
||||||
|
|
||||||
if (lenp != NULL)
|
if (lenp != NULL)
|
||||||
*lenp = len;
|
*lenp = len;
|
||||||
|
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
scm_init_strings ()
|
scm_init_strings ()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue