/*
 * resolv: the RESOLV.CONF configuration file.
 *
 * This is a pretty vanilla KAarray child, except that the
 * contents of the array can contain comma-separated
 * subarrays (search, nameserver all have multiple
 * fields)
 *
 * Copyright (c) 1997 David L Parsons 
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms are permitted
 * provided that the above copyright notice and this paragraph are
 * duplicated in all such forms and that any documentation,
 * advertising materials, and other materials related to such
 * distribution and use acknowledge that the software was developed
 * by David L Parsons (orc@pell.chi.il.us).  My name may not be used
 * to endorse or promote products derived from this software without
 * specific prior written permission.  THIS SOFTWARE IS PROVIDED
 * ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
 * WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND
 * FITNESS FOR A PARTICULAR PURPOSE.
 */
#ifndef _RESOLV_D
#define _RESOLV_D

extern "C" {
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <resolv.h>
}

#ifdef TESTING
#define RESOLV_CONF	"RESOLV.CONF"
#else
#define RESOLV_CONF	_PATH_RESCONF
#endif

#include <basis/KAarray.H>

class Resolv:public KAarray {
public:
    Resolv();			/* load configuration from disk */

    int commit();		/* commit changes to disk */
    int Refresh();		/* load latest configuration */
    int dirty();		/* has the disk configuration been
				 * changed out from under us?
				 */

    int read(FILE *in = stdin);
    int print(FILE *out = stdout);

    /* pull the plug on various bits of KAarray functionality */
    inline int changed(int x)		{ return 0; x = !x; }
    inline int changed()		{ return KAarray::changed(); }
} ;

#endif/*_RESOLV_D*/
