 /*
  * Khoros: $Id: writeascii.c,v 1.1 1991/05/10 15:41:35 khoros Exp $
  */

#if !defined(lint) && !defined(SABER)
static char rcsid[] = "Khoros: $Id: writeascii.c,v 1.1 1991/05/10 15:41:35 khoros Exp $";
#endif

 /*
  * $Log: writeascii.c,v $
 * Revision 1.1  1991/05/10  15:41:35  khoros
 * Initial revision
 *
  */ 

/*
 *----------------------------------------------------------------------
 *
 * 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:	ascii.c
# 
# AUTHORS:
#		Mark Young
#
# 
# DATE:		1/8/90
# 
# DESCRIPTION:
#	ASCII utilities, for reading and writing ascii data.
#
# 
# MODIFICATIONS:
# 
*/

#include "unmcopyright.h"	 
#include "vinclude.h"	 	


/**************************************************************
*
* MODULE NAME: 	write_ascii
*
*     PURPOSE:  This routine writes a float data array to the
*		desired file, specified by file.
*
*       INPUT:
*
*	file		file pointer pointing to the stream in
*			which the raw floating point data is located
*
*	points		the points data array to written to file
*
*	num_points	number of points found in the points array
*
*      OUTPUT:	Outputs the ascii data points to the desired file.
*
* CALLED FROM: main
*
* ROUTINES CALLED:
*
**************************************************************/

int	write_ascii(file, points, ncols, num_points)

FILE	*file;
int	ncols, num_points;
float	*points;
{
	int	i, j;

	for (i = 0; i < num_points; i += ncols)
	{
	   for (j = 0; j < ncols; j++)
	      (void) fprintf(file, "%f   ", points[i + j]);

	   (void) fprintf(file, "\n");
	}
	return(1);
}
