-/*-----------------------------------------.
-| Set the TYPE_NAME associated to SYMBOL. |
-`-----------------------------------------*/
+/*-----------------------------------------------------------------.
+| Set the TYPE_NAME associated with SYM. Does nothing if passed 0 |
+| as TYPE_NAME. |
+`-----------------------------------------------------------------*/
+
+void
+symbol_type_set (symbol *sym, uniqstr type_name, location loc)
+{
+ if (type_name)
+ {
+ if (sym->type_name)
+ complain_at (loc, _("type redeclaration for %s"), sym->tag);
+ uniqstr_assert (type_name);
+ sym->type_name = type_name;
+ }
+}
+
+
+/*------------------------------------------------------------------.
+| Set the DESTRUCTOR associated with SYM. Do nothing if passed 0. |
+`------------------------------------------------------------------*/
+
+void
+symbol_destructor_set (symbol *sym, char *destructor, location loc)
+{
+ if (destructor)
+ {
+ if (sym->destructor)
+ complain_at (loc, _("%s redeclaration for %s"),
+ "%destructor", sym->tag);
+ sym->destructor = destructor;
+ sym->destructor_location = loc;
+ }
+}
+
+
+/*---------------------------------------------------------------.
+| Set the PRINTER associated with SYM. Do nothing if passed 0. |
+`---------------------------------------------------------------*/