/* -*- 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 <stdio.h>
#include <string.h>
#include "cr-term.h"
#include "cr-num.h"
#include "cr-parser.h"
/**
*@file
*Definition of the #CRTem class.
*/
static void
{
case TERM_NUMBER:
}
break;
case TERM_FUNCTION:
}
case TERM_STRING:
case TERM_IDENT:
case TERM_URI:
case TERM_HASH:
}
break;
case TERM_RGB:
}
break;
case TERM_UNICODERANGE:
case TERM_NO_TYPE:
default:
break;
}
}
/**
*Instanciate a #CRTerm.
*@return the newly build instance
*of #CRTerm.
*/
CRTerm *
cr_term_new (void)
{
if (!result) {
cr_utils_trace_info ("Out of memory");
return NULL;
}
return result;
}
/**
*Parses an expresion as defined by the css2 spec
*and builds the expression as a list of terms.
*@param a_buf the buffer to parse.
*@return a pointer to the first term of the expression or
*NULL if parsing failed.
*/
CRTerm *
enum CREncoding a_encoding)
{
a_encoding, FALSE);
goto cleanup;
}
if (result) {
}
}
if (parser) {
}
return result;
}
enum CRStatus
{
return CR_OK;
}
enum CRStatus
{
return CR_OK;
}
enum CRStatus
{
return CR_OK;
}
enum CRStatus
{
return CR_OK;
}
enum CRStatus
{
return CR_OK;
}
enum CRStatus
{
return CR_OK;
}
enum CRStatus
{
return CR_OK;
}
/**
*Appends a new term to the current list of #CRTerm.
*
*@param a_this the "this pointer" of the current instance
*of #CRTerm .
*@param a_new_term the term to append.
*@return the list of terms with the a_new_term appended to it.
*/
CRTerm *
{
return a_new_term;
return a_this;
}
/**
*Prepends a term to the list of terms represented by a_this.
*
*@param a_this the "this pointer" of the current instance of
*#CRTerm .
*@param a_new_term the term to prepend.
*@return the head of the new list.
*/
CRTerm *
{
return a_new_term;
}
/**
*Serializes the expression represented by
*the chained instances of #CRterm.
*@param a_this the current instance of #CRTerm
*@return the zero terminated string containing the serialized
*form of #CRTerm. MUST BE FREED BY THE CALLER using g_free().
*/
guchar *
{
continue;
switch (cur->the_operator) {
case DIVIDE:
break;
case COMMA:
break;
case NO_OP:
}
break;
default:
break;
}
case PLUS_UOP:
break;
case MINUS_UOP:
break;
default:
break;
}
case TERM_NUMBER:
}
if (content) {
}
break;
case TERM_FUNCTION:
}
if (content) {
content);
(cur->
if (tmp_str) {
}
}
}
break;
case TERM_STRING:
}
if (content) {
"\"%s\"", content);
}
break;
case TERM_IDENT:
}
if (content) {
}
break;
case TERM_URI:
}
if (content) {
}
break;
case TERM_RGB:
if (tmp_str) {
}
}
break;
case TERM_UNICODERANGE:
(str_buf,
"?found unicoderange: dump not supported yet?");
break;
case TERM_HASH:
}
if (content) {
"#%s", content);
}
break;
default:
"Unrecognized Term type");
break;
}
}
if (str_buf) {
}
return result;
}
guchar *
{
return NULL ;
switch (a_this->the_operator) {
case DIVIDE:
break;
case COMMA:
break;
case NO_OP:
}
break;
default:
break;
}
case PLUS_UOP:
break;
case MINUS_UOP:
break;
default:
break;
}
case TERM_NUMBER:
}
if (content) {
}
break;
case TERM_FUNCTION:
}
if (content) {
content);
(a_this->
if (tmp_str) {
(str_buf,
"%s", tmp_str);
}
}
}
break;
case TERM_STRING:
}
if (content) {
"\"%s\"", content);
}
break;
case TERM_IDENT:
}
if (content) {
}
break;
case TERM_URI:
}
if (content) {
}
break;
case TERM_RGB:
if (tmp_str) {
}
}
break;
case TERM_UNICODERANGE:
(str_buf,
"?found unicoderange: dump not supported yet?");
break;
case TERM_HASH:
}
if (content) {
"#%s", content);
}
break;
default:
"%s",
"Unrecognized Term type");
break;
}
if (str_buf) {
}
return result;
}
/**
*Dumps the expression (a list of terms connected by operators)
*to a file.
*TODO: finish the dump. The dump of some type of terms have not yet been
*implemented.
*@param a_this the current instance of #CRTerm.
*@param a_fp the destination file pointer.
*/
void
{
if (content) {
}
}
/**
*Return the number of terms in the expression.
*@param a_this the current instance of #CRTerm.
*@return number of terms in the expression.
*/
int
{
int nr = 0;
nr ++;
return nr;
}
/**
*Use an index to get a CRTerm from the expression.
*@param a_this the current instance of #CRTerm.
*@param itemnr the index into the expression.
*@return CRTerm at position itemnr, if itemnr > number of terms - 1,
*it will return NULL.
*/
CRTerm *
{
int nr = 0;
return cur;
return NULL;
}
/**
*Increments the reference counter of the current instance
*of #CRTerm.*
*@param a_this the current instance of #CRTerm.
*/
void
{
}
/**
*Decrements the ref count of the current instance of
*#CRTerm. If the ref count reaches zero, the instance is
*destroyed.
*@param a_this the current instance of #CRTerm.
*@return TRUE if the current instance has been destroyed, FALSE otherwise.
*/
{
}
return TRUE;
}
return FALSE;
}
/**
*The destructor of the #CRTerm class.
*@param a_this the "this pointer" of the current instance
*of #CRTerm.
*/
void
{
}
}