X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fsmobs.cc;h=c700ea0d9b0f0a81d7e3f5d40774f5a85236b756;hb=97a0169312a260933246ab224e4f8b0969871dd5;hp=d1bea956d40375ac2fc8497c79355a0dd59bd899;hpb=c054eb280fd9953596eb164f67b0f9d5555c5a32;p=lilypond.git diff --git a/lily/smobs.cc b/lily/smobs.cc index d1bea956d4..c700ea0d9b 100644 --- a/lily/smobs.cc +++ b/lily/smobs.cc @@ -18,6 +18,13 @@ */ #include "smobs.hh" +#include "listener.hh" + +Listener +Smob_core::get_listener (SCM callback) +{ + return Listener (callback, self_scm ()); +} /* The CDR contains the actual protected list. @@ -46,7 +53,7 @@ protect_smob (SCM smob, SCM *prot_cons) { #if 0 SCM s = scm_cdr (smob_protection_list); - while (scm_is_pair (s) && scm_car (s) == SCM_BOOL_F) + while (scm_is_pair (s) && scm_is_false (scm_car (s)) { s = scm_cdr (s); } @@ -69,13 +76,13 @@ unprotect_smob (SCM smob, SCM *prot_cons) #else SCM next = scm_cdr (*prot_cons); - if (next == SCM_EOL) + if (scm_is_null (next))) scm_set_car_x (*prot_cons, SCM_BOOL_F); else { scm_set_car_x (*prot_cons, SCM_BOOL_F); while (scm_is_pair (next) - && scm_car (next) == SCM_BOOL_F) + && scm_is_false (scm_car (next))) next = scm_cdr (next); @@ -85,3 +92,13 @@ unprotect_smob (SCM smob, SCM *prot_cons) *prot_cons = SCM_EOL; #endif } + + +Scm_init const *Scm_init::list_ = 0; + +void +Scm_init::init () +{ + for (Scm_init const *p = list_; p; p = p->next_) + p->fun_ (); +}