diff options
author | Abhishek Sharma <sharma.abhishek.it@gmail.com> | 2011-07-03 00:52:21 +0530 |
---|---|---|
committer | Abhishek Sharma <sharma.abhishek.it@gmail.com> | 2011-07-03 00:52:21 +0530 |
commit | ac3e66fa2bb416507b5b5cf114c1edaa3455f105 (patch) | |
tree | e4756168d3a488de228e9a836a3fa769747352ad /src/cr-attr-sel.c | |
parent | 903f13254d71f127bd5221779c3441c93f1ca92b (diff) | |
download | libcroco-ac3e66fa2bb416507b5b5cf114c1edaa3455f105.tar.gz |
Sending recent tested changes from inkscape developers to libcroco upstream
Diffstat (limited to 'src/cr-attr-sel.c')
-rw-r--r-- | src/cr-attr-sel.c | 84 |
1 files changed, 32 insertions, 52 deletions
diff --git a/src/cr-attr-sel.c b/src/cr-attr-sel.c index 787f0c0..3c4800e 100644 --- a/src/cr-attr-sel.c +++ b/src/cr-attr-sel.c @@ -24,38 +24,34 @@ #include "cr-attr-sel.h" /** - * CRAttrSel: - * - * #CRAdditionalSel abstracts an attribute selector. - * Attributes selectors are described in the css2 spec [5.8]. - * There are more generally used in the css2 selectors described in - * css2 spec [5] . + *@file + *The class that abstracts an attribute selector. + *Attributes selectors are described in the css2 spec [5.8]. + *There are more generally used in the css2 selectors described in + *css2 spec [5] . */ /** - * cr_attr_sel_new: - * The constructor of #CRAttrSel. - * Returns the newly allocated instance - * of #CRAttrSel. + *The constructor of #CRAttrSel. + *@return the newly allocated instance + *of #CRAttrSel. */ CRAttrSel * cr_attr_sel_new (void) { - CRAttrSel *result = NULL; - - result = g_malloc0 (sizeof (CRAttrSel)); + CRAttrSel *result = (CRAttrSel *)g_malloc0 (sizeof (CRAttrSel)); return result; } /** - * cr_attr_sel_append_attr_sel: - * @a_this: the this pointer of the current instance of #CRAttrSel. - * @a_attr_sel: selector to append. + *Appends an attribute selector to the current list of + *attribute selectors represented by a_this. * - * Appends an attribute selector to the current list of - * attribute selectors represented by a_this. - * Returns CR_OK upon successfull completion, an error code otherwise. + *@param a_this the this pointer of the current instance of + *#CRAttrSel. + *@param a_attr_sel selector to append. + *@return CR_OK upon successfull completion, an error code otherwise. */ enum CRStatus cr_attr_sel_append_attr_sel (CRAttrSel * a_this, CRAttrSel * a_attr_sel) @@ -76,13 +72,13 @@ cr_attr_sel_append_attr_sel (CRAttrSel * a_this, CRAttrSel * a_attr_sel) } /** - * cr_attr_sel_prepend_attr_sel: - *@a_this: the "this pointer" of the current instance *of #CRAttrSel. - *@a_attr_sel: the attribute selector to append. - * *Prepends an attribute selector to the list of *attributes selector represented by a_this. - *Returns CR_OK upon successfull completion, an error code otherwise. + * + *@param a_this the "this pointer" of the current instance + *of #CRAttrSel. + *@param a_attr_sel the attribute selector to append. + *@return CR_OK upon successfull completion, an error code otherwise. */ enum CRStatus cr_attr_sel_prepend_attr_sel (CRAttrSel * a_this, @@ -97,17 +93,10 @@ cr_attr_sel_prepend_attr_sel (CRAttrSel * a_this, return CR_OK; } -/** - * cr_attr_sel_to_string: - * @a_this: the current instance of #CRAttrSel. - * - * Serializes an attribute selector into a string - * Returns the serialized attribute selector. - */ guchar * -cr_attr_sel_to_string (CRAttrSel const * a_this) +cr_attr_sel_to_string (CRAttrSel * a_this) { - CRAttrSel const *cur = NULL; + CRAttrSel *cur = NULL; guchar *result = NULL; GString *str_buf = NULL; @@ -121,9 +110,7 @@ cr_attr_sel_to_string (CRAttrSel const * a_this) } if (cur->name) { - guchar *name = NULL; - - name = g_strndup (cur->name->stryng->str, + gchar *name = g_strndup (cur->name->stryng->str, cur->name->stryng->len); if (name) { g_string_append (str_buf, name); @@ -133,9 +120,7 @@ cr_attr_sel_to_string (CRAttrSel const * a_this) } if (cur->value) { - guchar *value = NULL; - - value = g_strndup (cur->value->stryng->str, + gchar *value = g_strndup (cur->value->stryng->str, cur->value->stryng->len); if (value) { switch (cur->match_way) { @@ -168,7 +153,7 @@ cr_attr_sel_to_string (CRAttrSel const * a_this) } if (str_buf) { - result = str_buf->str; + result = (guchar *)str_buf->str; g_string_free (str_buf, FALSE); } @@ -176,15 +161,13 @@ cr_attr_sel_to_string (CRAttrSel const * a_this) } /** - * cr_attr_sel_dump: - * @a_this: the "this pointer" of the current instance of - * #CRAttrSel. - * @a_fp: the destination file. - * - * Dumps the current instance of #CRAttrSel to a file. + *Dumps the current instance of #CRAttrSel to a file. + *@param a_this the "this pointer" of the current instance of + *#CRAttrSel. + *@param a_fp the destination file. */ void -cr_attr_sel_dump (CRAttrSel const * a_this, FILE * a_fp) +cr_attr_sel_dump (CRAttrSel * a_this, FILE * a_fp) { guchar *tmp_str = NULL; @@ -200,12 +183,10 @@ cr_attr_sel_dump (CRAttrSel const * a_this, FILE * a_fp) } /** - *cr_attr_sel_destroy: - *@a_this: the "this pointer" of the current - *instance of #CRAttrSel. - * *Destroys the current instance of #CRAttrSel. *Frees all the fields if they are non null. + *@param a_this the "this pointer" of the current + *instance of #CRAttrSel. */ void cr_attr_sel_destroy (CRAttrSel * a_this) @@ -232,4 +213,3 @@ cr_attr_sel_destroy (CRAttrSel * a_this) a_this = NULL; } } - |