diff options
Diffstat (limited to 'src/cr-simple-sel.c')
-rw-r--r-- | src/cr-simple-sel.c | 75 |
1 files changed, 27 insertions, 48 deletions
diff --git a/src/cr-simple-sel.c b/src/cr-simple-sel.c index e8d57af..18dd340 100644 --- a/src/cr-simple-sel.c +++ b/src/cr-simple-sel.c @@ -26,18 +26,14 @@ #include "cr-simple-sel.h" /** - * cr_simple_sel_new: - * *The constructor of #CRSimpleSel. * - *Returns the new instance of #CRSimpleSel. + *@return the new instance of #CRSimpleSel. */ CRSimpleSel * cr_simple_sel_new (void) { - CRSimpleSel *result = NULL; - - result = g_try_malloc (sizeof (CRSimpleSel)); + CRSimpleSel *result = (CRSimpleSel *)g_try_malloc (sizeof (CRSimpleSel)); if (!result) { cr_utils_trace_info ("Out of memory"); return NULL; @@ -48,14 +44,11 @@ cr_simple_sel_new (void) } /** - * cr_simple_sel_append_simple_sel: - * *Appends a simpe selector to the current list of simple selector. * - *@a_this: the this pointer of the current instance of #CRSimpleSel. - *@a_sel: the simple selector to append. - * - *Returns: the new list upon successfull completion, an error code otherwise. + *@param a_this the this pointer of the current instance of #CRSimpleSel. + *@param a_sel the simple selector to append. + *@return the new list upon successfull completion, an error code otherwise. */ CRSimpleSel * cr_simple_sel_append_simple_sel (CRSimpleSel * a_this, CRSimpleSel * a_sel) @@ -76,14 +69,10 @@ cr_simple_sel_append_simple_sel (CRSimpleSel * a_this, CRSimpleSel * a_sel) } /** - * cr_simple_sel_prepend_simple_sel: - * - *@a_this: the this pointer of the current instance of #CRSimpleSel. - *@a_sel: the simple selector to prepend. - * *Prepends a simple selector to the current list of simple selectors. - * - *Returns the new list upon successfull completion, an error code otherwise. + *@param a_this the this pointer of the current instance of #CRSimpleSel. + *@param a_sel the simple selector to prepend. + *@return the new list upon successfull completion, an error code otherwise. */ CRSimpleSel * cr_simple_sel_prepend_simple_sel (CRSimpleSel * a_this, CRSimpleSel * a_sel) @@ -100,19 +89,19 @@ cr_simple_sel_prepend_simple_sel (CRSimpleSel * a_this, CRSimpleSel * a_sel) } guchar * -cr_simple_sel_to_string (CRSimpleSel const * a_this) +cr_simple_sel_to_string (CRSimpleSel * a_this) { GString *str_buf = NULL; guchar *result = NULL; - CRSimpleSel const *cur = NULL; + CRSimpleSel *cur = NULL; g_return_val_if_fail (a_this, NULL); str_buf = g_string_new (NULL); for (cur = a_this; cur; cur = cur->next) { if (cur->name) { - guchar *str = g_strndup (cur->name->stryng->str, + gchar *str = g_strndup (cur->name->stryng->str, cur->name->stryng->len); if (str) { @@ -140,9 +129,8 @@ cr_simple_sel_to_string (CRSimpleSel const * a_this) } if (cur->add_sel) { - guchar *tmp_str = NULL; - tmp_str = cr_additional_sel_to_string (cur->add_sel); + gchar *tmp_str = (gchar *)cr_additional_sel_to_string (cur->add_sel); if (tmp_str) { g_string_append (str_buf, tmp_str); g_free (tmp_str); @@ -152,7 +140,7 @@ cr_simple_sel_to_string (CRSimpleSel const * a_this) } if (str_buf) { - result = str_buf->str; + result = (guchar *)str_buf->str; g_string_free (str_buf, FALSE); str_buf = NULL; } @@ -162,7 +150,7 @@ cr_simple_sel_to_string (CRSimpleSel const * a_this) guchar * -cr_simple_sel_one_to_string (CRSimpleSel const * a_this) +cr_simple_sel_one_to_string (CRSimpleSel * a_this) { GString *str_buf = NULL; guchar *result = NULL; @@ -171,7 +159,7 @@ cr_simple_sel_one_to_string (CRSimpleSel const * a_this) str_buf = g_string_new (NULL); if (a_this->name) { - guchar *str = g_strndup (a_this->name->stryng->str, + gchar *str = g_strndup (a_this->name->stryng->str, a_this->name->stryng->len); if (str) { @@ -182,9 +170,8 @@ cr_simple_sel_one_to_string (CRSimpleSel const * a_this) } if (a_this->add_sel) { - guchar *tmp_str = NULL; - tmp_str = cr_additional_sel_to_string (a_this->add_sel); + gchar *tmp_str = (gchar *)cr_additional_sel_to_string (a_this->add_sel); if (tmp_str) { g_string_append_printf (str_buf, "%s", tmp_str); @@ -194,7 +181,7 @@ cr_simple_sel_one_to_string (CRSimpleSel const * a_this) } if (str_buf) { - result = str_buf->str; + result = (guchar *)str_buf->str; g_string_free (str_buf, FALSE); str_buf = NULL; } @@ -203,18 +190,16 @@ cr_simple_sel_one_to_string (CRSimpleSel const * a_this) } /** - * cr_simple_sel_dump: - *@a_this: the current instance of #CRSimpleSel. - *@a_fp: the destination file pointer. - * *Dumps the selector to a file. *TODO: add the support of unicode in the dump. * - *Returns CR_OK upon successfull completion, an error code + *@param a_this the current instance of #CRSimpleSel. + *@param a_fp the destination file pointer. + *@return CR_OK upon successfull completion, an error code *otherwise. */ enum CRStatus -cr_simple_sel_dump (CRSimpleSel const * a_this, FILE * a_fp) +cr_simple_sel_dump (CRSimpleSel * a_this, FILE * a_fp) { guchar *tmp_str = NULL; @@ -233,20 +218,16 @@ cr_simple_sel_dump (CRSimpleSel const * a_this, FILE * a_fp) } /** - * cr_simple_sel_compute_specificity: - * - *@a_this: the current instance of #CRSimpleSel - * *Computes the selector (combinator separated list of simple selectors) *as defined in the css2 spec in chapter 6.4.3 - * - *Returns CR_OK upon successfull completion, an error code otherwise. + *@param a_this the current instance of #CRSimpleSel + *@return CR_OK upon successfull completion, an error code otherwise. */ enum CRStatus cr_simple_sel_compute_specificity (CRSimpleSel * a_this) { - CRAdditionalSel const *cur_add_sel = NULL; - CRSimpleSel const *cur_sel = NULL; + CRAdditionalSel *cur_add_sel = NULL; + CRSimpleSel *cur_sel = NULL; gulong a = 0, b = 0, c = 0; @@ -293,12 +274,10 @@ cr_simple_sel_compute_specificity (CRSimpleSel * a_this) } /** - * cr_simple_sel_destroy: - * - *@a_this: the this pointer of the current instance of #CRSimpleSel. - * *The destructor of the current instance of *#CRSimpleSel. + *@param a_this the this pointer of the current instance of #CRSimpleSel. + * */ void cr_simple_sel_destroy (CRSimpleSel * a_this) |