void Animation::cutFrame() { // copy frame data into copy buffer copyFrame(); // always delete frame from all tracks deleteFrame(0,frame); }
void TFDisplay::updateFrames() { typedef std::vector<std::string> V_string; V_string frames; tf_->getFrameStrings( frames ); S_FrameInfo current_frames; { V_string::iterator it = frames.begin(); V_string::iterator end = frames.end(); for ( ; it != end; ++it ) { const std::string& frame = *it; if ( frame.empty() ) { continue; } FrameInfo* info = getFrameInfo( frame ); if (!info) { info = createFrame(frame); } else { updateFrame(info); } current_frames.insert( info ); } } { S_FrameInfo to_delete; M_FrameInfo::iterator frame_it = frames_.begin(); M_FrameInfo::iterator frame_end = frames_.end(); for ( ; frame_it != frame_end; ++frame_it ) { if ( current_frames.find( frame_it->second ) == current_frames.end() ) { to_delete.insert( frame_it->second ); } } S_FrameInfo::iterator delete_it = to_delete.begin(); S_FrameInfo::iterator delete_end = to_delete.end(); for ( ; delete_it != delete_end; ++delete_it ) { deleteFrame( *delete_it ); } } causeRender(); }
void MultisigDialog::on_addDestinationButton_clicked() { QFrame* destinationFrame = new QFrame(ui->destinationsScrollAreaContents); destinationFrame->setObjectName(QStringLiteral("destinationFrame")); destinationFrame->setFrameShape(QFrame::StyledPanel); destinationFrame->setFrameShadow(QFrame::Raised); QVBoxLayout* frameLayout = new QVBoxLayout(destinationFrame); frameLayout->setObjectName(QStringLiteral("destinationFrameLayout")); QHBoxLayout* destinationLayout = new QHBoxLayout(); destinationLayout->setSpacing(0); destinationLayout->setObjectName(QStringLiteral("destinationLayout")); QLabel* destinationAddressLabel = new QLabel(destinationFrame); destinationAddressLabel->setObjectName(QStringLiteral("destinationAddressLabel")); destinationLayout->addWidget(destinationAddressLabel); QValidatedLineEdit* destinationAddress = new QValidatedLineEdit(destinationFrame); destinationAddress->setObjectName(QStringLiteral("destinationAddress")); destinationLayout->addWidget(destinationAddress); QSpacerItem* horizontalSpacer = new QSpacerItem(10, 20, QSizePolicy::Fixed, QSizePolicy::Minimum); destinationLayout->addItem(horizontalSpacer); QLabel* destinationAmountLabel = new QLabel(destinationFrame); destinationAmountLabel->setObjectName(QStringLiteral("destinationAmountLabel")); destinationLayout->addWidget(destinationAmountLabel); BitcoinAmountField* destinationAmount = new BitcoinAmountField(destinationFrame); destinationAmount->setObjectName(QStringLiteral("destinationAmount")); destinationAddressLabel->setText(QApplication::translate("MultisigDialog", strprintf("%i. Address: ", ui->destinationsList->count()+1).c_str(), 0)); destinationAmountLabel->setText(QApplication::translate("MultisigDialog", "Amount: ", 0)); destinationLayout->addWidget(destinationAmount); QPushButton* destinationDeleteButton = new QPushButton(destinationFrame); destinationDeleteButton->setObjectName(QStringLiteral("destinationDeleteButton")); QIcon icon; icon.addFile(QStringLiteral(":/icons/remove"), QSize(), QIcon::Normal, QIcon::Off); destinationDeleteButton->setIcon(icon); destinationDeleteButton->setAutoDefault(false); connect(destinationDeleteButton, SIGNAL(clicked()), this, SLOT(deleteFrame())); destinationLayout->addWidget(destinationDeleteButton); frameLayout->addLayout(destinationLayout); ui->destinationsList->addWidget(destinationFrame); }
/** * @brief * * @param class_ptr * @param stkFrame_ptr * @param stkFrameTop_ptr */ void initializeClass(ClassFile *class_ptr, Frame *stkFrame_ptr, dataMSize_t *dmSize_ptr, ClassFile *classHeap_ptr){ u2 method_idx = seekMethodInClass( class_ptr, "<clinit>", "()V" ); method_info *method_ptr = &class_ptr->methods[method_idx]; //Quem cria deleta. createFrame(method_ptr, class_ptr, stkFrame_ptr, &dmSize_ptr->stkHeap_size);//Cria o frame para o método <clinit> da classe. u2 aux_idx = dmSize_ptr->stkHeap_size - 1; // o stkFrameTop_ptr na verdade é o stack frame size, que indica a qtd de frames na stkframe. //Teste Execute(stkFrame_ptr, classHeap_ptr, dmSize_ptr); //Deleta o frame. deleteFrame(&stkFrame_ptr[aux_idx], &dmSize_ptr->stkHeap_size); }
//************************************************************* //** This is the implementation of ~BufMgr //************************************************************ BufMgr::~BufMgr(){ flushAllPages(); int* z = new int[numbuf]; for (int i = 0; i < numbuf; i++) z[i] = 1; for (int i = 0; i < freeFrames.size(); i++) z[freeFrames[i]] = 0; for (int i = 0; i < numbuf; i++) if (z[i]) deleteFrame(i); delete [] bufDescr; delete [] bufPool; delete hashTable; delete lhm; // put your code here }
Status BufMgr::pinPage(PageId PageId_in_a_DB, Page*& page, int emptyPage) { int i = hashTable->find(PageId_in_a_DB); if (i != -1) { if (bufDescr[i]->pinCount == 0) { lhm->erase(PageId_in_a_DB, bufDescr[i]->ts, bufDescr[i]->loved); } bufDescr[i]->pinCount++; } else { if (!freeFrames.empty()) { i = freeFrames.back(); freeFrames.pop_back(); } else { i = lhm->findVictim(); if (i == -1) { MINIBASE_FIRST_ERROR(BUFMGR, FAIL); return FAIL; } i = hashTable->find(i); assert(i != -1); deleteFrame(i); } if (!emptyPage) { Status s = MINIBASE_DB->read_page(PageId_in_a_DB, &bufPool[i]); if (s != OK) { MINIBASE_CHAIN_ERROR(BUFMGR, s); freeFrames.push_back(i); return s; } } bufDescr[i] = new Descriptor(PageId_in_a_DB, ts, 1); hashTable->put(PageId_in_a_DB, i); } page = &bufPool[i]; return OK; }
void MultisigDialog::on_addPrivKeyButton_clicked() { if(isFirstPrivKey){//on first click the scroll area must show isFirstPrivKey = false; ui->keyScrollArea->show(); } if(ui->keyList->count() > 14){ ui->signButtonStatus->setStyleSheet("QTextEdit{ color: red }"); ui->signButtonStatus->setText(tr("Maximum (15)")); return; } QFrame* keyFrame = new QFrame(ui->keyScrollAreaContents); keyFrame->setObjectName(QStringLiteral("keyFrame")); keyFrame->setFrameShape(QFrame::StyledPanel); keyFrame->setFrameShadow(QFrame::Raised); QHBoxLayout* keyLayout = new QHBoxLayout(keyFrame); keyLayout->setObjectName(QStringLiteral("keyLayout")); QLabel* keyLabel = new QLabel(keyFrame); keyLabel->setObjectName(QStringLiteral("keyLabel")); keyLabel->setText(QApplication::translate("MultisigDialog", strprintf("Key %i: ", (ui->keyList->count()+1)).c_str(), 0)); keyLayout->addWidget(keyLabel); QLineEdit* key = new QLineEdit(keyFrame); key->setObjectName(QStringLiteral("key")); key->setEchoMode(QLineEdit::Password); keyLayout->addWidget(key); QPushButton* keyDeleteButton = new QPushButton(keyFrame); keyDeleteButton->setObjectName(QStringLiteral("keyDeleteButton")); QIcon icon; icon.addFile(QStringLiteral(":/icons/remove"), QSize(), QIcon::Normal, QIcon::Off); keyDeleteButton->setIcon(icon); keyDeleteButton->setAutoDefault(false); connect(keyDeleteButton, SIGNAL(clicked()), this, SLOT(deleteFrame())); keyLayout->addWidget(keyDeleteButton); ui->keyList->addWidget(keyFrame); }
void deleteFrameSetElement(union frameset_element e) { if (e.element == NULL) return; switch (e.element->attr) { case F_UNLOADED: break; case F_BODY: deleteFrame(e.body); break; case F_FRAMESET: deleteFrameSet(e.set); break; default: break; } return; }
/** * @brief * * @param class_ptr * @param stkFrame_ptr * @param dmSize_ptr * @param classHeap_ptr * @param mth_name * @param mth_descriptor */ void callMethod(ClassFile *class_ptr, Frame *stkFrame_ptr, dataMSize_t *dmSize_ptr, ClassFile *classHeap_ptr, \ char *mth_name, char *mth_descriptor){ u2 method_idx = seekMethodInClass( class_ptr, mth_name, mth_descriptor ); if( method_idx == SEEK_NOTFOUND){ exit(1); } method_info *method_ptr = &class_ptr->methods[method_idx]; //Quem cria deleta. createFrame(method_ptr, class_ptr, stkFrame_ptr, &dmSize_ptr->stkHeap_size);//Cria o frame para o método <clinit> da classe. u2 aux_idx = dmSize_ptr->stkHeap_size - 1; // o stkFrameTop_ptr na verdade é o stack frame size, que indica a qtd de frames na stkframe. //Teste Execute(stkFrame_ptr, classHeap_ptr, dmSize_ptr); //Deleta o frame. deleteFrame(&stkFrame_ptr[aux_idx], &dmSize_ptr->stkHeap_size); }
void TFDisplay::clear() { S_FrameInfo to_delete; M_FrameInfo::iterator frame_it = frames_.begin(); M_FrameInfo::iterator frame_end = frames_.end(); for ( ; frame_it != frame_end; ++frame_it ) { to_delete.insert( frame_it->second ); } S_FrameInfo::iterator delete_it = to_delete.begin(); S_FrameInfo::iterator delete_end = to_delete.end(); for ( ; delete_it != delete_end; ++delete_it ) { deleteFrame( *delete_it ); } frames_.clear(); property_manager_->deleteChildren( tree_category_ ); update_timer_ = 0.0f; }
void MultisigDialog::on_addInputButton_clicked() { if(isFirstRawTx){ isFirstRawTx = false; ui->txInputsScrollArea->show(); } QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); QFrame* txInputFrame = new QFrame(ui->txInputsWidget); sizePolicy.setHeightForWidth(txInputFrame->sizePolicy().hasHeightForWidth()); txInputFrame->setFrameShape(QFrame::StyledPanel); txInputFrame->setFrameShadow(QFrame::Raised); txInputFrame->setObjectName(QStringLiteral("txInputFrame")); QVBoxLayout* frameLayout = new QVBoxLayout(txInputFrame); frameLayout->setSpacing(1); frameLayout->setObjectName(QStringLiteral("txInputFrameLayout")); frameLayout->setContentsMargins(6, 6, 6, 6); QHBoxLayout* txInputLayout = new QHBoxLayout(); txInputLayout->setObjectName(QStringLiteral("txInputLayout")); QLabel* txInputIdLabel = new QLabel(txInputFrame); txInputIdLabel->setObjectName(QStringLiteral("txInputIdLabel")); txInputIdLabel->setText(QApplication::translate("MultisigDialog", strprintf("%i. Tx Hash: ", ui->inputsList->count()+1).c_str(), 0)); txInputLayout->addWidget(txInputIdLabel); QLineEdit* txInputId = new QLineEdit(txInputFrame); txInputId->setObjectName(QStringLiteral("txInputId")); txInputLayout->addWidget(txInputId); QSpacerItem* horizontalSpacer = new QSpacerItem(10, 20, QSizePolicy::Fixed, QSizePolicy::Minimum); txInputLayout->addItem(horizontalSpacer); QLabel* txInputVoutLabel = new QLabel(txInputFrame); txInputVoutLabel->setObjectName(QStringLiteral("txInputVoutLabel")); txInputVoutLabel->setText(QApplication::translate("MultisigDialog", "Vout Position: ", 0)); txInputLayout->addWidget(txInputVoutLabel); QSpinBox* txInputVout = new QSpinBox(txInputFrame); txInputVout->setObjectName("txInputVout"); sizePolicy.setHeightForWidth(txInputVout->sizePolicy().hasHeightForWidth()); txInputVout->setSizePolicy(sizePolicy); txInputLayout->addWidget(txInputVout); QPushButton* inputDeleteButton = new QPushButton(txInputFrame); inputDeleteButton->setObjectName(QStringLiteral("inputDeleteButton")); QIcon icon; icon.addFile(QStringLiteral(":/icons/remove"), QSize(), QIcon::Normal, QIcon::Off); inputDeleteButton->setIcon(icon); inputDeleteButton->setAutoDefault(false); connect(inputDeleteButton, SIGNAL(clicked()), this, SLOT(deleteFrame())); txInputLayout->addWidget(inputDeleteButton); frameLayout->addLayout(txInputLayout); ui->inputsList->addWidget(txInputFrame); }
//creates an address object on the create tab void MultisigDialog::on_addAddressButton_clicked() { //max addresses 15 if(ui->addressList->count() > 14){ ui->addMultisigStatus->setStyleSheet("QLabel { color: red; }"); ui->addMultisigStatus->setText(tr("Maximum possible addresses reached. (16)")); return; } QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); QFrame* addressFrame = new QFrame(); sizePolicy.setHeightForWidth(addressFrame->sizePolicy().hasHeightForWidth()); addressFrame->setSizePolicy(sizePolicy); addressFrame->setFrameShape(QFrame::StyledPanel); addressFrame->setFrameShadow(QFrame::Raised); addressFrame->setObjectName(QStringLiteral("addressFrame")); QVBoxLayout* frameLayout = new QVBoxLayout(addressFrame); frameLayout->setSpacing(1); frameLayout->setObjectName(QStringLiteral("frameLayout")); frameLayout->setContentsMargins(6, 6, 6, 6); QHBoxLayout* addressLayout = new QHBoxLayout(); addressLayout->setSpacing(0); addressLayout->setObjectName(QStringLiteral("addressLayout")); QLabel* addressLabel = new QLabel(addressFrame); addressLabel->setObjectName(QStringLiteral("addressLabel")); addressLabel->setText(QApplication::translate("MultisigDialog", strprintf("Address / Key %i:", ui->addressList->count()+1).c_str() , 0)); addressLayout->addWidget(addressLabel); QValidatedLineEdit* address = new QValidatedLineEdit(addressFrame); address->setObjectName(QStringLiteral("address")); addressLayout->addWidget(address); QPushButton* addressBookButton = new QPushButton(addressFrame); addressBookButton->setObjectName(QStringLiteral("addressBookButton")); QIcon icon3; icon3.addFile(QStringLiteral(":/icons/address-book"), QSize(), QIcon::Normal, QIcon::Off); addressBookButton->setIcon(icon3); addressBookButton->setAutoDefault(false); connect(addressBookButton, SIGNAL(clicked()), this, SLOT(addressBookButtonReceiving())); addressLayout->addWidget(addressBookButton); QPushButton* addressPasteButton = new QPushButton(addressFrame); addressPasteButton->setObjectName(QStringLiteral("addressPasteButton")); QIcon icon4; icon4.addFile(QStringLiteral(":/icons/editpaste"), QSize(), QIcon::Normal, QIcon::Off); addressPasteButton->setIcon(icon4); addressPasteButton->setAutoDefault(false); connect(addressPasteButton, SIGNAL(clicked()), this, SLOT(pasteText())); addressLayout->addWidget(addressPasteButton); QPushButton* addressDeleteButton = new QPushButton(addressFrame); addressDeleteButton->setObjectName(QStringLiteral("addressDeleteButton")); QIcon icon5; icon5.addFile(QStringLiteral(":/icons/remove"), QSize(), QIcon::Normal, QIcon::Off); addressDeleteButton->setIcon(icon5); addressDeleteButton->setAutoDefault(false); connect(addressDeleteButton, SIGNAL(clicked()), this, SLOT(deleteFrame())); addressLayout->addWidget(addressDeleteButton); frameLayout->addLayout(addressLayout); ui->addressList->addWidget(addressFrame); }
static int createFrameFile(struct frameset *f, FILE * f1, Buffer *current, int level, int force_reload) { int r, c, t_stack; URLFile f2; #ifdef USE_M17N wc_ces charset, doc_charset; #endif char *d_target, *p_target, *s_target, *t_target; ParsedURL *currentURL, base; MySignalHandler(*volatile prevtrap) (SIGNAL_ARG) = NULL; int flag; if (f == NULL) return -1; if (level == 0) { if (SETJMP(AbortLoading) != 0) { TRAP_OFF; return -1; } TRAP_ON; f->name = "_top"; } if (level > 7) { fputs("Too many frameset tasked.\n", f1); return -1; } if (level == 0) { fprintf(f1, "<html><head><title>%s</title></head><body>\n", html_quote(current->buffername)); fputs("<table hborder width=\"100%\">\n", f1); } else fputs("<table hborder>\n", f1); currentURL = f->currentURL ? f->currentURL : ¤t->currentURL; for (r = 0; r < f->row; r++) { fputs("<tr valign=top>\n", f1); for (c = 0; c < f->col; c++) { union frameset_element frame; struct frameset *f_frameset; int i = c + r * f->col; char *p = ""; int status = R_ST_NORMAL; Str tok = Strnew(); int pre_mode = 0; int end_tag = 0; frame = f->frame[i]; if (frame.element == NULL) { fputs("<td>\n</td>\n", f1); continue; } fputs("<td", f1); if (frame.element->name) fprintf(f1, " id=\"_%s\"", html_quote(frame.element->name)); if (!r) fprintf(f1, " width=\"%s\"", f->width[c]); fputs(">\n", f1); flag = 0; if (force_reload) { flag |= RG_NOCACHE; if (frame.element->attr == F_BODY) unloadFrame(frame.body); } switch (frame.element->attr) { default: /* FIXME: gettextize? */ fprintf(f1, "Frameset \"%s\" frame %d: type unrecognized", html_quote(f->name), i + 1); break; case F_UNLOADED: if (!frame.body->name && f->name) { frame.body->name = Sprintf("%s_%d", f->name, i)->ptr; } fflush(f1); f_frameset = frame_download_source(frame.body, currentURL, current->baseURL, flag); if (f_frameset) { deleteFrame(frame.body); f->frame[i].set = frame.set = f_frameset; goto render_frameset; } /* fall through */ case F_BODY: init_stream(&f2, SCM_LOCAL, NULL); if (frame.body->source) { fflush(f1); examineFile(frame.body->source, &f2); } if (f2.stream == NULL) { frame.body->attr = F_UNLOADED; if (frame.body->flags & FB_NO_BUFFER) /* FIXME: gettextize? */ fprintf(f1, "Open %s with other method", html_quote(frame.body->url)); else if (frame.body->url) /* FIXME: gettextize? */ fprintf(f1, "Can't open %s", html_quote(frame.body->url)); else /* FIXME: gettextize? */ fprintf(f1, "This frame (%s) contains no src attribute", frame.body->name ? html_quote(frame.body->name) : "(no name)"); break; } parseURL2(frame.body->url, &base, currentURL); p_target = f->name; s_target = frame.body->name; t_target = "_blank"; d_target = TargetSelf ? s_target : t_target; #ifdef USE_M17N charset = WC_CES_US_ASCII; if (current->document_charset != WC_CES_US_ASCII) doc_charset = current->document_charset; else doc_charset = DocumentCharset; #endif t_stack = 0; if (frame.body->type && !strcasecmp(frame.body->type, "text/plain")) { Str tmp; fprintf(f1, "<pre>\n"); while ((tmp = StrmyUFgets(&f2))->length) { tmp = convertLine(NULL, tmp, HTML_MODE, &charset, doc_charset); fprintf(f1, "%s", html_quote(tmp->ptr)); } fprintf(f1, "</pre>\n"); UFclose(&f2); break; } do { int is_tag = FALSE; char *q; struct parsed_tag *tag; do { if (*p == '\0') { Str tmp = StrmyUFgets(&f2); if (tmp->length == 0) break; tmp = convertLine(NULL, tmp, HTML_MODE, &charset, doc_charset); p = tmp->ptr; } read_token(tok, &p, &status, 1, status != R_ST_NORMAL); } while (status != R_ST_NORMAL); if (tok->length == 0) continue; if (tok->ptr[0] == '<') { if (tok->ptr[1] && REALLY_THE_BEGINNING_OF_A_TAG(tok->ptr)) is_tag = TRUE; else if (!(pre_mode & (RB_PLAIN | RB_INTXTA | RB_SCRIPT | RB_STYLE))) { p = Strnew_m_charp(tok->ptr + 1, p, NULL)->ptr; tok = Strnew_charp("<"); } } if (is_tag) { if (pre_mode & (RB_PLAIN | RB_INTXTA | RB_SCRIPT | RB_STYLE)) { q = tok->ptr; if ((tag = parse_tag(&q, FALSE)) && tag->tagid == end_tag) { if (pre_mode & RB_PLAIN) { fputs("</PRE_PLAIN>", f1); pre_mode = 0; end_tag = 0; goto token_end; } pre_mode = 0; end_tag = 0; goto proc_normal; } if (strncmp(tok->ptr, "<!--", 4) && (q = strchr(tok->ptr + 1, '<'))) { tok = Strnew_charp_n(tok->ptr, q - tok->ptr); p = Strnew_m_charp(q, p, NULL)->ptr; status = R_ST_NORMAL; } is_tag = FALSE; } else if (pre_mode & RB_INSELECT) { q = tok->ptr; if ((tag = parse_tag(&q, FALSE))) { if ((tag->tagid == end_tag) || (tag->tagid == HTML_N_FORM)) { if (tag->tagid == HTML_N_FORM) fputs("</SELECT>", f1); pre_mode = 0; end_tag = 0; goto proc_normal; } if (t_stack) { switch (tag->tagid) { case HTML_TABLE: case HTML_N_TABLE: CASE_TABLE_TAG: fputs("</SELECT>", f1); pre_mode = 0; end_tag = 0; goto proc_normal; } } } } } proc_normal: if (is_tag) { char *q = tok->ptr; int j, a_target = 0; ParsedURL url; if (!(tag = parse_tag(&q, FALSE))) goto token_end; switch (tag->tagid) { case HTML_TITLE: fputs("<!-- title:", f1); goto token_end; case HTML_N_TITLE: fputs("-->", f1); goto token_end; case HTML_BASE: /* "BASE" is prohibit tag */ if (parsedtag_get_value(tag, ATTR_HREF, &q)) { q = url_encode(remove_space(q), NULL, charset); parseURL(q, &base, NULL); } if (parsedtag_get_value(tag, ATTR_TARGET, &q)) { if (!strcasecmp(q, "_self")) d_target = s_target; else if (!strcasecmp(q, "_parent")) d_target = p_target; else d_target = url_quote_conv(q, charset); } Strshrinkfirst(tok, 1); Strshrink(tok, 1); fprintf(f1, "<!-- %s -->", html_quote(tok->ptr)); goto token_end; case HTML_META: if (parsedtag_get_value(tag, ATTR_HTTP_EQUIV, &q) && !strcasecmp(q, "refresh")) { if (parsedtag_get_value(tag, ATTR_CONTENT, &q) ) { Str s_tmp = NULL; int refresh_interval = getMetaRefreshParam(q, &s_tmp); if (s_tmp) { q = html_quote(s_tmp->ptr); fprintf(f1, "Refresh (%d sec) <a href=\"%s\">%s</a>\n", refresh_interval, q, q); } } } #ifdef USE_M17N if (UseContentCharset && parsedtag_get_value(tag, ATTR_HTTP_EQUIV, &q) && !strcasecmp(q, "Content-Type") && parsedtag_get_value(tag, ATTR_CONTENT, &q) && (q = strcasestr(q, "charset")) != NULL) { q += 7; SKIP_BLANKS(q); if (*q == '=') { wc_ces c; q++; SKIP_BLANKS(q); if ((c = wc_guess_charset(q, 0)) != 0) { doc_charset = c; charset = WC_CES_US_ASCII; } } } #endif /* fall thru, "META" is prohibit tag */ case HTML_HEAD: case HTML_N_HEAD: case HTML_BODY: case HTML_N_BODY: case HTML_DOCTYPE: /* prohibit_tags */ Strshrinkfirst(tok, 1); Strshrink(tok, 1); fprintf(f1, "<!-- %s -->", html_quote(tok->ptr)); goto token_end; case HTML_TABLE: t_stack++; break; case HTML_N_TABLE: t_stack--; if (t_stack < 0) { t_stack = 0; Strshrinkfirst(tok, 1); Strshrink(tok, 1); fprintf(f1, "<!-- table stack underflow: %s -->", html_quote(tok->ptr)); goto token_end; } break; CASE_TABLE_TAG: /* table_tags MUST be in table stack */ if (!t_stack) { Strshrinkfirst(tok, 1); Strshrink(tok, 1); fprintf(f1, "<!-- %s -->", html_quote(tok->ptr)); goto token_end; } break; case HTML_SELECT: pre_mode = RB_INSELECT; end_tag = HTML_N_SELECT; break; case HTML_TEXTAREA: pre_mode = RB_INTXTA; end_tag = HTML_N_TEXTAREA; break; case HTML_SCRIPT: pre_mode = RB_SCRIPT; end_tag = HTML_N_SCRIPT; break; case HTML_STYLE: pre_mode = RB_STYLE; end_tag = HTML_N_STYLE; break; case HTML_LISTING: pre_mode = RB_PLAIN; end_tag = HTML_N_LISTING; fputs("<PRE_PLAIN>", f1); goto token_end; case HTML_XMP: pre_mode = RB_PLAIN; end_tag = HTML_N_XMP; fputs("<PRE_PLAIN>", f1); goto token_end; case HTML_PLAINTEXT: pre_mode = RB_PLAIN; end_tag = MAX_HTMLTAG; fputs("<PRE_PLAIN>", f1); goto token_end; default: break; } for (j = 0; j < TagMAP[tag->tagid].max_attribute; j++) { switch (tag->attrid[j]) { case ATTR_SRC: case ATTR_HREF: case ATTR_ACTION: if (!tag->value[j]) break; tag->value[j] = url_encode(remove_space(tag->value[j]), &base, charset); tag->need_reconstruct = TRUE; parseURL2(tag->value[j], &url, &base); if (url.scheme == SCM_UNKNOWN || #ifndef USE_W3MMAILER url.scheme == SCM_MAILTO || #endif url.scheme == SCM_MISSING) break; a_target |= 1; tag->value[j] = parsedURL2Str(&url)->ptr; parsedtag_set_value(tag, ATTR_REFERER, parsedURL2Str(&base)->ptr); #ifdef USE_M17N if (tag->attrid[j] == ATTR_ACTION && charset != WC_CES_US_ASCII) parsedtag_set_value(tag, ATTR_CHARSET, wc_ces_to_charset (charset)); #endif break; case ATTR_TARGET: if (!tag->value[j]) break; a_target |= 2; if (!strcasecmp(tag->value[j], "_self")) { parsedtag_set_value(tag, ATTR_TARGET, s_target); } else if (!strcasecmp(tag->value[j], "_parent")) { parsedtag_set_value(tag, ATTR_TARGET, p_target); } break; case ATTR_NAME: case ATTR_ID: if (!tag->value[j]) break; parsedtag_set_value(tag, ATTR_FRAMENAME, s_target); break; } } if (a_target == 1) { /* there is HREF attribute and no TARGET * attribute */ parsedtag_set_value(tag, ATTR_TARGET, d_target); } if (parsedtag_need_reconstruct(tag)) tok = parsedtag2str(tag); Strfputs(tok, f1); } else { if (pre_mode & RB_PLAIN) fprintf(f1, "%s", html_quote(tok->ptr)); else if (pre_mode & RB_INTXTA) fprintf(f1, "%s", html_quote(html_unquote(tok->ptr))); else Strfputs(tok, f1); } token_end: Strclear(tok); } while (*p != '\0' || !iseos(f2.stream)); if (pre_mode & RB_PLAIN) fputs("</PRE_PLAIN>\n", f1); else if (pre_mode & RB_INTXTA) fputs("</TEXTAREA></FORM>\n", f1); else if (pre_mode & RB_INSELECT) fputs("</SELECT></FORM>\n", f1); else if (pre_mode & (RB_SCRIPT | RB_STYLE)) { if (status != R_ST_NORMAL) fputs(correct_irrtag(status)->ptr, f1); if (pre_mode & RB_SCRIPT) fputs("</SCRIPT>\n", f1); else if (pre_mode & RB_STYLE) fputs("</STYLE>\n", f1); } while (t_stack--) fputs("</TABLE>\n", f1); UFclose(&f2); break; case F_FRAMESET: render_frameset: if (!frame.set->name && f->name) { frame.set->name = Sprintf("%s_%d", f->name, i)->ptr; } createFrameFile(frame.set, f1, current, level + 1, force_reload); break; } fputs("</td>\n", f1); } fputs("</tr>\n", f1); } fputs("</table>\n", f1); if (level == 0) { fputs("</body></html>\n", f1); TRAP_OFF; } return 0; }