aboutsummaryrefslogtreecommitdiff
path: root/src/html.cc
diff options
context:
space:
mode:
authorjcid <devnull@localhost>2008-06-04 00:39:11 +0200
committerjcid <devnull@localhost>2008-06-04 00:39:11 +0200
commitf0c0b60d8d0882fce0f42c8a6aa094ac13474143 (patch)
tree73cbf506241af605bce10f19e5ffc02698d443ef /src/html.cc
parentc9332309b606361609ace591be1266ab59f9c0d4 (diff)
- html cleanup (forms api)
Diffstat (limited to 'src/html.cc')
-rw-r--r--src/html.cc32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/html.cc b/src/html.cc
index 5efa8690..8baa1d55 100644
--- a/src/html.cc
+++ b/src/html.cc
@@ -442,6 +442,12 @@ static void Html_callback(int Op, CacheClient_t *Client);
static void Html_tag_open_input(DilloHtml *html, const char *tag, int tagsize);
static int Html_tag_index(const char *tag);
static void Html_tag_cleanup_at_close(DilloHtml *html, int TagIdx);
+static DilloHtmlForm *Html_form_new (DilloHtml *html,
+ DilloHtmlMethod method,
+ const DilloUrl *action,
+ DilloHtmlEnc enc,
+ const char *charset);
+static void Html_form_delete (DilloHtmlForm *form);
/*-----------------------------------------------------------------------------
* Local Data
@@ -917,7 +923,7 @@ DilloHtml::~DilloHtml()
a_Url_free(base_url);
for (int i = 0; i < forms->size(); i++)
- delete forms->get(i);
+ Html_form_delete (forms->get(i));
delete(forms);
for (int i = 0; i < links->size(); i++)
@@ -1030,7 +1036,7 @@ void DilloHtml::finishParsing(int ClientKey)
int DilloHtml::formNew(DilloHtmlMethod method, const DilloUrl *action,
DilloHtmlEnc enc, const char *charset)
{
- DilloHtmlForm *form = new DilloHtmlForm (this,method,action,enc,charset);
+ DilloHtmlForm *form = Html_form_new (this,method,action,enc,charset);
int nf = forms->size ();
forms->increase ();
forms->set (nf, form);
@@ -1187,6 +1193,19 @@ DilloHtmlForm::DilloHtmlForm (DilloHtml *html2,
}
/*
+ * API wrapper for DilloHtmlForm::DilloHtmlForm().
+ */
+
+static DilloHtmlForm *Html_form_new (DilloHtml *html,
+ DilloHtmlMethod method,
+ const DilloUrl *action,
+ DilloHtmlEnc enc,
+ const char *charset)
+{
+ return new DilloHtmlForm (html,method,action,enc,charset);
+}
+
+/*
* Free memory used by the DilloHtmlForm class.
*/
DilloHtmlForm::~DilloHtmlForm ()
@@ -1201,6 +1220,15 @@ DilloHtmlForm::~DilloHtmlForm ()
}
/*
+ * API wrapper for DilloHtmlForm::~DilloHtmlForm().
+ */
+
+static void Html_form_delete (DilloHtmlForm *form)
+{
+ delete form;
+}
+
+/*
* Get the current input.
*/
DilloHtmlInput *DilloHtmlForm::getCurrentInput ()