#define SCM_SMOB_APPLY3(SMOB,A1,A2,A3) \
SCM_SMOB_DESCRIPTOR (SMOB).apply (SMOB, A1, A2, A3)
-static SCM
-scm_smob_apply_0_000 (SCM smob)
-{
- return SCM_SMOB_APPLY0 (smob);
-}
-
static SCM
scm_smob_apply_0_010 (SCM smob)
{
scm_wrong_num_args (smob);
}
-static SCM
-scm_smob_apply_1_010 (SCM smob, SCM a1)
-{
- return SCM_SMOB_APPLY1 (smob, a1);
-}
-
static SCM
scm_smob_apply_1_020 (SCM smob, SCM a1)
{
scm_wrong_num_args (smob);
}
-static SCM
-scm_smob_apply_2_020 (SCM smob, SCM a1, SCM a2)
-{
- return SCM_SMOB_APPLY2 (smob, a1, a2);
-}
-
static SCM
scm_smob_apply_2_030 (SCM smob, SCM a1, SCM a2)
{
scm_smob_apply_2_001 (SCM smob, SCM a1, SCM a2)
{
return SCM_SMOB_APPLY1 (smob, SCM_LIST2 (a1, a2));
- }
+}
static SCM
scm_smob_apply_2_011 (SCM smob, SCM a1, SCM a2)
return scm_tc7_smob + (scm_numsmob - 1) * 256;
}
-long
-scm_make_smob_type_mfpe (char *name, scm_sizet size,
- SCM (*mark) (SCM),
- scm_sizet (*free) (SCM),
- int (*print) (SCM, SCM, scm_print_state *),
- SCM (*equalp) (SCM, SCM))
-{
- long answer = scm_make_smob_type (name, size);
- scm_set_smob_mfpe (answer, mark, free, print, equalp);
- return answer;
-}
-
void
scm_set_smob_mark (long tc, SCM (*mark) (SCM))
{
}
void
-scm_set_smob_apply (long tc, SCM (*apply) (), int req, int opt, int rst)
+scm_set_smob_apply (long tc, SCM (*apply) (),
+ unsigned int req, unsigned int opt, unsigned int rst)
{
SCM (*apply_0) (SCM);
SCM (*apply_1) (SCM, SCM);
SCM (*apply_3) (SCM, SCM, SCM, SCM);
int type = SCM_GSUBR_MAKTYPE (req, opt, rst);
- if (!(req >= 0 && opt >= 0 && (rst == 0 || rst == 1)
- && req + opt + rst <= 3))
+ if (rst > 1 || req + opt + rst > 3)
{
puts ("Unsupported smob application type");
abort ();
switch (type)
{
case SCM_GSUBR_MAKTYPE (0, 0, 0):
- apply_0 = scm_smob_apply_0_000; break;
+ apply_0 = apply; break;
case SCM_GSUBR_MAKTYPE (0, 1, 0):
apply_0 = scm_smob_apply_0_010; break;
case SCM_GSUBR_MAKTYPE (0, 2, 0):
{
case SCM_GSUBR_MAKTYPE (1, 0, 0):
case SCM_GSUBR_MAKTYPE (0, 1, 0):
- apply_1 = scm_smob_apply_1_010; break;
+ apply_1 = apply; break;
case SCM_GSUBR_MAKTYPE (1, 1, 0):
case SCM_GSUBR_MAKTYPE (0, 2, 0):
apply_1 = scm_smob_apply_1_020; break;
case SCM_GSUBR_MAKTYPE (2, 0, 0):
case SCM_GSUBR_MAKTYPE (1, 1, 0):
case SCM_GSUBR_MAKTYPE (0, 2, 0):
- apply_2 = scm_smob_apply_2_020; break;
+ apply_2 = apply; break;
case SCM_GSUBR_MAKTYPE (2, 1, 0):
case SCM_GSUBR_MAKTYPE (1, 2, 0):
case SCM_GSUBR_MAKTYPE (0, 3, 0):
scm_smobs[SCM_TC2SMOBNUM (tc)].gsubr_type = type;
}
-void
-scm_set_smob_mfpe (long tc,
- SCM (*mark) (SCM),
- scm_sizet (*free) (SCM),
- int (*print) (SCM, SCM, scm_print_state *),
- SCM (*equalp) (SCM, SCM))
-{
- if (mark) scm_set_smob_mark (tc, mark);
- if (free) scm_set_smob_free (tc, free);
- if (print) scm_set_smob_print (tc, print);
- if (equalp) scm_set_smob_equalp (tc, equalp);
-}
-
-
SCM
scm_make_smob (long tc)
{
}
\f
+/* {Deprecated stuff}
+ */
+
+#if (SCM_DEBUG_DEPRECATED == 0)
+
+long
+scm_make_smob_type_mfpe (char *name, scm_sizet size,
+ SCM (*mark) (SCM),
+ scm_sizet (*free) (SCM),
+ int (*print) (SCM, SCM, scm_print_state *),
+ SCM (*equalp) (SCM, SCM))
+{
+ long answer = scm_make_smob_type (name, size);
+ scm_set_smob_mfpe (answer, mark, free, print, equalp);
+ return answer;
+}
+
+void
+scm_set_smob_mfpe (long tc,
+ SCM (*mark) (SCM),
+ scm_sizet (*free) (SCM),
+ int (*print) (SCM, SCM, scm_print_state *),
+ SCM (*equalp) (SCM, SCM))
+{
+ if (mark) scm_set_smob_mark (tc, mark);
+ if (free) scm_set_smob_free (tc, free);
+ if (print) scm_set_smob_print (tc, print);
+ if (equalp) scm_set_smob_equalp (tc, equalp);
+}
+
+#endif /* SCM_DEBUG_DEPRECATED == 0 */
+
+\f
/* {Initialization for i/o types, float, bignum, the type of free cells}
*/
extern scm_sizet scm_smob_free (SCM obj);
extern int scm_smob_print (SCM exp, SCM port, scm_print_state *pstate);
-extern SCM scm_smob_apply_0 (SCM smob);
-extern SCM scm_smob_apply_1 (SCM smob, SCM a1);
-extern SCM scm_smob_apply_2 (SCM smob, SCM a1, SCM a2);
-extern SCM scm_smob_apply_3 (SCM smob, SCM a1, SCM a2, SCM rest);
-
/* The following set of functions is the standard way to create new
* SMOB types.
*
SCM,
scm_print_state*));
extern void scm_set_smob_equalp (long tc, SCM (*equalp) (SCM, SCM));
-extern void scm_set_smob_apply (long tc, SCM (*apply) (), int req, int opt, int rst);
+extern void scm_set_smob_apply (long tc, SCM (*apply) (),
+ unsigned int req,
+ unsigned int opt,
+ unsigned int rst);
+/* Function for creating smobs */
-/* Functions for registering multiple handler functions simultaneously.
- *
- * (There is a discussion among the developers whether or not these
- * should be deprecated in the future.)
- */
+extern SCM scm_make_smob (long tc);
+extern void scm_smob_prehistory (void);
+
+\f
+
+#if (SCM_DEBUG_DEPRECATED == 0)
extern long scm_make_smob_type_mfpe (char *name, scm_sizet size,
SCM (*mark) (SCM),
int (*print) (SCM, SCM, scm_print_state*),
SCM (*equalp) (SCM, SCM));
-/* Function for creating smobs */
-
-extern SCM scm_make_smob (long tc);
-extern void scm_smob_prehistory (void);
-
-\f
+#endif /* SCM_DEBUG_DEPRECATED == 0 */
#endif /* SMOBH */