• Patch: Elm ME+ 2.5 PLalpha62 -> Elm ME+ 2.5 PLalpha63 [6/7] (4/5)

    From Kari Hurtta@21:1/5 to All on Wed Jan 3 13:53:20 2024
    [continued from previous message]

    + found_xx->cmd_list_len > 0) {
    + int i;
    +
    + ret =
    + tagfilter_new_tag_state(found_xx->
    + cmd_list[found_xx->
    + cmd_list_len-1].cmd);
    +
    + if (TAGFILTER_TAG_STATE_magic != ret->magic)
    + mime_panic(__FILE__,__LINE__,"give_item_text_html",
    + "Bad magic number (tagfilter_tag_state)");
    +
    +
    + ret->u.html = tagfilter_new_html_state();
    +
    + if (TAGFILTER_HTML_STATE_magic != ret->u.html->magic)
    + mime_panic(__FILE__,__LINE__,"give_item_text_html",
    + "Bad magic number (tagfilter_selection)");
    +
    + ret->u.html->push_tag =
    + safe_calloc(found_xx->cmd_list_len,
    + sizeof (ret->u.html->push_tag[0]));
    +
    + for (i = 0; i < found_xx->cmd_list_len; i++) {
    + ret->u.html->push_tag[i] = found_xx->cmd_list[i];
    +
    + tagfilter_inc_cmd_refcount(ret->u.html->push_tag[i].cmd);
    + }
    + ret->u.html->push_tag_len = found_xx->cmd_list_len;
    + } else {
    + DPRINT(Debug,21,(&Debug,
    + "give_item_text_html: %S - not found with nested search - search list len %d\n",
    + tag_name,search_list_len));
    + }
    +
    + free_search_list(&search_list,&search_list_len);
    + }
    +
    + if (current_tag && !ret) {
    + int inherit_pg_flags = 0;
    + struct pager_range * prev_range =
    + give_prev_range(stack,
    + STACK_pos,
    + & inherit_pg_flags,
    + & text_visible);
    +
    +
    + ret = process_new_html_item(current_tag,prev_range,new_item,
    + state_out,counter,
    + tagfilter,used_tags,push_current,
    + used_tags,
    + inherit_pg_flags,
    + text_visible,
    + decode_opt);
    + }
    +
    + if (!current_tag && tag_name && !ret) {
    +
    + struct pager_range * prev_range UNUSED_VAROK =
    + give_prev_range(stack,
    + STACK_pos,
    + NULL,
    + & text_visible);
    +
    +
    + if (counter)
    + current_tag = tagfilter_give_unknown_tag(counter,tag_name,
    + tagfilter,
    + tfc_unsupported,
    + TAGFLT_CMD_inherit_nested_tags);
    +
    +
    + if (!current_tag)
    + current_tag = tagfilter_cmd_from_string(tag_name,
    + tfc_unsupported,
    + TAGFLT_CMD_inherit_nested_tags);
    +
    +
    + if (TAGFILTER_CMD_magic != current_tag->magic)
    + mime_panic(__FILE__,__LINE__,"give_item_text_html",
    + "Bad magic number (tagfilter_cmd)");
    +
    + if (new_item) {
    +
    + DPRINT(Debug,21,(&Debug,
    + "give_item_text_html: %S pg_flags %d %s\n",
    + tag_name,current_tag->pg_flags,
    + give_pg_flags(current_tag->pg_flags)));
    +
    + *new_item = tagfilter_new_stack_item(NULL,
    + current_tag->pg_flags,
    + ison(current_tag->cmd_mode,
    + TAGFLT_CMD_inherit_nested_tags) ?
    + tags /* Transparent content model */ :
    + NULL /* Use current_tag */,
    + current_tag);
    + }
    +
    + if (TAGFILTER_STACK_ITEM_magic != (*new_item)->magic)
    + mime_panic(__FILE__,__LINE__,"give_item_text_html",
    + "Bad magic number (tagfilter_stack_item)");
    +
    +
    + (*new_item)->text_visible = text_visible;
    + }
    +
    +
    + * stack_pos = STACK_pos;
    +
    + if (current_tag && !ret)
    + ret = tagfilter_new_tag_state(current_tag);
    +
    + if (new_item && *new_item && current_tag) {
    + if (TAGFILTER_STACK_ITEM_magic != (*new_item)->magic)
    + mime_panic(__FILE__,__LINE__,"give_item_text_html",
    + "Bad magic number ( tagfilter_stack_item)");
    + if (TAGFILTER_CMD_magic != current_tag->magic)
    + mime_panic(__FILE__,__LINE__,"give_item_text_html",
    + "Bad magic number (tagfilter_cmd)");
    +
    + (*new_item)->force_eoln =
    + ison(current_tag->cmd_mode,TAGFLT_CMD_force_newline);
    + }
    +
    +
    + if (current_tag)
    + tagfilter_release_cmd(& current_tag);
    +
    + return ret;
    +
    + }
    +
    + E_(locate_stack_item_f locate_item_text_html)
    + struct tagfilter_tag_state *
    + locate_item_text_html P_((struct string * tag_name,
    + struct tagfilter_stack_item **stack,
    + size_t stack_len,
    + size_t * index
    + /* or stack_len if not found */,
    + mime_t * body,
    + struct in_state * state_in,
    + struct out_state * state_out,
    + charset_t text_charset,
    + struct tagfilter_selection * tagfilter));
    + struct tagfilter_tag_state * locate_item_text_html(tag_name,
    + stack,stack_len,
    + index,body,
    + state_in,state_out,
    + text_charset,tagfilter)
    + struct string * tag_name;
    + struct tagfilter_stack_item **stack;
    + size_t stack_len;
    + size_t * index
    + /* or stack_len if not found */;
    + mime_t * body;
    + struct in_state * state_in;
    + struct out_state * state_out;
    + charset_t text_charset;
    + struct tagfilter_selection * tagfilter;
    + {
    + /* Allocates new tagfilter_tag_state
    + (also NULL return possible) */
    +
    + struct tagfilter_tag_state * ret = NULL;
    +
    + struct string_sort * tag_name_X = NULL; /* Possible lowercased
    + already
    + */
    +
    + if (TAGFILTER_SELECTION_magic != tagfilter->magic)
    + mime_panic(__FILE__,__LINE__,"locate_item_text_html",
    + "Bad magic number (tagfilter_selection)");
    +
    + ret = tagfilter_locate_stack_item(tagfilter,
    + &tag_name_X,
    + tag_name,
    + stack,stack_len,index);
    + if (ret) {
    + if (TAGFILTER_TAG_STATE_magic != ret->magic)
    + mime_panic(__FILE__,__LINE__,"locate_item_text_html",
    + "Bad magic number (tagfilter_tag_state)");
    +
    +
    + if (! ret->u.html)
    + ret->u.html = tagfilter_new_html_state();
    +
    + if (TAGFILTER_HTML_STATE_magic != ret->u.html->magic)
    + mime_panic(__FILE__,__LINE__,"locate_item_text_html",
    + "Bad magic number (tagfilter_selection)");
    + }
    +
    +
    + if (tag_name_X)
    + free_string_sort(& tag_name_X);
    +
    + return ret;
    + }
    +
    + E_(end_tag_state_f end_tag_text_html)
    + void end_tag_text_html P_((struct tagfilter_tag_state **tag_state,
    + mime_t * body,
    + struct in_state * state_in,
    + struct out_state * state_out,
    + charset_t text_charset,
    + struct tagfilter_selection * tagfilter));
    + void end_tag_text_html(tag_state,body,state_in,state_out,text_charset,tagfilter)
    + struct tagfilter_tag_state **tag_state;
    + mime_t * body;
    + struct in_state * state_in;
    + struct out_state * state_out;
    + charset_t text_charset;
    + struct tagfilter_selection * tagfilter;
    + {
    + if (TAGFILTER_SELECTION_magic != tagfilter->magic)
    + mime_panic(__FILE__,__LINE__,"end_tag_text_html",
    + "Bad magic number (tagfilter_selection)");
    +
    +
    + if (TAGFILTER_TAG_STATE_magic != (*tag_state)->magic)
    + mime_panic(__FILE__,__LINE__,"end_tag_text_html",
    + "Bad magic number (tagfilter_tag_state)");
    +
    + if ((*tag_state)->u.html)
    + tagfilter_free_html_state(& ((*tag_state)->u.html));
    +
    + tagfilter_free_tag_state_common (tag_state);
    + }
    +
    + E_(push_stack_item_f push_tag_text_html)
    + struct tagfilter_stack_item *
    + push_tag_text_html P_((struct tagfilter_tag_state *tag_state,
    + struct tagfilter_stack_item **stack,
    + size_t stack_len,
    + mime_t * body,
    + struct in_state * state_in,
    + struct out_state * state_out,
    + const struct decode_opts * decode_opt,
    + charset_t text_charset,
    + struct tagfilter_selection * tagfilter));
    + struct tagfilter_stack_item *push_tag_text_html(tag_state,stack,
    + stack_len,body,state_in,
    + state_out,decode_opt,text_charset,
    + tagfilter)
    + struct tagfilter_tag_state *tag_state;
    + struct tagfilter_stack_item **stack;
    + size_t stack_len;
    + mime_t * body;
    + struct in_state * state_in;
    + struct out_state * state_out;
    + const struct decode_opts * decode_opt;
    + charset_t text_charset;
    + struct tagfilter_selection * tagfilter;
    + {
    + struct tagfilter_stack_item *ret = NULL;
    +
    + if (TAGFILTER_SELECTION_magic != tagfilter->magic)
    + mime_panic(__FILE__,__LINE__,"push_tag_text_html",
    + "Bad magic number (tagfilter_selection)");
    +
    +
    + if (TAGFILTER_TAG_STATE_magic != tag_state->magic)
    + mime_panic(__FILE__,__LINE__,"push_tag_text_html",
    + "Bad magic number (tagfilter_tag_state)");
    +
    + if (tag_state->u.html) {
    + struct tagfilter_cmd *cmd = NULL;
    + struct tagfilter_tags * used_tags = NULL;
    + int is_last = 0;
    +
    + if (TAGFILTER_HTML_STATE_magic != tag_state->u.html->magic)
    + mime_panic(__FILE__,__LINE__,"push_tag_text_html",
    + "Bad magic number (tagfilter_selection)");
    +
    + if (tag_state->u.html->push_tag) {
    + int i,t = 0;
    +
    + /* This should select first comamnd, and
    + move others
    + */
    +
    + for (i = 0; i < tag_state->u.html->push_tag_len; i++) {
    +
    + if (tag_state->u.html->push_tag[i].cmd) {
    +
    + if (cmd) {
    +
    + if (t < i) {
    + if (tag_state->u.html->push_tag[t].cmd ||
    + tag_state->u.html->push_tag[t].used_tags)
    + mime_panic(__FILE__,__LINE__,
    + "push_tag_text_html",
    + "Target not empty");
    + else {
    + tag_state->u.html->push_tag[t++] =
    + tag_state->u.html->push_tag[i];
    +
    + tag_state->u.html->push_tag[i].cmd = NULL;
    + tag_state->u.html->push_tag[i].used_tags = NULL;
    + }
    + }
    +
    + is_last = 0;
    +
    + } else {
    + cmd = tag_state->u.html->push_tag[i].cmd;
    + used_tags = tag_state->u.html->push_tag[i].used_tags;
    +
    + tag_state->u.html->push_tag[i].cmd = NULL;
    + tag_state->u.html->push_tag[i].used_tags = NULL;
    +
    + is_last = 1;
    + }
    + }
    + }
    + tag_state->u.html->push_tag_len = t;
    +
    + if (0 == tag_state->u.html->push_tag_len) {
    + free(tag_state->u.html->push_tag);
    + tag_state->u.html->push_tag = NULL;
    + }
    + }
    +
    + if (cmd) {
    + int inherit_pg_flags = 0;
    + int text_visible = 1;
    + struct pager_range * prev_range =
    + give_prev_range (stack,stack_len,
    + & inherit_pg_flags,
    + & text_visible
    + );
    +
    + ret = process_new_html_item2(cmd,prev_range,
    + tag_state,
    + state_out,
    + tagfilter,
    + is_last,
    + used_tags,
    + inherit_pg_flags,
    + text_visible,
    + decode_opt);
    +
    + tagfilter_release_cmd(& cmd);
    + }
    +
    + }
    +
    + return ret;
    + }
    +
    + E_(close_stack_item_f close_tag_text_html)
    + int close_tag_text_html P_((struct tagfilter_tag_state *tag_state,
    + struct tagfilter_stack_item **stack,
    + size_t stack_len,
    + size_t idx,
    + enum stack_close_mode close_pos,
    + mime_t * body,
    + struct in_state * state_in,
    + struct out_state * state_out,
    + charset_t text_charset,
    + struct tagfilter_selection * tagfilter));
    + int close_tag_text_html(tag_state,stack,stack_len,idx,close_pos,
    + body,state_in,state_out,text_charset,
    + tagfilter)
    + struct tagfilter_tag_state *tag_state;
    + struct tagfilter_stack_item **stack;
    + size_t stack_len;
    + size_t idx;
    + enum stack_close_mode close_pos;
    + mime_t * body;
    + struct in_state * state_in;
    + struct out_state * state_out;
    + charset_t text_charset;
    + struct tagfilter_selection * tagfilter;
    + {
    + int ret = 1; /* Return 1 when item can be emoved from stack */
    + struct tagfilter_cmd * current_tag = NULL;
    +
    +
    + if (TAGFILTER_SELECTION_magic != tagfilter->magic)
    + mime_panic(__FILE__,__LINE__,"close_tag_text_html",
    + "Bad magic number (tagfilter_selection)");
    +
    + if (TAGFILTER_TAG_STATE_magic != tag_state->magic)
    + mime_panic(__FILE__,__LINE__,"close_tag_text_html",
    + "Bad magic number (tagfilter_tag_state)");
    +
    + if (! stack || idx >= stack_len || ! stack[idx])
    + mime_panic(__FILE__,__LINE__,"close_tag_text_html",
    + "Bad stack idx or stack item or no stack");
    +
    + if (TAGFILTER_STACK_ITEM_magic != stack[idx]->magic)
    + mime_panic(__FILE__,__LINE__,
    + "close_tag_text_html",
    + "Bad magic number (tagfilter_stack_item)");
    +
    + if (! stack[idx]->current_tag)
    + goto out;
    +
    + if (TAGFILTER_CMD_magic != stack[idx]->current_tag->magic)
    + mime_panic(__FILE__,__LINE__,"close_tag_text_html",
    + "Bad magic number (tagfilter_cmd)");
    +
    +
    + current_tag = stack[idx]->current_tag;
    +
    +
    + if (tag_state->u.html) {
    +
    + if (TAGFILTER_HTML_STATE_magic != tag_state->u.html->magic)
    + mime_panic(__FILE__,__LINE__,"close_tag_text_html",
    + "Bad magic number (tagfilter_selection)");
    +
    + switch (current_tag->code.html) {
    + case tfc_html_unsupported: /* Should not happen */
    + case tfc_html_none: break;
    +
    + case tfc_html_br: /* Nothing to do */ break;
    +
    + case tfc_html_hr:
    + case tfc_html_p:
    + state_putc('\n',state_out);
    +
    + /* tagfilter_handle_tag() will call set_out_state_line_mode() */
    + break;
    + case tfc_html_pre: break;
    + case tfc_html_q:
    + state_putc('"',state_out);
    + break;
    + case tfc_html_li:
    + state_putc('\n',state_out);
    +
    + /* tagfilter_handle_tag() will call set_out_state_line_mode() */
    + break;
    + }
    + }
    +
    + out:
    +
    + return ret;
    + }
    +
    + E_(start_attribute_f start_atr_text_html)
    + struct tagfilter_atr_state *
    + start_atr_text_html P_((struct string * atr_name,
    + struct tagfilter_tag_state * tag_state,
    + mime_t * body,
    + struct in_state * state_in,
    + struct out_state * state_out,
    + charset_t text_charset,
    + struct tagfilter_selection * tagfilter));
    + struct tagfilter_atr_state *start_atr_text_html(atr_name,tag_state,
    + body,state_in,
    + state_out,
    + text_charset,
    + tagfilter)
    + struct string * atr_name;
    + struct tagfilter_tag_state * tag_state;
    + mime_t * body;
    + struct in_state * state_in;
    + struct out_state * state_out;
    + charset_t text_charset;
    + struct tagfilter_selection * tagfilter;
    + {
    +
    + if (TAGFILTER_SELECTION_magic != tagfilter->magic)
    + mime_panic(__FILE__,__LINE__,"start_atr_text_html",
    + "Bad magic number (tagfilter_selection)");
    +
    + if (TAGFILTER_TAG_STATE_magic != tag_state->magic)
    + mime_panic(__FILE__,__LINE__,"start_atr_text_html",
    + "Bad magic number (tagfilter_tag_state)");
    +
    + /* XXX Need code for handle text/html attributes */
    +
    + return NULL;
    + }
    +
    +
    + E_(end_attribute_f end_atr_text_html)
    + void end_atr_text_html P_((struct tagfilter_atr_state **atr_state,
    + struct tagfilter_tag_state * tag_state,
    + mime_t * body,
    + struct in_state * state_in,
    + struct out_state * state_out,
    + charset_t text_charset,
    + struct tagfilter_selection * tagfilter));
    + void end_atr_text_html(atr_state,tag_state,body,state_in,state_out,
    + text_charset,tagfilter)
    + struct tagfilter_atr_state **atr_state;
    + struct tagfilter_tag_state * tag_state;
    + mime_t * body;
    + struct in_state * state_in;
    + struct out_state * state_out;
    + charset_t text_charset;
    + struct tagfilter_selection * tagfilter;
    + {
    +
    + if (TAGFILTER_SELECTION_magic != tagfilter->magic)
    + mime_panic(__FILE__,__LINE__,"end_atr_text_html",
    + "Bad magic number (tagfilter_selection)");
    +
    + if (TAGFILTER_TAG_STATE_magic != tag_state->magic)
    + mime_panic(__FILE__,__LINE__,"end_atr_text_html",
    + "Bad magic number (tagfilter_tag_state)");
    +
    + /* XXX Need code for handle text/html attributes */
    + }
    +
    + E_(start_end_atrvalue_f start_end_atrval_text_html)
    + void start_end_atrval_text_html
    + P_((struct tagfilter_atr_state * atr_state,
    + enum atrvalue_start_end start_end,
    + struct tagfilter_tag_state * tag_state,
    + mime_t * body,
    + struct in_state * state_in,
    + struct out_state * state_out,
    + charset_t text_charset,
    + struct tagfilter_selection * tagfilter));
    + void start_end_atrval_text_html(atr_state,start_end,tag_state,
    + body,state_in,state_out,
    + text_charset,tagfilter)
    + struct tagfilter_atr_state * atr_state;
    + enum atrvalue_start_end start_end;
    + struct tagfilter_tag_state * tag_state;
    + mime_t * body;
    + struct in_state * state_in;
    + struct out_state * state_out;
    + charset_t text_charset;
    + struct tagfilter_selection * tagfilter;
    + {
    +
    + if (TAGFILTER_SELECTION_magic != tagfilter->magic)
    + mime_panic(__FILE__,__LINE__,"start_end_atrval_text_html",
    + "Bad magic number (tagfilter_selection)");
    +
    + if (TAGFILTER_TAG_STATE_magic != tag_state->magic)
    + mime_panic(__FILE__,__LINE__,"start_end_atrval_text_html",
    + "Bad magic number (tagfilter_tag_state)");
    +
    + /* XXX Need code for handle text/html attributes */
    +
    + }
    +
    + E_(atrvalue_seg_string_f atrvalue_seg_str_text_html)
    + void atrvalue_seg_str_text_html
    + P_((struct tagfilter_atr_state * atr_state,
    + struct string * atr_value_segment,
    + struct tagfilter_tag_state * tag_state,
    + mime_t * body,
    + struct in_state * state_in,
    + struct out_state * state_out,
    + charset_t text_charset,
    + struct tagfilter_selection * tagfilter));
    + void atrvalue_seg_str_text_html(atr_state,atr_value_segment,
    + tag_state,body,state_in,
    + state_out,text_charset,tagfilter)
    + struct tagfilter_atr_state * atr_state;
    + struct string * atr_value_segment;
    + struct tagfilter_tag_state * tag_state;
    + mime_t * body;
    + struct in_state * state_in;
    + struct out_state * state_out;
    + charset_t text_charset;
    + struct tagfilter_selection * tagfilter;
    + {
    +
    + if (TAGFILTER_SELECTION_magic != tagfilter->magic)
    + mime_panic(__FILE__,__LINE__,"atrvalue_seg_str_text_html",
    + "Bad magic number (tagfilter_selection)");
    +
    + if (TAGFILTER_TAG_STATE_magic != tag_state->magic)
    + mime_panic(__FILE__,__LINE__,"atrvalue_seg_str_text_html",
    + "Bad magic number (tagfilter_tag_state)");
    +
    + /* XXX Need code for handle text/html attributes */
    +
    + }
    +
    + E_(atrvalue_seg_ent_f atrvalue_seg_ent_text_html)
    + void atrvalue_seg_ent_text_html
    + P_((struct tagfilter_atr_state * atr_state,
    + struct out_entity * atr_value_segment,
    + struct tagfilter_tag_state * tag_state,
    + mime_t * body,
    + struct in_state * state_in,
    + struct out_state * state_out,
    + charset_t text_charset,
    + struct tagfilter_selection * tagfilter));
    + void atrvalue_seg_ent_text_html(atr_state,atr_value_segment,
    + tag_state,body,state_in,state_out,
    + text_charset,tagfilter)
    + struct tagfilter_atr_state * atr_state;
    + struct out_entity * atr_value_segment;
    + struct tagfilter_tag_state * tag_state;
    + mime_t * body;
    + struct in_state * state_in;
    + struct out_state * state_out;
    + charset_t text_charset;
    + struct tagfilter_selection * tagfilter;
    + {
    +
    + if (TAGFILTER_SELECTION_magic != tagfilter->magic)
    + mime_panic(__FILE__,__LINE__,"atrvalue_seg_ent_text_html",
    + "Bad magic number (tagfilter_selection)");
    +
    + if (TAGFILTER_TAG_STATE_magic != tag_state->magic)
    + mime_panic(__FILE__,__LINE__,"atrvalue_seg_ent_text_html",
    + "Bad magic number (tagfilter_tag_state)");
    +
    + /* XXX Need code for handle text/html attributes */
    +
    + }
    +
    + E_(stack_item_clear_f stack_item_clear_text_html)
    + void stack_item_clear_text_html
    + P_((struct tagfilter_stack_item * item,
    + struct tagfilter_selection * tagfilter));
    + void stack_item_clear_text_html(item,tagfilter)
    + struct tagfilter_stack_item * item;
    + struct tagfilter_selection * tagfilter;
    + {
    + if (TAGFILTER_STACK_ITEM_magic != item->magic)
    + mime_panic(__FILE__,__LINE__,
    + "stack_item_clear_text_html",
    + "Bad magic number (tagfilter_stack_item)");
    +
    + if (TAGFILTER_SELECTION_magic != tagfilter->magic)
    + mime_panic(__FILE__,__LINE__,"stack_item_clear_text_html",
    + "Bad magic number (tagfilter_selection)");
    +
    + }
    +
    + /* tagfilter_cmd --------------------------------------- */
    +
    + /* Derement refcount -- free if not static */
    + void tagfilter_release_cmd(cmd)
    + struct tagfilter_cmd **cmd;
    + {
    + if (TAGFILTER_CMD_magic != (*cmd)->magic)
    + mime_panic(__FILE__,__LINE__,"tagfilter_release_cmd",
    + "Bad magic number (tagfilter_cmd)");
    +
    + if ((*cmd)->refcount < 1)
    + mime_panic(__FILE__,__LINE__,"tagfilter_release_cmd",
    + "Bad refcount");
    +
    + (*cmd)->refcount--;
    +
    + if ((*cmd)->refcount > 0) {
    + *cmd = NULL;
    + return;
    + }
    +
    + /* string_command is always dynamically allocated */
    +
    + if ((*cmd)->string_command)
    + free_string_sort(& ((*cmd)->string_command));
    +
    +
    + /* Rest may be static */
    +
    + if (ison((*cmd)->cmd_mode,TAGFLT_CMD_is_static)) {
    + *cmd = NULL;
    + return;
    + }
    +
    + if ((*cmd)->ascii_command) {
    + free((*cmd)->ascii_command);
    + (*cmd)->ascii_command = NULL;
    + }
    +
    + (*cmd)->nesting = NULL; /* static */
    +
    + (*cmd)->magic = 0;
    + free(*cmd);
    + *cmd = NULL;
    + }
    +
    + void tagfilter_inc_cmd_refcount(cmd)
    + struct tagfilter_cmd *cmd;
    + {
    + if (TAGFILTER_CMD_magic != cmd->magic)
    + mime_panic(__FILE__,__LINE__,"tagfilter_inc_cmd_refcount",
    + "Bad magic number (tagfilter_cmd)");
    + cmd->refcount++;
    + }
    +
    + void tagfilter_free_sorted_tags()
    + {
    + static struct tagfilter_tags * check_tags [] = {
    +
    + & text_enriched_tags,
    + & text_html_top,
    + & text_html_head_body,
    + & text_html_metadata,
    + & text_html_flow,
    + & text_html_phrasing,
    +
    + & text_html_close_head,
    + & text_html_noscript_head,
    + & text_html_datalist,
    + & text_html_details,
    + & text_html_dl,
    + & text_html_fieldset,
    + & text_html_figure,
    + & text_html_footer,
    + & text_html_form,
    + & text_html_hgroup,
    + & text_html_label,
    + & text_html_list_items,
    + & text_html_close_li,
    + & text_html_close_p,
    + & text_html_address,
    + & text_html_meter,
    + & text_html_picture,
    + & text_html_progress,
    + & text_html_ruby,
    + & text_html_table,
    + & text_html_div_dl,
    + & text_html_caption,
    + & text_html_colgroup,
    + & text_html_tr_list,
    + & text_html_tr,
    + & text_html_close_thead,
    + & text_html_close_tbody,
    + & text_html_close_tr,
    + & text_html_close_td,
    + & text_html_th,
    + & text_html_close_th,
    + & text_html_close_dtdd,
    + & text_html_close_rtrp
    + };
    + static size_t check_tags_count = (sizeof check_tags) / sizeof (check_tags [0]);
    +
    + size_t x;
    +
    + for (x = 0; x < check_tags_count; x++) {
    + if (check_tags[x]) {
    + if (TAGFILTER_TAGS_magic != check_tags[x]->magic)
    + mime_panic(__FILE__,__LINE__,"tagfilter_free_sorted_tags",
    + "Bad magic number (tagfilter_tags)");
    +
    + if (check_tags[x]->sorted_tags)
    + free_sort_list( &(check_tags[x]->sorted_tags));
    +
    + }
    + }
    +
    + }
    +
    +
    +
    + /*
    + * Local Variables:
    + * mode:c
    + * c-basic-offset:4
    + * buffer-file-coding-system: iso-8859-1
    + * End:
    + */
    +
    Index: elmME+.2.5.alpha63-cvs/nls/C/C/C/s_me.m
    *** elmME+.2.5.alpha62/nls/C/C/C/s_me.m Sun Dec 4 10:38:37 2022
    --- elmME+.2.5.alpha63-cvs/nls/C/C/C/s_me.m Wed Dec 13 18:55:32 2023 ***************
    *** 2050,2052 ****
    --- 2050,2121 ----
    1087 |Text format: %d lone CRs converted to newline.|
    $ #DecodeCRConverted
    1088 |Text format: %d lone CR converted to newline.|
    + $ #TagfEntitiesSavedIn
    + 1089 |Tagfilter entities saved in file %s.|
    + $ #EntityNotGiven
    + 1090 |%s: %d: Entity name not given: %S|
    + $ #EntityTypeNotGiven
    + 1091 |%s: %d: Entity type not given: %S|
    + $ #EntityValNotOK
    + 1092 |%s: %d: Entity value is not number or quoted string: %S|
    + $ #EntityValNotBackSlash
    + 1093 |%s: %d: Entity value does not allow backslash (\\): %S|
    + $ #EntityValNotQuoteEnd
    + 1094 |%s: %d: Entity value does not does not end with quote ("): %S|
    + $ #EntityValNotValidNumber
    + 1095 |%s: %d: Entity value is not valid number: %S|
    + $ #EntityValTooBig
    + 1096 |%s: %d: Entity value is too big: %S|
    + $ #EntityValTarilinData
    + 1097 |%s: %d: Entity value have trailing data: %S|
    + $ #EntityTypeNotSup
    + 1098 |%s: %d: E