static char *SccsId = "@(#)splitCaps.c 4.2 (TU-Delft) 08/28/90";
/**********************************************************

Name/Version      : tecc/4.2

Language          : C
Operating system  : UNIX SYSTEM V
Host machine      : HP9000

Author            : A.J. van Genderen
Creation date     : 15-Mar-1988
Modified by       :
Modification date :


        Delft University of Technology
        Department of Electrical Engineering
        Network Theory Section
        Mekelweg 4 - P.O.Box 5031
        2600 GA DELFT
        The Netherlands

        Phone : 015 - 786234

        COPYRIGHT (C) 1988. All rights reserved.
**********************************************************/
#include <stdio.h>
#include <dmincl.h>
#include "define.h"
#include "type.h"
#include "extern.h"

splitCaps ()   
{
    int i;

    surfcap_cnt = 0;
    edgecap_cnt = 0;

    for (i = 0; i < cap_cnt; i++) {

	if ((caps[i].lay1 -> mask >= 0 
	     && caps[i].lay1 -> occurrence != SURFACE)
	|| (caps[i].lay2 -> mask >= 0 
	    && caps[i].lay2 -> occurrence != SURFACE)) {

	    structcopy ((char *)&surfcaps[ surfcap_cnt ], 
			(char *)&caps[i], 
		        sizeof (struct capacitance));
	    surfcap_cnt++;

        }
	else {

	    structcopy ((char *)&edgecaps[ edgecap_cnt ], 
			(char *)&caps[i], 
			sizeof (struct capacitance));
	    edgecap_cnt++;

	}
    }
}

structcopy (s1, s2, size)
char * s1;
char * s2;
int size;
{
    while (size-- > 0) {
	*s1++ = *s2++;
    }
}
