cr-simple-sel.c revision f534eb5832f0adc1775a0b23be1de3eb18ca00b6
/* -*- 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
*
* Author: Dodji Seketeli
* See COPYRIGHTS file for copyright information.
*/
#include <string.h>
#include <glib.h>
#include "cr-simple-sel.h"
/**
* cr_simple_sel_new:
*
*The constructor of #CRSimpleSel.
*
*Returns the new instance of #CRSimpleSel.
*/
cr_simple_sel_new (void)
{
if (!result) {
cr_utils_trace_info ("Out of memory");
return NULL;
}
return result;
}
/**
* 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.
*/
{
return a_sel;
return a_this;
}
/**
* 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.
*/
{
return a_sel;
return a_sel;
}
guchar *
{
if (str) {
switch (cur->combinator) {
case COMB_WS:
break;
case COMB_PLUS:
break;
case COMB_GT:
break;
default:
break;
}
}
}
if (tmp_str) {
}
}
}
if (str_buf) {
}
return result;
}
guchar *
{
if (str) {
}
}
if (tmp_str) {
}
}
if (str_buf) {
}
return result;
}
/**
* 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
*otherwise.
*/
enum CRStatus
{
if (a_this) {
if (tmp_str) {
}
}
return CR_OK;
}
/**
* 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.
*/
enum CRStatus
{
gulong a = 0,
b = 0,
c = 0;
c++; /*hmmh, is this a new language ? */
/*
*this is a pseudo element, and
*the spec says, "ignore pseudo elements".
*/
continue;
}
}
switch (cur_add_sel->type) {
case ID_ADD_SELECTOR:
a++;
break;
case NO_ADD_SELECTOR:
continue;
default:
b++;
break;
}
}
}
/*we suppose a, b and c have 1 to 3 digits */
return CR_OK;
}
/**
* cr_simple_sel_destroy:
*
*@a_this: the this pointer of the current instance of #CRSimpleSel.
*
*The destructor of the current instance of
*#CRSimpleSel. Recursively calls the destructor of #CRSimpleSel->next
*/
void
{
}
}
}
}