1*00b67f09SDavid van Moolenbroek /* $NetBSD: testutil.h,v 1.4 2014/12/10 04:37:56 christos Exp $ */ 2*00b67f09SDavid van Moolenbroek 3*00b67f09SDavid van Moolenbroek /* Id: testutil.h,v 1.1 2003/06/04 00:27:03 marka Exp */ 4*00b67f09SDavid van Moolenbroek /* 5*00b67f09SDavid van Moolenbroek * Copyright (c) 2002 Japan Network Information Center. 6*00b67f09SDavid van Moolenbroek * All rights reserved. 7*00b67f09SDavid van Moolenbroek * 8*00b67f09SDavid van Moolenbroek * By using this file, you agree to the terms and conditions set forth bellow. 9*00b67f09SDavid van Moolenbroek * 10*00b67f09SDavid van Moolenbroek * LICENSE TERMS AND CONDITIONS 11*00b67f09SDavid van Moolenbroek * 12*00b67f09SDavid van Moolenbroek * The following License Terms and Conditions apply, unless a different 13*00b67f09SDavid van Moolenbroek * license is obtained from Japan Network Information Center ("JPNIC"), 14*00b67f09SDavid van Moolenbroek * a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda, 15*00b67f09SDavid van Moolenbroek * Chiyoda-ku, Tokyo 101-0047, Japan. 16*00b67f09SDavid van Moolenbroek * 17*00b67f09SDavid van Moolenbroek * 1. Use, Modification and Redistribution (including distribution of any 18*00b67f09SDavid van Moolenbroek * modified or derived work) in source and/or binary forms is permitted 19*00b67f09SDavid van Moolenbroek * under this License Terms and Conditions. 20*00b67f09SDavid van Moolenbroek * 21*00b67f09SDavid van Moolenbroek * 2. Redistribution of source code must retain the copyright notices as they 22*00b67f09SDavid van Moolenbroek * appear in each source code file, this License Terms and Conditions. 23*00b67f09SDavid van Moolenbroek * 24*00b67f09SDavid van Moolenbroek * 3. Redistribution in binary form must reproduce the Copyright Notice, 25*00b67f09SDavid van Moolenbroek * this License Terms and Conditions, in the documentation and/or other 26*00b67f09SDavid van Moolenbroek * materials provided with the distribution. For the purposes of binary 27*00b67f09SDavid van Moolenbroek * distribution the "Copyright Notice" refers to the following language: 28*00b67f09SDavid van Moolenbroek * "Copyright (c) 2000-2002 Japan Network Information Center. All rights reserved." 29*00b67f09SDavid van Moolenbroek * 30*00b67f09SDavid van Moolenbroek * 4. The name of JPNIC may not be used to endorse or promote products 31*00b67f09SDavid van Moolenbroek * derived from this Software without specific prior written approval of 32*00b67f09SDavid van Moolenbroek * JPNIC. 33*00b67f09SDavid van Moolenbroek * 34*00b67f09SDavid van Moolenbroek * 5. Disclaimer/Limitation of Liability: THIS SOFTWARE IS PROVIDED BY JPNIC 35*00b67f09SDavid van Moolenbroek * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 36*00b67f09SDavid van Moolenbroek * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 37*00b67f09SDavid van Moolenbroek * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JPNIC BE LIABLE 38*00b67f09SDavid van Moolenbroek * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 39*00b67f09SDavid van Moolenbroek * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 40*00b67f09SDavid van Moolenbroek * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 41*00b67f09SDavid van Moolenbroek * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 42*00b67f09SDavid van Moolenbroek * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 43*00b67f09SDavid van Moolenbroek * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 44*00b67f09SDavid van Moolenbroek * ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 45*00b67f09SDavid van Moolenbroek */ 46*00b67f09SDavid van Moolenbroek 47*00b67f09SDavid van Moolenbroek #ifndef IDN_TESTUTIL_H 48*00b67f09SDavid van Moolenbroek #define IDN_TESTUTIL_H 1 49*00b67f09SDavid van Moolenbroek 50*00b67f09SDavid van Moolenbroek /* 51*00b67f09SDavid van Moolenbroek * Option flags for create_conf_file(). 52*00b67f09SDavid van Moolenbroek * 53*00b67f09SDavid van Moolenbroek * CONF_NO_EOF_NEWLINE -- Don't put newline character 54*00b67f09SDavid van Moolenbroek * at the end of file. 55*00b67f09SDavid van Moolenbroek */ 56*00b67f09SDavid van Moolenbroek #define CONF_NO_EOF_NEWLINE 0x0001 57*00b67f09SDavid van Moolenbroek 58*00b67f09SDavid van Moolenbroek /* 59*00b67f09SDavid van Moolenbroek * Create a configuration file. 60*00b67f09SDavid van Moolenbroek * 61*00b67f09SDavid van Moolenbroek * Write strings specified as variable length arguments (`...') to 62*00b67f09SDavid van Moolenbroek * `filename'. Note that the arguments must be terminated with `NULL'. 63*00b67f09SDavid van Moolenbroek * 64*00b67f09SDavid van Moolenbroek * In the created config file, each string in the variable length 65*00b67f09SDavid van Moolenbroek * arguments becomes a line. In other words, newline characters are 66*00b67f09SDavid van Moolenbroek * added automatically. 67*00b67f09SDavid van Moolenbroek * 68*00b67f09SDavid van Moolenbroek * This function returns 1 upon success, 0 otherwise. 69*00b67f09SDavid van Moolenbroek */ 70*00b67f09SDavid van Moolenbroek int 71*00b67f09SDavid van Moolenbroek create_conf_file(const char *filename, unsigned int flags, ...); 72*00b67f09SDavid van Moolenbroek 73*00b67f09SDavid van Moolenbroek #endif /* IDN_TESTUTIL_H */ 74