head 1.13; access; symbols FSL_1_7_0:1.13 CFG_0_9_11:1.13 FSL_1_6_1:1.12 CFG_0_9_10:1.12 FSL_1_6_0:1.12 FSL_1_6b2:1.12 CFG_0_9_9:1.12 FSL_1_6b1:1.12 CFG_0_9_8:1.12 CFG_0_9_7:1.11 CFG_0_9_6:1.11 CFG_0_9_5:1.10 CFG_0_9_4:1.10 FSL_1_5_0:1.9 FSL_1_5a3:1.9 CFG_0_9_3:1.9 FSL_1_5a2:1.9 FSL_1_5a1:1.9 FSL_1_4_0:1.9 FSL_1_4b1:1.9 CFG_0_9_2:1.9 CFG_0_9_1:1.9 FSL_1_4a1:1.9 FSL_1_3_0:1.9 FSL_1_3b1:1.9 FSL_1_2_1:1.9 FSL_1_2_0:1.9 FSL_1_1_0:1.9 FSL_1_1b1:1.9 FSL_1_0_8:1.9 FSL_1_0_7:1.9 FSL_1_0_6:1.6 FSL_1_0_5:1.6 FSL_1_0_4:1.6 FSL_1_0_3:1.6 FSL_1_0_2:1.6 FSL_1_0_1:1.6 FSL_1_0_0:1.6 FSL_0_9_0:1.6 CFG_0_9_0:1.6 FSL_0_1_12:1.6 FSL_0_1_11:1.6 FSL_0_1_10:1.6 FSL_0_1_9:1.6 FSL_0_1_8:1.6 FSL_0_1_7:1.6 FSL_0_1_6:1.6 FSL_0_1_5:1.6 FSL_0_1_1:1.6; locks; strict; comment @ * @; 1.13 date 2006.08.10.19.35.57; author rse; state Exp; branches; next 1.12; commitid Isy241gp4yykKkIr; 1.12 date 2004.12.31.19.16.25; author rse; state Exp; branches; next 1.11; 1.11 date 2004.12.04.12.48.40; author rse; state Exp; branches; next 1.10; 1.10 date 2004.07.17.07.37.55; author rse; state Exp; branches; next 1.9; 1.9 date 2003.01.06.11.17.43; author rse; state Exp; branches; next 1.8; 1.8 date 2002.11.22.14.34.32; author rse; state Exp; branches; next 1.7; 1.7 date 2002.11.10.12.12.23; author rse; state Exp; branches; next 1.6; 1.6 date 2002.07.17.15.04.08; author rse; state Exp; branches; next 1.5; 1.5 date 2002.07.12.19.59.33; author rse; state Exp; branches; next 1.4; 1.4 date 2002.07.10.12.00.23; author rse; state Exp; branches; next 1.3; 1.3 date 2002.07.04.12.30.08; author rse; state Exp; branches; next 1.2; 1.2 date 2002.07.04.06.16.13; author rse; state Exp; branches; next 1.1; 1.1 date 2002.07.03.13.25.34; author rse; state Exp; branches; next ; desc @@ 1.13 log @cleanup source tree for status as of 2006 @ text @/* ** OSSP cfg - Configuration Parsing ** Copyright (c) 2002-2006 Ralf S. Engelschall ** Copyright (c) 2002-2006 The OSSP Project (http://www.ossp.org/) ** ** This file is part of OSSP cfg, a configuration parsing ** library which can be found at http://www.ossp.org/pkg/lib/cfg/. ** ** Permission to use, copy, modify, and distribute this software for ** any purpose with or without fee is hereby granted, provided that ** the above copyright notice and this permission notice appear in all ** copies. ** ** THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED ** WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF ** MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ** IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR ** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF ** USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, ** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT ** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ** SUCH DAMAGE. ** ** cfg_node.h: configuration nodes (internals) */ #ifndef __CFG_NODE_H__ #define __CFG_NODE_H__ #include "cfg.h" #include "cfg_data.h" struct cfg_node_st { /* attribute ownership */ unsigned long owner; /* attribute ownership bit field */ /* node linkage */ cfg_node_t *parent; /* pointer to parent node */ cfg_node_t *rbroth; /* pointer to right brother node */ cfg_node_t *child1; /* pointer to first child node */ /* node contents */ cfg_node_type_t type; /* type of node */ char *token; /* pointer to corresponding token string */ /* node annotation */ cfg_data_t data; /* annotational data */ /* node source location */ char *srcname; /* name of original source configuration */ int srcpos; /* offset into original source configuration */ }; #endif /* __CFG_NODE_H__ */ @ 1.12 log @Adjust copyright messages for new year 2005. @ text @d3 2 a4 3 ** Copyright (c) 2002-2005 Ralf S. Engelschall ** Copyright (c) 2002-2005 The OSSP Project (http://www.ossp.org/) ** Copyright (c) 2002-2005 Cable & Wireless (http://www.cw.com/) @ 1.11 log @Plug remaining memory leaks by introducing the usual LOAN/GIFT/COPY argument passing semantics to cfg_node_{set,get} and using this to directly pass the allocated tokens from the scanner through the parser into the node tree. @ text @d3 3 a5 3 ** Copyright (c) 2002-2004 Ralf S. Engelschall ** Copyright (c) 2002-2004 The OSSP Project (http://www.ossp.org/) ** Copyright (c) 2002-2004 Cable & Wireless (http://www.cw.com/) @ 1.10 log @Adjust copyright messages for new year 2004. @ text @d38 3 @ 1.9 log @update copyright messages for new year @ text @d3 3 a5 3 ** Copyright (c) 2002-2003 Ralf S. Engelschall ** Copyright (c) 2002-2003 The OSSP Project (http://www.ossp.org/) ** Copyright (c) 2002-2003 Cable & Wireless Deutschland (http://www.cw.com/de/) @ 1.8 log @more code cleanups to node sub-API @ text @d3 3 a5 3 ** Copyright (c) 1999-2002 Ralf S. Engelschall ** Copyright (c) 1999-2002 The OSSP Project (http://www.ossp.org/) ** Copyright (c) 2001-2002 Cable & Wireless Deutschland (http://www.cw.com/de/) @ 1.7 log @remove trailing whitespaces @ text @a39 1 cfg_node_t *lbroth; /* pointer to left brother node */ d48 1 a48 1 cfg_data_t data; /* annotation data */ @ 1.6 log @Ops, fix a typo I cannot imagine where it comes from... @ text @d49 1 a49 1 cfg_data_t data; /* annotation data */ @ 1.5 log @just flush work of this evening @ text @d23 1 a23 1 ** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRCFG, STRICT LIABILITY, @ 1.4 log @Mega-change: full API overhauling. @ text @d52 2 a53 2 char *name; /* name of original source configuration */ int offset; /* offset into original source configuration */ @ 1.3 log @add a new cfg_node_goto() function @ text @d40 1 d50 4 @ 1.2 log @split out cfg_data_t stuff into seperate object to get better abstraction for this @ text @d38 1 a38 1 cfg_node_type_t type; /* type of node */ d42 3 d46 2 @ 1.1 log @Add this first cut for the forthcoming OSSP cfg library to CVS. This is work in progress and still not ready for use anywhere. @ text @d35 1 a35 27 typedef enum { CFG_DATA_TYPE_PTR, CFG_DATA_TYPE_CHAR, CFG_DATA_TYPE_INT, CFG_DATA_TYPE_LONG, CFG_DATA_TYPE_FLOAT, CFG_DATA_TYPE_DOUBLE } cfg_data_type_t; typedef union { void *p; char c; int i; long l; float f; double d; } cfg_data_union_t; typedef struct { cfg_data_type_t t; /* data type */ cfg_data_union_t u; /* data storage */ void (*d)( /* data destructor */ cfg_data_type_t t, cfg_data_union_t *u ); } cfg_data_t; @