/*
 * YP.H: the Yellow Pages class.  There's not very much to this; simply
 * an array of ypservers and functions to restart yellow pages.
 *
 * 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 _YP_D
#define _YP_D

#include <stdio.h>
#include <basis/KA.H>

class YP:public KA {
private:
    int _magic;	/* were the yellow pages created by bootp or a friend? */
public:
    YP();

    inline int print(FILE *to = stdout)  {
				    unsigned i;
				    if (_magic)
					fprintf(to, "magic cookie\n");
				    for (i=0; i<count(); i++)
					fprintf(to, "ypserver %s\n",
							(*this)[i]);
				    return count();
				}
    int read(FILE *from = stdin);

    inline int magic()	{ return _magic; }
    int Refresh();	/* load off disk */
    int commit();	/* write to disk */
} ;

#endif/*_YP_D*/
