+ Scheme_hash_table *dict = unsmob<Scheme_hash_table> (global_translator_dict);
+ if (!dict)
+ {
+ global_translator_dict = Scheme_hash_table::make_smob ();
+ global_translator_dict_rev =
+ scm_make_weak_key_hash_table (scm_from_int (119));
+ dict = unsmob<Scheme_hash_table> (global_translator_dict);
+ }
+ dict->set (name, creator);
+ scm_hashq_set_x (global_translator_dict_rev, creator, scm_cons (name, description));
+}
+
+LY_DEFINE (ly_translator_name, "ly:translator-name",
+ 1, 0, 0, (SCM creator),
+ "Return the type name of the translator definition @var{creator}."
+ " The name is a symbol.")
+{
+ SCM res = global_translator_dict_rev.is_bound ()
+ ? scm_hashq_ref (global_translator_dict_rev, creator, SCM_BOOL_F)
+ : SCM_BOOL_F;
+ SCM_ASSERT_TYPE (scm_is_pair (res),
+ creator, SCM_ARG1, __FUNCTION__, "translator definition");
+ return scm_car (res);
+}