cr-prop-list.c revision 6b15695578f07a3f72c4c9475c1a261a3021472a
/*
* 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 copyrights information.
*/
#include <string.h>
#include "cr-prop-list.h"
struct _CRPropListPriv {
};
static CRPropList *cr_prop_list_allocate (void);
/**
*Default allocator of CRPropList
*@return the newly allocated CRPropList or NULL
*if an error arises.
*/
static CRPropList *
cr_prop_list_allocate (void)
{
if (!result) {
cr_utils_trace_info ("could not allocate CRPropList");
return NULL;
}
if (!result) {
cr_utils_trace_info ("could not allocate CRPropListPriv");
return NULL;
}
return result;
}
/****************
*public methods
***************/
/**
*Appends a property list to the current one.
*@param a_this the current instance of #CRPropList
*@param a_to_append the property list to append
*@return the resulting prop list, or NULL if an error
*occured
*/
{
if (!a_this)
return a_to_append;
/*go fetch the last element of the list */
return a_this;
}
/**
*Appends a pair of prop/declaration to
*the current prop list.
*@param a_this the current instance of #CRPropList
*@param a_prop the property to consider
*@param a_decl the declaration to consider
*@return the resulting property list, or NULL in case
*of an error.
*/
{
list = cr_prop_list_allocate ();
return result;
}
/**
*Prepends a list to the current list
*@param a_this the current instance of #CRPropList
*@param the new list to prepend.
*/
{
if (!a_this)
return a_to_prepend;
return a_to_prepend;
}
/**
*Prepends a list to the current list
*@param a_this the current instance of #CRPropList
*@param the new list to prepend.
*/
{
list = cr_prop_list_allocate ();
return result;
}
/**
*Sets the property of a CRPropList
*@param a_this the current instance of #CRPropList
*@param a_prop the property to set
*/
enum CRStatus
{
&& a_prop, CR_BAD_PARAM_ERROR);
return CR_OK;
}
/**
*Getter of the property associated to the current instance
*of #CRPropList
*@param a_this the current instance of #CRPropList
*@param a_prop out parameter. The returned property
*@return CR_OK upon successful completion, an error code
*otherwise.
*/
enum CRStatus
{
&& a_prop, CR_BAD_PARAM_ERROR);
return CR_OK;
}
enum CRStatus
{
&& a_decl, CR_BAD_PARAM_ERROR);
return CR_OK;
}
enum CRStatus
{
&& a_decl, CR_BAD_PARAM_ERROR);
return CR_OK;
}
/**
*Lookup a given property/declaration pair
*@param a_this the current instance of #CRPropList
*@param a_prop the property to lookup
*@param a_prop_list out parameter. The property/declaration
*pair found (if and only if the function returned code if CR_OK)
*CR_VALUE_NOT_FOUND_ERROR if not, or an error code if something
*bad happens.
*/
enum CRStatus
{
if (!a_this)
return CR_VALUE_NOT_FOUND_ERROR;
break;
}
if (cur) {
return CR_OK;
}
return CR_VALUE_NOT_FOUND_ERROR;
}
/**
*@param a_this the current instance of CRPropList
*reached the end of the list.
*@return the next prop/declaration pair of the list,
*or NULL if we reached end of list (or if an error occurs)
*/
{
}
/**
*@param a_this the current instance of CRPropList
*reached the end of the list.
*@return the previous prop/declaration pair of the list,
*or NULL if we reached end of list (or if an error occurs)
*/
{
}
/**
*@return the new list or NULL in case of an error.
*/
{
/*some sanity checks */
}
}
if (prev) {
}
if (next) {
}
if (next)
return next;
return NULL;
}
return a_this;
}
void
{
while (cur) {
}
}