+
+/********************************************************************/
+/* C_SUBM_COMM */
+/********************************************************************/
+
+int compat_check_subm_comm(const char* tag, const char* parent_tag,
+ struct safe_buffer* b)
+{
+ if (!strcmp(tag, "COMM") && !strcmp(parent_tag, "SUBM")) {
+ reset_buffer(b);
+ SAFE_BUF_ADDCHAR(b, '_');
+ safe_buf_append(b, tag);
+ gedcom_warning(_("Converting non-standard tag '%s' to user tag '%s'"),
+ tag, get_buf_string(b));
+ compat_state[C_SUBM_COMM] = 1;
+ return 1;
+ }
+ else
+ return 0;
+}
+
+void compat_close_subm_comm()
+{
+ compat_state[C_SUBM_COMM] = 0;
+}
+
+int compat_check_subm_comm_cont(const char* tag)
+{
+ if (compat_state[C_SUBM_COMM] && !strcmp(tag, "CONT")) {
+ compat_state[C_SUBM_COMM] = 2;
+ return 1;
+ }
+ else
+ return 0;
+}
+
+Gedcom_ctxt compat_subm_comm_cont_start(Gedcom_ctxt parent, const char* str)
+{
+ Gedcom_ctxt self = NULL;
+ struct tag_struct ts;
+
+ if (compat_state[C_SUBM_COMM] == 2) {
+ ts.string = "_CONT";
+ ts.value = USERTAG;
+ self = start_element(ELT_USER, parent, 2, ts, str, &val2);
+ }
+
+ return self;
+}
+
+void compat_subm_comm_cont_end(Gedcom_ctxt parent, Gedcom_ctxt self)
+{
+ if (compat_state[C_SUBM_COMM] == 2) {
+ end_element(ELT_USER, parent, self, NULL);
+ compat_state[C_SUBM_COMM] = 1;
+ }
+}