head 1.9; access; symbols FSL_1_7_0:1.9 CFG_0_9_11:1.9 FSL_1_6_1:1.8 CFG_0_9_10:1.8 FSL_1_6_0:1.8 FSL_1_6b2:1.8 CFG_0_9_9:1.8 FSL_1_6b1:1.7 CFG_0_9_8:1.7 CFG_0_9_7:1.5 CFG_0_9_6:1.5 CFG_0_9_5:1.5 CFG_0_9_4:1.5 FSL_1_5_0:1.4 FSL_1_5a3:1.4 CFG_0_9_3:1.4 FSL_1_5a2:1.4 FSL_1_5a1:1.4 FSL_1_4_0:1.4 FSL_1_4b1:1.4 CFG_0_9_2:1.4 CFG_0_9_1:1.4 FSL_1_4a1:1.4 FSL_1_3_0:1.4 FSL_1_3b1:1.4 FSL_1_2_1:1.4 FSL_1_2_0:1.4 FSL_1_1_0:1.4 FSL_1_1b1:1.4 FSL_1_0_8:1.4 FSL_1_0_7:1.4 FSL_1_0_6:1.2 FSL_1_0_5:1.2 FSL_1_0_4:1.2 FSL_1_0_3:1.2 FSL_1_0_2:1.2 FSL_1_0_1:1.2 FSL_1_0_0:1.2 FSL_0_9_0:1.2 CFG_0_9_0:1.2 FSL_0_1_12:1.2 FSL_0_1_11:1.2 FSL_0_1_10:1.2 FSL_0_1_9:1.2 FSL_0_1_8:1.2 FSL_0_1_7:1.2 FSL_0_1_6:1.2 FSL_0_1_5:1.2 FSL_0_1_1:1.2; locks; strict; comment @ * @; 1.9 date 2006.08.10.19.35.57; author rse; state Exp; branches; next 1.8; commitid Isy241gp4yykKkIr; 1.8 date 2005.02.03.10.40.14; author rse; state Exp; branches; next 1.7; 1.7 date 2005.01.24.14.18.48; author rse; state Exp; branches; next 1.6; 1.6 date 2004.12.31.19.16.25; author rse; state Exp; branches; next 1.5; 1.5 date 2004.07.17.07.37.55; author rse; state Exp; branches; next 1.4; 1.4 date 2003.01.06.11.17.43; author rse; state Exp; branches; next 1.3; 1.3 date 2002.11.10.12.12.23; author rse; state Exp; branches; next 1.2; 1.2 date 2002.07.17.15.04.08; 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.9 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_fmt.h: printf(3)-style formatting API */ #ifndef __CFG_FMT_H__ #define __CFG_FMT_H__ struct cfg_fmt_format_st { /* the output buffer */ char *curpos; /* start of output buffer (first pos) */ char *endpos; /* end of output buffer (last pos) */ /* callback for flushing the output buffer */ int (*flush)( struct cfg_fmt_format_st *spec /* this cfg_fmt_format_t specification */ ); /* callback for formatting unknown %-constructs */ void (*format)( struct cfg_fmt_format_st *spec, /* this cfg_fmt_format_t specification */ char *prefix_char, /* output arg: prefix character */ char *pad_char, /* output arg: padding character */ char **s_buf, /* output arg: string buffer */ size_t *s_len, /* output arg: string len */ char *num_buf, /* input arg: temporary buffer */ int num_buf_size, /* input arg: temporary buffer len */ char *extinfo, /* input arg: extension information */ char fmt_char, /* input arg: current formatting character */ va_list *ap /* in/out arg: variable argument pointer */ ); /* arbitrary passed-through application data */ union { int i; long l; double d; void *vp; } data[6]; }; typedef struct cfg_fmt_format_st cfg_fmt_format_t; int cfg_fmt_format (cfg_fmt_format_t *vbuff, const char *fmt, va_list ap); int cfg_fmt_vsprintf (char *s, size_t n, const char *fmt, va_list ap); char *cfg_fmt_vasprintf (const char *fmt, va_list ap); int cfg_fmt_sprintf (char *s, size_t n, const char *fmt, ...); char *cfg_fmt_asprintf (const char *fmt, ...); #endif /* __CFG_FMT_H__ */ @ 1.8 log @Revert recently made change "fix va_list variable passing in cfg_fmt functions" by using a double-cast which is evil but keeps the orrect semantics. @ 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.7 log @1. Fix va_list variable passing in cfg_fmt functions. 2. Add Autoconf support for va_copy() detection. 3. Accept new GNU Bison 2.0 as parser generator. @ text @d55 1 a55 1 va_list ap /* in/out arg: variable argument pointer */ @ 1.6 log @Adjust copyright messages for new year 2005. @ text @d55 1 a55 1 va_list *ap /* in/out arg: variable argument pointer */ @ 1.5 log @Adjust copyright messages for new year 2004. @ 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.4 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.3 log @remove trailing whitespaces @ 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.2 log @Ops, fix a typo I cannot imagine where it comes from... @ text @d54 1 a54 1 char fmt_char, /* input arg: current formatting character */ d59 6 a64 6 union { int i; long l; double d; void *vp; } data[6]; @ 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 @d23 1 a23 1 ** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRCFG, STRICT LIABILITY, @