~ubuntu-branches/ubuntu/precise/lilypond/precise

« back to all changes in this revision

Viewing changes to lily/identifier-smob.cc

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Bushnell, BSG
  • Date: 2006-12-19 10:18:12 UTC
  • mfrom: (3.1.4 feisty)
  • Revision ID: james.westby@ubuntu.com-20061219101812-7awtjkp0i393wxty
Tags: 2.8.7-3
scripts/midi2ly.py: When setting DATADIR, find Lilypond python files
in the @TOPLEVEL_VERSION@ directory, not 'current'.  Patch thanks to
Chris Lamb (chris@chris-lamb.co.uk).  (Closes: #400550)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*   
2
 
identifier-smob.cc -- implement glue to pass Scheme expressions off as
3
 
identifiers.
4
 
 
5
 
source file of the GNU LilyPond music typesetter
6
 
 
7
 
(c) 2002--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
8
 
 
 
1
/*
 
2
  identifier-smob.cc -- implement glue to pass Scheme expressions off as
 
3
  identifiers.
 
4
 
 
5
  source file of the GNU LilyPond music typesetter
 
6
 
 
7
  (c) 2002--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
9
8
*/
 
9
 
10
10
#include "identifier-smob.hh"
11
 
/*
12
 
  C&P from example/box.c
13
 
 */
14
11
 
15
12
scm_t_bits package_tag;
16
13
 
17
 
/* Print a textual represenation of the smob to a given port.  */
18
14
static int
19
15
print_box (SCM b, SCM port, scm_print_state *)
20
16
{
28
24
  return 1;
29
25
}
30
26
 
31
 
 
32
27
/* This defines the primitve `make-box', which returns a new smob of
33
28
   type `box', initialized to `#f'.  */
34
 
LY_DEFINE (package_identifier, "ly:export", 1, 0, 0, (SCM arg),
35
 
          "Export a Scheme object to the parser, so it is treated as an identifier.")
 
29
LY_DEFINE (ly_export, "ly:export",
 
30
           1, 0, 0, (SCM arg),
 
31
           "Export a Scheme object to the parser, "
 
32
           "so it is treated as an identifier.")
36
33
{
37
 
  /* This macro creates the new objects, stores the value `#f' into it
38
 
     and returns it to the caller.  */
39
34
  SCM_RETURN_NEWSMOB (package_tag, arg);
40
35
}
41
36
 
42
 
 
43
 
/* This is the primitive `box-ref' which returns the object stored in
44
 
   the box.  */
45
37
SCM
46
38
unpack_identifier (SCM box)
47
39
{
48
40
  if (SCM_IMP (box) || SCM_CELL_TYPE (box) != package_tag)
49
41
    return SCM_UNDEFINED;
50
 
  
 
42
 
51
43
  return SCM_CELL_OBJECT_1 (box);
52
44
}
53
45
 
58
50
  scm_set_smob_mark (package_tag, scm_markcdr);
59
51
  scm_set_smob_print (package_tag, print_box);
60
52
}
61
 
ADD_SCM_INIT_FUNC (package, init_box_type); 
 
53
 
 
54
ADD_SCM_INIT_FUNC (package, init_box_type);