 /*
  * Khoros: $Id: readkraft.c,v 1.2 1991/12/18 09:57:59 dkhoros Exp $
  */

#if !defined(lint) && !defined(SABER)
static char rcsid[] = "Khoros: $Id: readkraft.c,v 1.2 1991/12/18 09:57:59 dkhoros Exp $";
#endif

 /*
  * $Log: readkraft.c,v $
 * Revision 1.2  1991/12/18  09:57:59  dkhoros
 * HellPatch3
 *
  */

/*
 *----------------------------------------------------------------------
 *
 * Copyright 1990, University of New Mexico.  All rights reserved.
 *
 * Permission to copy and modify this software and its documen-
 * tation only for internal use in your organization is hereby
 * granted, provided that this notice is retained thereon and
 * on all copies.  UNM makes no representations as too the sui-
 * tability and operability of this software for any purpose.
 * It is provided "as is" without express or implied warranty.
 *
 * UNM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
 * NESS.  IN NO EVENT SHALL UNM BE LIABLE FOR ANY SPECIAL,
 * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY OTHER DAMAGES WHAT-
 * SOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PER-
 * FORMANCE OF THIS SOFTWARE.
 *
 * No other rights, including for example, the right to redis-
 * tribute this software and its documentation or the right to
 * prepare derivative works, are granted unless specifically
 * provided in a separate license agreement.
 *----------------------------------------------------------------------
 */

#include "unmcopyright.h"        /* Copyright 1990 by UNM */
#include "ghost.h"
#include "vinclude.h"

/* >>>>>>>>>>>>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
   >>>>                                                       <<<<
   >>>>      Kraftsman Information Extracton Routines         <<<<
   >>>>                                                       <<<<
   >>>>  File Name: readkraft.c                               <<<<
   >>>>                                                       <<<<
   >>>>		gw_read_kraft_config()                        <<<<
   >>>>                                                       <<<<
   >>>>>>>>>>>>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< */

char **gw_read_kraft_config(file, keynames, keycnt)
FILE *file;
char **keynames[2];
int keycnt;
  {
    int status = 0, cnt, check_status();
    char **km_config;

    if (feof(file))
	return(NULL);

    km_config = (caddr_t *) calloc(keycnt , sizeof (char *) );
    if (km_config == NULL)
      {
	fprintf(stderr, "gw_read_kraft_config:\n");
	fprintf(stderr, "Out of memory!  Cannot calloc km_config\n");
	return(NULL);
      }
    for (cnt = 0; cnt < keycnt; cnt++ )
      {
	km_config[cnt] = gw_get_prog_info(file,
				keynames[0][cnt],
				keynames[1][cnt],
				&status, NULL, NULL);
	if (!(check_status(status,cnt,keynames))) return(NULL);
      }

    return(km_config);
  }

