summaryrefslogtreecommitdiff
path: root/src/cr-doc-handler.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cr-doc-handler.c')
-rw-r--r--src/cr-doc-handler.c92
1 files changed, 33 insertions, 59 deletions
diff --git a/src/cr-doc-handler.c b/src/cr-doc-handler.c
index bbb1582..00357c0 100644
--- a/src/cr-doc-handler.c
+++ b/src/cr-doc-handler.c
@@ -1,4 +1,4 @@
-/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+/* -*- Mode: C; indent-tabs-mode: ni; c-basic-offset: 8 -*- */
/*
* This file is part of The Croco Library
@@ -25,8 +25,7 @@
#include "cr-parser.h"
/**
- *@CRDocHandler:
- *
+ *@file
*The definition of the CRDocHandler class.
*Contains methods to instantiate, destroy,
*and initialyze instances of #CRDocHandler
@@ -59,26 +58,20 @@ struct _CRDocHandlerPriv {
};
/**
- * cr_doc_handler_new:
*Constructor of #CRDocHandler.
- *
- *Returns the newly built instance of
+ *@return the newly built instance of
*#CRDocHandler
- *
*/
CRDocHandler *
cr_doc_handler_new (void)
{
- CRDocHandler *result = NULL;
-
- result = g_try_malloc (sizeof (CRDocHandler));
+ CRDocHandler *result = ( CRDocHandler *)g_try_malloc (sizeof (CRDocHandler));
g_return_val_if_fail (result, NULL);
memset (result, 0, sizeof (CRDocHandler));
- result->ref_count++;
- result->priv = g_try_malloc (sizeof (CRDocHandlerPriv));
+ result->priv = (CRDocHandlerPriv *)g_try_malloc (sizeof (CRDocHandlerPriv));
if (!result->priv) {
cr_utils_trace_info ("Out of memory exception");
g_free (result);
@@ -91,17 +84,15 @@ cr_doc_handler_new (void)
}
/**
- * cr_doc_handler_get_ctxt:
- *@a_this: the current instance of #CRDocHandler.
- *@a_ctxt: out parameter. The new parsing context.
- *
- *Gets the private parsing context associated to the document handler
+ *Returns the private parsing context.
*The private parsing context is used by libcroco only.
- *
- *Returns CR_OK upon successfull completion, an error code otherwise.
+ *@param a_this the current instance of #CRDocHandler.
+ *@param a_ctxt out parameter. The new parsing context.
+ *@return CR_OK upon successfull completion, an error code otherwise.
+ *@return the parsing context, or NULL if an error occured.
*/
enum CRStatus
-cr_doc_handler_get_ctxt (CRDocHandler const * a_this, gpointer * a_ctxt)
+cr_doc_handler_get_ctxt (CRDocHandler * a_this, gpointer * a_ctxt)
{
g_return_val_if_fail (a_this && a_this->priv, CR_BAD_PARAM_ERROR);
@@ -111,13 +102,11 @@ cr_doc_handler_get_ctxt (CRDocHandler const * a_this, gpointer * a_ctxt)
}
/**
- * cr_doc_handler_set_ctxt:
- *@a_this: the current instance of #CRDocHandler
- *@a_ctxt: a pointer to the parsing context.
- *
*Sets the private parsing context.
*This is used by libcroco only.
- *Returns CR_OK upon successfull completion, an error code otherwise.
+ *@param a_this the current instance of #CRDocHandler
+ *@param a_ctxt a pointer to the parsing context.
+ *@return CR_OK upon successfull completion, an error code otherwise.
*/
enum CRStatus
cr_doc_handler_set_ctxt (CRDocHandler * a_this, gpointer a_ctxt)
@@ -128,17 +117,14 @@ cr_doc_handler_set_ctxt (CRDocHandler * a_this, gpointer a_ctxt)
}
/**
- * cr_doc_handler_get_result:
- *@a_this: the current instance of #CRDocHandler
- *@a_result: out parameter. The returned result.
- *
- *Gets the private parsing result.
+ *Returns the private parsing result.
*The private parsing result is used by libcroco only.
- *
- *Returns CR_OK upon successfull completion, an error code otherwise.
+ *@param a_this the current instance of #CRDocHandler
+ *@param a_result out parameter. The returned result.
+ *@return CR_OK upon successfull completion, an error code otherwise.
*/
enum CRStatus
-cr_doc_handler_get_result (CRDocHandler const * a_this, gpointer * a_result)
+cr_doc_handler_get_result (CRDocHandler * a_this, gpointer * a_result)
{
g_return_val_if_fail (a_this && a_this->priv, CR_BAD_PARAM_ERROR);
@@ -148,14 +134,11 @@ cr_doc_handler_get_result (CRDocHandler const * a_this, gpointer * a_result)
}
/**
- * cr_doc_handler_set_result:
- *@a_this: the current instance of #CRDocHandler
- *@a_result: the new result.
- *
*Sets the private parsing context.
*This is used by libcroco only.
- *
- *Returns CR_OK upon successfull completion, an error code otherwise.
+ *@param a_this the current instance of #CRDocHandler
+ *@param a_result the new result.
+ *@return CR_OK upon successfull completion, an error code otherwise.
*/
enum CRStatus
cr_doc_handler_set_result (CRDocHandler * a_this, gpointer a_result)
@@ -166,16 +149,14 @@ cr_doc_handler_set_result (CRDocHandler * a_this, gpointer a_result)
}
/**
- *cr_doc_handler_set_default_sac_handler:
- *@a_this: a pointer to the current instance of #CRDocHandler.
- *
*Sets the sac handlers contained in the current
*instance of DocHandler to the default handlers.
*For the time being the default handlers are
*test handlers. This is expected to change in a
*near future, when the libcroco gets a bit debugged.
*
- *Returns CR_OK upon successfull completion, an error code otherwise.
+ *@param a_this a pointer to the current instance of #CRDocHandler.
+ *@return CR_OK upon successfull completion, an error code otherwise.
*/
enum CRStatus
cr_doc_handler_set_default_sac_handler (CRDocHandler * a_this)
@@ -203,8 +184,8 @@ cr_doc_handler_set_default_sac_handler (CRDocHandler * a_this)
}
/**
- * cr_doc_handler_ref:
- *@a_this: the current instance of #CRDocHandler.
+ *Increases the reference count of the doc handler
+ *@param a_this the current instance of #CRDocHandler.
*/
void
cr_doc_handler_ref (CRDocHandler * a_this)
@@ -215,13 +196,10 @@ cr_doc_handler_ref (CRDocHandler * a_this)
}
/**
- * cr_doc_handler_unref:
- *@a_this: the currrent instance of #CRDocHandler.
- *
*Decreases the ref count of the current instance of #CRDocHandler.
*If the ref count reaches '0' then, destroys the instance.
- *
- *Returns TRUE if the instance as been destroyed, FALSE otherwise.
+ *@param a_this the currrent instance of #CRDocHandler.
+ *@return TRUE if the instance as been destroyed, FALSE otherwise.
*/
gboolean
cr_doc_handler_unref (CRDocHandler * a_this)
@@ -240,11 +218,9 @@ cr_doc_handler_unref (CRDocHandler * a_this)
}
/**
- * cr_doc_handler_destroy:
- *@a_this: the instance of #CRDocHandler to
- *destroy.
- *
*The destructor of the #CRDocHandler class.
+ *@param a_this the instance of #CRDocHandler to
+ *destroy.
*/
void
cr_doc_handler_destroy (CRDocHandler * a_this)
@@ -259,11 +235,9 @@ cr_doc_handler_destroy (CRDocHandler * a_this)
}
/**
- * cr_doc_handler_associate_a_parser:
*Associates a parser to the current document handler
- *
- *@a_this: the current instance of document handler.
- *@a_parser: the parser to associate.
+ *@param a_this the current instance of document handler.
+ *@param a_parser the parser to associate.
*/
void
cr_doc_handler_associate_a_parser (CRDocHandler *a_this,
@@ -272,5 +246,5 @@ cr_doc_handler_associate_a_parser (CRDocHandler *a_this,
g_return_if_fail (a_this && PRIVATE (a_this)
&& a_parser) ;
- PRIVATE (a_this)->parser = a_parser ;
+ PRIVATE (a_this)->parser = (CRParser *)a_parser ;
}