void beginHeaderLine(char* type) { char *tag = (char*) malloc (20*sizeof(char)) ; sprintf(tag, "<h3><u>%s:</u>", type) ; tailInsertLinkedList(header, tag) ; pushLinkedList(closeTags, closeH3) ; }
void beginTitleHtml() { fprintf(tempFile, "<h%d>", titleLevel) ; switch (titleLevel) { case 1 : { sect++ ; subSect = 0 ; subSubSect = 0 ; fprintf(tempFile, "<a id=\"section_%d\">", sect) ; break ;} case 2 : { subSect ++ ; subSubSect = 0 ; fprintf(tempFile, "<a id=\"section_%d_%d\">", sect, subSect) ; break ;} case 3 : { subSubSect ++ ; fprintf(tempFile, "<a id=\"section_%d_%d_%d\">", sect, subSect, subSubSect) ; break ;} default : ; } char *closeTitle = (char*)malloc(6); // o free nunca é feito sprintf(closeTitle, "</h%d>", titleLevel) ; pushLinkedList(closeTags, closeTitle) ; pushLinkedList(closeTags, closeLink) ; }
void beginDictionaryTitleHtml() { fprintf(tempFile, "<dt>") ; pushLinkedList(closeTags, closeDt) ; }
void beginItemHtml() { fprintf(tempFile, "<li>") ; pushLinkedList(closeTags, closeLi) ; }
void beginDictionaryHtml() { fprintf(tempFile, "<dl>") ; pushLinkedList(closeTags, closeDl) ; }
void beginUnorderListHtml() { fprintf(tempFile, "<ul>") ; pushLinkedList(closeTags, closeUl) ; }
void beginOrderListHtml() { fprintf(tempFile, "<ol>") ; pushLinkedList(closeTags, closeOl) ; }
void beginLinkHtml() { fprintf(tempFile, "<a href=\"") ; pushLinkedList(closeTags, closeLink) ; }
void beginItalicHtml() { fprintf(tempFile, "<i>") ; pushLinkedList(closeTags, closeI) ; }
void beginHeaderUnderlineHtml() { tailInsertLinkedList(header, openU) ; pushLinkedList(closeTags, closeU) ; }
void beginBoldHtml() { fprintf(tempFile, "<b>") ; pushLinkedList(closeTags, closeB) ; }
void beginHeaderItalicHtml() { tailInsertLinkedList(header, openI) ; pushLinkedList(closeTags, closeI) ; }
void beginHeaderBoldHtml() { tailInsertLinkedList(header, openB) ; pushLinkedList(closeTags, closeB) ; }
void beginDictionaryItemHtml() { fprintf(tempFile, "<dd>") ; pushLinkedList(closeTags, closeDd) ; }
void beginUnderlineHtml() { fprintf(tempFile, "<u>") ; pushLinkedList(closeTags, closeU) ; }
void insereDistrito(LinkedList ll, Distrito d) { pushLinkedList(ll, d); printf("Inseri %s\n", d->nome); }
void beginCaptionHtml() { fprintf(tempFile, "' alt='Image %d' />\n", nImg) ; fprintf(tempFile, "<figcaption>") ; pushLinkedList(closeTags, closeFigure) ; }