6 /* Copyright (C) 1995,1996,1998,2000,2001 Free Software Foundation, Inc.
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #include "libguile/__scm.h"
29 #define SCM_GSUBR_MAKTYPE(req, opt, rst) ((req)|((opt)<<4)|((rst)<<8))
30 #define SCM_GSUBR_REQ(x) ((long)(x)&0xf)
31 #define SCM_GSUBR_OPT(x) (((long)(x)&0xf0)>>4)
32 #define SCM_GSUBR_REST(x) ((long)(x)>>8)
34 #define SCM_GSUBR_MAX 10
35 #define SCM_GSUBR_TYPE(cclo) (SCM_CCLO_REF ((cclo), 1))
36 #define SCM_SET_GSUBR_TYPE(cclo, type) (SCM_CCLO_SET ((cclo), 1, (type)))
37 #define SCM_GSUBR_PROC(cclo) (SCM_CCLO_REF ((cclo), 2))
38 #define SCM_SET_GSUBR_PROC(cclo, proc) (SCM_CCLO_SET ((cclo), 2, (proc)))
40 SCM_API SCM scm_f_gsubr_apply
;
42 SCM_API SCM
scm_c_make_gsubr (const char *name
,
43 int req
, int opt
, int rst
, SCM (*fcn
) ());
44 SCM_API SCM
scm_c_make_gsubr_with_generic (const char *name
,
45 int req
, int opt
, int rst
,
46 SCM (*fcn
) (), SCM
*gf
);
47 SCM_API SCM
scm_c_define_gsubr (const char *name
,
48 int req
, int opt
, int rst
, SCM (*fcn
) ());
49 SCM_API SCM
scm_c_define_gsubr_with_generic (const char *name
,
50 int req
, int opt
, int rst
,
51 SCM (*fcn
) (), SCM
*gf
);
53 SCM_API SCM
scm_gsubr_apply (SCM args
);
54 SCM_API
void scm_init_gsubr (void);
56 #endif /* SCM_GSUBR_H */