Ejemplo n.º 1
0
/* this will allocate node, initialize all members, and node
   append to the list, possibly modifying head and modifying tail */
PRIVATE void append_open_tag ARGS4(
	    char*,	  tagname,
	    char*,	  classname GCC_UNUSED,
	    HT_tagspec**, head,
	    HT_tagspec**, tail)
{
    HT_tagspec* subj;
    HTTag* tag;
#ifdef USE_COLOR_STYLE
    int hcode;
#endif

    append_close_tag(tagname, head, tail); /* initialize common members*/
    subj = *tail;
    subj->start = TRUE;

    tag = HTML_dtd.tags + subj->element;

#ifdef USE_COLOR_STYLE
    hcode = hash_code_lowercase_on_fly(tagname);
    if (classname && *classname) {

#  if 0
	/*
	 * we don't provide a classname as attribute of that tag, since for plain
	 * formatting tags they are not used directly for anything except style -
	 * and we provide style value directly.
	 */
	int class_attr_idx = 0;
	int n = tag->number_of_attributes;
	attr* attrs = tag->attributes;
	 /*.... */ /* this is not implemented though it's easy */
#  endif

	hcode = hash_code_aggregate_char('.', hcode);
	hcode = hash_code_aggregate_lower_str(classname, hcode);
	StrAllocCopy(subj->class_name, classname);
    } else {
	StrAllocCopy(subj->class_name,"");
    }
    subj->style = hcode;
#endif
}
Ejemplo n.º 2
0
void append_open_tag( char *tagname, char *classname, HT_tagspec **head, HT_tagspec **tail )
{
    HT_tagspec *subj;
    HTTag *tag;
    static int hcode;
    append_close_tag( tagname, head, tail );
    subj = tail[0];
    subj->start = 1;
    tag = &tags[ subj->element ];
    hcode = hash_code_lowercase_on_fly( tagname );
    if ( classname && classname[0] )
    {
        hcode = hash_code_aggregate_char( '.', hcode );
        hcode = hash_code_aggregate_lower_str( classname, hcode );
        HTSACopy( &subj->class_name, classname );
    }
    else
    {
        HTSACopy( &subj->class_name, "" );
    }
    subj->style = hcode;
    return;
}