head 1.10; access; symbols FSL_1_7_0:1.10 CFG_0_9_11:1.10 FSL_1_6_1:1.9 CFG_0_9_10:1.9 FSL_1_6_0:1.9 FSL_1_6b2:1.9 CFG_0_9_9:1.9 FSL_1_6b1:1.9 CFG_0_9_8:1.9 CFG_0_9_7:1.8 CFG_0_9_6:1.8 CFG_0_9_5:1.7 CFG_0_9_4:1.6 FSL_1_5_0:1.5 FSL_1_5a3:1.5 CFG_0_9_3:1.5 FSL_1_5a2:1.5 FSL_1_5a1:1.5 FSL_1_4_0:1.5 FSL_1_4b1:1.5 CFG_0_9_2:1.5 CFG_0_9_1:1.5 FSL_1_4a1:1.5 FSL_1_3_0:1.5 FSL_1_3b1:1.5 FSL_1_2_1:1.5 FSL_1_2_0:1.5 FSL_1_1_0:1.5 FSL_1_1b1:1.5 FSL_1_0_8:1.5 FSL_1_0_7:1.5 FSL_1_0_6:1.4 FSL_1_0_5:1.4 FSL_1_0_4:1.4 FSL_1_0_3:1.4 FSL_1_0_2:1.4 FSL_1_0_1:1.4 FSL_1_0_0:1.4 FSL_0_9_0:1.4 CFG_0_9_0:1.4 FSL_0_1_12:1.4 FSL_0_1_11:1.4 FSL_0_1_10:1.4 FSL_0_1_9:1.4 FSL_0_1_8:1.4 FSL_0_1_7:1.4 FSL_0_1_6:1.4 FSL_0_1_5:1.4 FSL_0_1_1:1.4; locks; strict; comment @ * @; 1.10 date 2006.08.10.19.35.57; author rse; state Exp; branches; next 1.9; commitid Isy241gp4yykKkIr; 1.9 date 2004.12.31.19.16.25; author rse; state Exp; branches; next 1.8; 1.8 date 2004.11.28.17.23.45; author rse; state Exp; branches; next 1.7; 1.7 date 2004.11.20.12.02.32; author rse; state Exp; branches; next 1.6; 1.6 date 2004.07.17.07.37.55; author rse; state Exp; branches; next 1.5; 1.5 date 2003.01.06.11.17.43; author rse; state Exp; branches; next 1.4; 1.4 date 2002.07.10.14.46.28; author rse; state Exp; branches; next 1.3; 1.3 date 2002.07.05.15.32.42; author rse; state Exp; branches; next 1.2; 1.2 date 2002.07.04.14.51.21; 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.10 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_syn.h: syntax parsing and formatting header */ #ifndef __CFG_SYN_H__ #define __CFG_SYN_H__ #include #include #include "cfg.h" #include "cfg_grid.h" #include "cfg_node.h" #include "cfg_buf.h" /* internal specification scanner/parser context */ typedef struct { const char *inputptr; /* input buffer: current reading pointer */ const char *inputbuf; /* input buffer: begin of buffer */ size_t inputlen; /* input buffer: size of buffer */ cfg_t *cfg; /* the configuration object */ cfg_node_t *node; /* top-level/root/result channel */ cfg_rc_t rv; /* return value */ cfg_buf_t *buf; /* temporary buffer */ char *err_buf; /* error buffer pointer */ size_t err_len; /* error buffer length */ void *yyscan; /* Flex scanner context */ } cfg_syn_ctx_t; /* internal scanner/parser token location */ typedef struct { int first; int last; } cfg_syn_loc_t; #define YYLTYPE cfg_syn_loc_t /* support for automatic location tracking by Bison */ #define first_line first #define first_column first #define last_line last #define last_column last /* internal API */ extern cfg_rc_t cfg_syn_import (cfg_t *cfg, cfg_node_t **node, const char *in_ptr, size_t in_len, char *err_buf, size_t err_len); extern cfg_rc_t cfg_syn_export (cfg_t *cfg, cfg_node_t *node, char **output); extern cfg_rc_t cfg_syn_destroy (cfg_t *cfg, cfg_node_t *node); /* error reporting function */ extern void cfg_syn_error(cfg_syn_ctx_t *ctx, cfg_rc_t rv, YYLTYPE *loc, const char *fmt, ...); #endif /* __CFG_SYN_H__ */ @ 1.9 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.8 log @Replace fixed-size token buffer in scanner by a dynamic buffer (cfg_buf_t). This eliminates the old 1024 size limit on tokens and makes the scanner more robust. @ 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.7 log @annotate code with more comments @ text @d40 1 d50 1 @ 1.6 log @Adjust copyright messages for new year 2004. @ text @d28 1 a28 1 ** cfg_syn.h: syntax parsing header @ 1.5 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.4 log @Step 2 in API overhauling and implementation filling. @ 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.3 log @thanks to Dmalloc we can fix the memory holes @ text @d68 1 a68 1 extern cfg_rc_t cfg_syn_import (cfg_t *cfg, cfg_node_t **node, const char *input, char *err_buf, size_t err_len); @ 1.2 log @Flush today's work: the library is now able to parse a .cfg file into an internal node tree and export this again in textual .cfg file format (including indented blocks). @ text @d68 3 a70 2 extern cfg_rc_t cfg_syn_import (cfg_t *cfg, cfg_node_t **node, const char *input, char *err_buf, size_t err_len); extern cfg_rc_t cfg_syn_export (cfg_t *cfg, cfg_node_t *node, char **output); @ 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 @d68 2 a69 1 extern cfg_rc_t cfg_syn(cfg_t *cfg, cfg_node_t **node, char *err_buf, size_t err_len, const char *input); @