cr-simple-sel.c revision d063424be92f65ab2c67cef026b4360f55830b90
/* -*- 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"
/**
*The constructor of #CRSimpleSel.
*
*@return the new instance of #CRSimpleSel.
*/
cr_simple_sel_new (void)
{
if (!result) {
cr_utils_trace_info ("Out of memory");
return NULL;
}
return result;
}
/**
*Appends a simpe selector to the current list of simple selector.
*
*@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.
*/
{
return a_sel;
return a_this;
}
/**
*Prepends a simple selector to the current list of simple selectors.
*@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.
*/
{
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;
}
/**
*Dumps the selector to a file.
*TODO: add the support of unicode in the dump.
*
*@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
{
if (a_this) {
if (tmp_str) {
}
}
return CR_OK;
}
/**
*Computes the selector (combinator separated list of simple selectors)
*as defined in the css2 spec in chapter 6.4.3
*@param a_this the current instance of #CRSimpleSel
*@return 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;
}
/**
*The destructor of the current instance of
*#CRSimpleSel. Recursively calls the destructor of #CRSimpleSel->next
*@param a_this the this pointer of the current instance of #CRSimpleSel.
*
*/
void
{
}
}
}
}