2 input-smob.cc -- implement Input smob
4 source file of the GNU LilyPond music typesetter
6 (c) 2000--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include "input-smob.hh"
14 #include "ly-smobs.icc"
16 /* Dummy input location for use if real one is missing. */
17 Input dummy_input_global;
19 static long input_tag;
28 print_smob (SCM s, SCM port, scm_print_state *)
30 String str = "#<location " + unsmob_input (s)->location_string () + ">";
31 scm_puts (str.to_str0 (), port);
38 delete unsmob_input (s);
46 input_tag = scm_make_smob_type ("input", 0);
47 scm_set_smob_mark (input_tag, mark_smob);
48 scm_set_smob_free (input_tag, free_smob);
49 scm_set_smob_print (input_tag, print_smob);
50 scm_set_smob_equalp (input_tag, 0);
56 Input *nip = new Input (ip);
59 SCM_NEWSMOB (z, input_tag, nip);
68 if (SCM_CAR (s) == (SCM)input_tag) // ugh.
69 return (Input*) SCM_CDR (s);
75 ADD_SCM_INIT_FUNC (input, start_input_smobs);