summaryrefslogtreecommitdiff
path: root/src/cr-selector.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cr-selector.c')
-rw-r--r--src/cr-selector.c87
1 files changed, 28 insertions, 59 deletions
diff --git a/src/cr-selector.c b/src/cr-selector.c
index a3603e3..d85b3ef 100644
--- a/src/cr-selector.c
+++ b/src/cr-selector.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,22 +25,16 @@
#include "cr-parser.h"
/**
- * cr_selector_new:
- *
- *@a_simple_sel: the initial simple selector list
- *of the current instance of #CRSelector.
- *
*Creates a new instance of #CRSelector.
- *
- *Returns the newly built instance of #CRSelector, or
+ *@param a_simple_sel the initial simple selector list
+ *of the current instance of #CRSelector.
+ *@return the newly built instance of #CRSelector, or
*NULL in case of failure.
*/
CRSelector *
cr_selector_new (CRSimpleSel * a_simple_sel)
{
- CRSelector *result = NULL;
-
- result = g_try_malloc (sizeof (CRSelector));
+ CRSelector *result = (CRSelector *)g_try_malloc (sizeof (CRSelector));
if (!result) {
cr_utils_trace_info ("Out of memory");
return NULL;
@@ -57,7 +51,8 @@ cr_selector_parse_from_buf (const guchar * a_char_buf, enum CREncoding a_enc)
g_return_val_if_fail (a_char_buf, NULL);
- parser = cr_parser_new_from_buf ((guchar*)a_char_buf, strlen (a_char_buf),
+ parser = cr_parser_new_from_buf ((guchar*)a_char_buf,
+ strlen ((char *)a_char_buf),
a_enc, FALSE);
g_return_val_if_fail (parser, NULL);
@@ -65,14 +60,10 @@ cr_selector_parse_from_buf (const guchar * a_char_buf, enum CREncoding a_enc)
}
/**
- * cr_selector_append:
- *
- *@a_this: the current instance of #CRSelector.
- *@a_new: the instance of #CRSelector to be appended.
- *
*Appends a new instance of #CRSelector to the current selector list.
- *
- *Returns the new list.
+ *@param a_this the current instance of #CRSelector.
+ *@param a_new the instance of #CRSelector to be appended.
+ *@return the new list.
*/
CRSelector *
cr_selector_append (CRSelector * a_this, CRSelector * a_new)
@@ -93,14 +84,10 @@ cr_selector_append (CRSelector * a_this, CRSelector * a_new)
}
/**
- * cr_selector_prepend:
- *
- *@a_this: the current instance of #CRSelector list.
- *@a_new: the instance of #CRSelector.
- *
*Prepends an element to the #CRSelector list.
- *
- *Returns the new list.
+ *@param a_this the current instance of #CRSelector list.
+ *@param a_new the instance of #CRSelector.
+ *@return the new list.
*/
CRSelector *
cr_selector_prepend (CRSelector * a_this, CRSelector * a_new)
@@ -116,14 +103,10 @@ cr_selector_prepend (CRSelector * a_this, CRSelector * a_new)
}
/**
- * cr_selector_append_simple_sel:
- *
- *@a_this: the current instance of #CRSelector.
- *@a_simple_sel: the simple selector to append.
- *
*append a simple selector to the current #CRSelector list.
- *
- *Returns the new list or NULL in case of failure.
+ *@param a_this the current instance of #CRSelector.
+ *@param a_simple_sel the simple selector to append.
+ *@return the new list or NULL in case of failure.
*/
CRSelector *
cr_selector_append_simple_sel (CRSelector * a_this,
@@ -138,16 +121,15 @@ cr_selector_append_simple_sel (CRSelector * a_this,
}
guchar *
-cr_selector_to_string (CRSelector const * a_this)
+cr_selector_to_string (CRSelector * a_this)
{
guchar *result = NULL;
- GString *str_buf = NULL;
- str_buf = g_string_new (NULL);
+ GString *str_buf = (GString *)g_string_new (NULL);
g_return_val_if_fail (str_buf, NULL);
if (a_this) {
- CRSelector const *cur = NULL;
+ CRSelector *cur = NULL;
for (cur = a_this; cur; cur = cur->next) {
if (cur->simple_sel) {
@@ -161,7 +143,7 @@ cr_selector_to_string (CRSelector const * a_this)
g_string_append (str_buf,
", ");
- g_string_append (str_buf, tmp_str);
+ g_string_append (str_buf, (gchar *)tmp_str);
g_free (tmp_str);
tmp_str = NULL;
@@ -171,7 +153,7 @@ cr_selector_to_string (CRSelector const * a_this)
}
if (str_buf) {
- result = str_buf->str;
+ result = (guchar *)str_buf->str;
g_string_free (str_buf, FALSE);
str_buf = NULL;
}
@@ -180,15 +162,12 @@ cr_selector_to_string (CRSelector const * a_this)
}
/**
- * cr_selector_dump:
- *
- *@a_this: the current instance of #CRSelector.
- *@a_fp: the destination file.
- *
*Serializes the current instance of #CRSelector to a file.
+ *@param a_this the current instance of #CRSelector.
+ *@param a_fp the destination file.
*/
void
-cr_selector_dump (CRSelector const * a_this, FILE * a_fp)
+cr_selector_dump (CRSelector * a_this, FILE * a_fp)
{
guchar *tmp_buf = NULL;
@@ -203,12 +182,9 @@ cr_selector_dump (CRSelector const * a_this, FILE * a_fp)
}
/**
- * cr_selector_ref:
- *
- *@a_this: the current instance of #CRSelector.
- *
*Increments the ref count of the current instance
*of #CRSelector.
+ *@param a_this the current instance of #CRSelector.
*/
void
cr_selector_ref (CRSelector * a_this)
@@ -219,16 +195,12 @@ cr_selector_ref (CRSelector * a_this)
}
/**
- * cr_selector_unref:
- *
- *@a_this: the current instance of #CRSelector.
- *
*Decrements the ref count of the current instance of
*#CRSelector.
*If the ref count reaches zero, the current instance of
*#CRSelector is destroyed.
- *
- *Returns TRUE if this function destroyed the current instance
+ *@param a_this the current instance of #CRSelector.
+ *@return TRUE if this function destroyed the current instance
*of #CRSelector, FALSE otherwise.
*/
gboolean
@@ -249,11 +221,8 @@ cr_selector_unref (CRSelector * a_this)
}
/**
- * cr_selector_destroy:
- *
- *@a_this: the current instance of #CRSelector.
- *
*Destroys the selector list.
+ *@param a_this the current instance of #CRSelector.
*/
void
cr_selector_destroy (CRSelector * a_this)