* libguile/ports.c (scm_port_free0): Remove.
(scm_make_port_type): Set `free' to NULL.
* libguile/smob.c (scm_make_smob_type): Leave `free' to NULL.
(scm_smob_free): Remove.
* libguile/smob.h (scm_smob_free): Remove.
* libguile/deprecated.c (scm_smob_free): New.
* libguile/deprecated.h (scm_smob_free): New declaration.
if (equalp) scm_set_smob_equalp (tc, equalp);
}
+size_t
+scm_smob_free (SCM obj)
+{
+ long n = SCM_SMOBNUM (obj);
+
+ scm_c_issue_deprecation_warning
+ ("`scm_smob_free' is deprecated. "
+ "It is no longer needed.");
+
+ if (scm_smobs[n].size > 0)
+ scm_gc_free ((void *) SCM_CELL_WORD_1 (obj),
+ scm_smobs[n].size, SCM_SMOBNAME (n));
+ return 0;
+}
+
SCM
scm_read_0str (char *expr)
{
int (*print) (SCM, SCM, scm_print_state*),
SCM (*equalp) (SCM, SCM));
+SCM_API size_t scm_smob_free (SCM obj);
+
SCM_API SCM scm_strprint_obj (SCM obj);
SCM_API SCM scm_read_0str (char *expr);
SCM_API SCM scm_eval_0str (const char *expr);
{
}
-static size_t
-scm_port_free0 (SCM port)
-{
- return 0;
-}
-
scm_t_bits
scm_make_port_type (char *name,
int (*fill_input) (SCM port),
scm_ptobs[scm_numptob].name = name;
scm_ptobs[scm_numptob].mark = 0;
- scm_ptobs[scm_numptob].free = scm_port_free0;
+ scm_ptobs[scm_numptob].free = NULL;
scm_ptobs[scm_numptob].print = scm_port_print;
scm_ptobs[scm_numptob].equalp = 0;
scm_ptobs[scm_numptob].close = 0;
return SCM_CELL_OBJECT_1 (ptr);
}
+\f
/* {Free}
*/
return 0;
}
-size_t
-scm_smob_free (SCM obj)
-{
- long n = SCM_SMOBNUM (obj);
- if (scm_smobs[n].size > 0)
- scm_gc_free ((void *) SCM_CELL_WORD_1 (obj),
- scm_smobs[n].size, SCM_SMOBNAME (n));
- return 0;
-}
-
+\f
/* {Print}
*/
scm_misc_error (FUNC_NAME, "maximum number of smobs exceeded", SCM_EOL);
scm_smobs[new_smob].name = name;
- if (size != 0)
- {
- scm_smobs[new_smob].size = size;
- scm_smobs[new_smob].free = scm_smob_free;
- }
+ scm_smobs[new_smob].size = size;
/* Make a class object if Goops is present. */
if (SCM_UNPACK (scm_smob_class[0]) != 0)
SCM_API SCM scm_mark0 (SCM ptr);
SCM_API SCM scm_markcdr (SCM ptr);
SCM_API size_t scm_free0 (SCM ptr);
-SCM_API size_t scm_smob_free (SCM obj);
SCM_API int scm_smob_print (SCM exp, SCM port, scm_print_state *pstate);
/* The following set of functions is the standard way to create new