HTStyle *HTStyleNewNamed( char *name ) { HTStyle *self = HTStyleNew( ); HTSACopy( &self->name, name ); self->id = -1; return self; }
/* Create a new style with a name */ HTStyle *HTStyleNewNamed(const char *name) { HTStyle *self = HTStyleNew(); StrAllocCopy(self->w_name, name); self->id = -1; /* <0 */ return self; }
PUBLIC HTStyleSheet * DefaultStyle ARGS1 (HTStyle ***, result_array) { HTStyle *p, *q; /* * The first time we're called, allocate a copy of the 'sheet' linked * list. Thereafter, simply copy the data from 'sheet' into our copy * (preserving the copy's linked-list pointers). We do this to reset the * parameters of a style that might be altered while processing a page. */ if (result == 0) { /* allocate & copy */ result = HTStyleSheetNew (); *result = sheet; result->styles = 0; #ifdef LY_FIND_LEAKS atexit(FreeDefaultStyle); #endif for (p = sheet.styles; p != 0; p = p->next) { q = HTStyleNew (); *q = *p; st_array[q->id] = q; q->next = result->styles; result->styles = q; } } else { /* recopy the data */ for (q = result->styles, p = sheet.styles; p != 0 && q != 0; p = p->next, q = q->next) { HTStyle *r = q->next; *q = *p; st_array[q->id] = q; q->next = r; } } *result_array = st_array; return result; }
/* Create a new style with a name */ PUBLIC HTStyle* HTStyleNewNamed ARGS1 (CONST char *,name) { HTStyle * self = HTStyleNew(); StrAllocCopy(self->name, name); return self; }