/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
/*
* This file is part of The Croco Library
*
* modify it under the terms of version 2.1 of the GNU Lesser General Public
* License as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* See COPYRIGHTS file for copyright information.
*/
#include <string.h>
#include "cr-selector.h"
#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
*NULL in case of failure.
*/
{
if (!result) {
cr_utils_trace_info ("Out of memory");
return NULL;
}
return result;
}
{
return NULL;
}
/**
* 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.
*/
{
if (!a_this) {
return a_new;
}
/*walk forward the list headed by a_this to get the list tail */
return a_this;
}
/**
* 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.
*/
{
return cur;
}
/**
* 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.
*/
{
}
guchar *
{
if (a_this) {
if (cur->simple_sel) {
(cur->simple_sel);
if (tmp_str) {
", ");
}
}
}
}
if (str_buf) {
}
return result;
}
/**
* cr_selector_dump:
*
*@a_this: the current instance of #CRSelector.
*@a_fp: the destination file.
*
*Serializes the current instance of #CRSelector to a file.
*/
void
{
if (a_this) {
if (tmp_buf) {
}
}
}
/**
* cr_selector_ref:
*
*@a_this: the current instance of #CRSelector.
*
*Increments the ref count of the current instance
*of #CRSelector.
*/
void
{
}
/**
* 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
*of #CRSelector, FALSE otherwise.
*/
{
}
return TRUE;
}
return FALSE;
}
/**
* cr_selector_destroy:
*
*@a_this: the current instance of #CRSelector.
*
*Destroys the selector list.
*/
void
{
/*
*go and get the list tail. In the same time, free
*all the simple selectors contained in the list.
*/
if (cur->simple_sel) {
}
}
if (cur) {
if (cur->simple_sel) {
}
}
/*in case the list has only one element */
return;
}
/*walk backward the list and free each "next element" */
}
}
if (!cur)
return;
}
}