 /*
  * Khoros: $Id: cr_imglist.c,v 1.2 1991/12/18 09:56:27 dkhoros Exp $
  */

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

 /*
  * $Log: cr_imglist.c,v $
 * Revision 1.2  1991/12/18  09:56:27  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.
 *---------------------------------------------------------------------
 */

/*
#
# FILE NAME:	cr_imglist.c
# 
# AUTHORS:	Tom Sauer
# 
# DATE:		5/25/89
# 
# DESCRIPTION:	create a list of pointers to xvimage structures
# 
# MODIFICATIONS:
# 
*/

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

#define LENGTH 512

/**************************************************************
*
* MODULE NAME: create_image_list
*
*     PURPOSE: Create a list of pointers to xvimage structures
*		Both the list and each xvimage structure is malloced
*
*       INPUT:  image1 -- double pointer -- the source image
*		image_num -- the number of images in the list
*
*      OUTPUT: 	1.  returns a pointer to a list of pointers to
*		    xvimage structures.
*
* CALLED FROM: 
*
* ROUTINES CALLED: 
*
**************************************************************/
struct xvimage **
create_images_list(image_num)

unsigned int image_num;
{

   int i;
   struct xvimage **image1;

	image1 = (struct xvimage **) malloc(image_num*sizeof(struct xvimage *));
        if (image1 == NULL) {
             (void) fprintf(stderr,
                   "create_images_list: No space for image - malloc failed!\n");
              return(NULL);
        }

	for (i = 0 ; i < image_num; i++) {
	   image1[i] = (struct xvimage *) kcalloc(1,sizeof(struct xvimage));
 	   if (image1[i] == NULL) {
               (void) fprintf(stderr,
                   "create_image_list: No space for image - malloc failed!\n");
              return(NULL);
           }
        }

	return(image1);
}
