X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=inline;f=lily%2Fidentifier-smob.cc;h=cdfadd3dfc4c4930815eb359fafa129986cc707e;hb=a276a19dc6bd57832db3107f2f2cbb04cb4677b6;hp=f3881b48edba1e27e494f13f3cd0c4fda4417877;hpb=368c6346e0d46aed9931f43f662ff5207dd943d8;p=lilypond.git diff --git a/lily/identifier-smob.cc b/lily/identifier-smob.cc index f3881b48ed..cdfadd3dfc 100644 --- a/lily/identifier-smob.cc +++ b/lily/identifier-smob.cc @@ -1,22 +1,18 @@ -/* -identifier-smob.cc -- implement glue to pass Scheme expressions off as -identifiers. - -source file of the GNU LilyPond music typesetter +/* + identifier-smob.cc -- implement glue to pass Scheme expressions off as + identifiers. -(c) 2002 Han-Wen Nienhuys + source file of the GNU LilyPond music typesetter + (c) 2002--2007 Han-Wen Nienhuys */ + #include "identifier-smob.hh" -/* - C&P from example/box.c - */ scm_t_bits package_tag; -/* Print a textual represenation of the smob to a given port. */ static int -print_box (SCM b, SCM port, scm_print_state *pstate) +print_box (SCM b, SCM port, scm_print_state *) { SCM value = SCM_CELL_OBJECT_1 (b); @@ -28,26 +24,22 @@ print_box (SCM b, SCM port, scm_print_state *pstate) return 1; } - /* This defines the primitve `make-box', which returns a new smob of type `box', initialized to `#f'. */ -LY_DEFINE(package_identifier, "ly-export", 1,0,0, (SCM arg), - "Export a Scheme object to the parser, so it is treated as an identifier.") +LY_DEFINE (ly_export, "ly:export", + 1, 0, 0, (SCM arg), + "Export a Scheme object to the parser, " + "so it is treated as an identifier.") { - /* This macro creates the new objects, stores the value `#f' into it - and returns it to the caller. */ SCM_RETURN_NEWSMOB (package_tag, arg); } - -/* This is the primitive `box-ref' which returns the object stored in - the box. */ SCM -unpack_identifier(SCM box) +unpack_identifier (SCM box) { - if (SCM_IMP(box) || SCM_CELL_TYPE(box) != package_tag) + if (SCM_IMP (box) || SCM_CELL_TYPE (box) != package_tag) return SCM_UNDEFINED; - + return SCM_CELL_OBJECT_1 (box); } @@ -58,4 +50,5 @@ init_box_type (void) scm_set_smob_mark (package_tag, scm_markcdr); scm_set_smob_print (package_tag, print_box); } -ADD_SCM_INIT_FUNC(package, init_box_type); + +ADD_SCM_INIT_FUNC (package, init_box_type);