2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 2002--2010 Han-Wen Nienhuys <hanwen@xs4all.nl>
6 LilyPond is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 LilyPond is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
20 #include "identifier-smob.hh"
22 scm_t_bits package_tag
;
25 print_box (SCM b
, SCM port
, scm_print_state
*)
27 SCM value
= SCM_CELL_OBJECT_1 (b
);
29 scm_puts ("#<packaged object ", port
);
30 scm_write (value
, port
);
33 /* Non-zero means success. */
37 /* This defines the primitve `make-box', which returns a new smob of
38 type `box', initialized to `#f'. */
39 LY_DEFINE (ly_export
, "ly:export",
41 "Export a Scheme object to the parser"
42 " so it is treated as an identifier.")
44 SCM_RETURN_NEWSMOB (package_tag
, arg
);
48 unpack_identifier (SCM box
)
50 if (SCM_IMP (box
) || SCM_CELL_TYPE (box
) != package_tag
)
53 return SCM_CELL_OBJECT_1 (box
);
59 package_tag
= scm_make_smob_type ("box", 0);
60 scm_set_smob_mark (package_tag
, scm_markcdr
);
61 scm_set_smob_print (package_tag
, print_box
);
64 ADD_SCM_INIT_FUNC (package
, init_box_type
);