/***************************************************************
 *
 * change the buffer from bytes to words to read the calorimeter
 *
 ***************************************************************/
//
// Version 1.00 (2005-02-23)
//
// Changelog:
//
// calpulse didn't work, fixed hoping wihtout troubles in the other routines
//
/*
 * include needed system headers
 */
#include <stdio.h>       /* include standard i/o library */
#include <stdlib.h>      /* include standard library */
#include <string.h>      /* include string library */
#include <unistd.h>      /* include unix standard library */
#include <sys/types.h>   /* */
#include <sys/stat.h>    /* */
#include <fcntl.h>       /* */
#include <errno.h>       /* error simbol definitions */
#include <time.h>        /* system time definitions */
#include <math.h>        /* math library */

void fillin_(int *m, int *lunga, int *lleng, int *lung, int *pari, short int *vect, char *vecta)
{    
    int i = 1;
    //    int mleng;
    char tempv[*lung];
    char tempv2[*lung];
    memcpy(&tempv, &*vecta+*m-1, *lung-*m+1);    
    while ( i <= *lung ) {
	if ( i < *lung+1 ) {
	    tempv2[i-1]=tempv[i];
	    tempv2[i]=tempv[i-1];	
	};
	i = i + 2;
    };
    *lleng = 0;
    memcpy(&*vect, &tempv2, (*lunga-*lleng)*2);
}










