1 /**********
2 Copyright 1990 Regents of the University of California.  All rights reserved.
3 Author: 1985 Thomas L. Quarles
4 **********/
5 /*
6  */
7 
8     /* CKTclrBreak(ckt)
9      *   delete the first time from the breakpoint table for the given circuit
10      */
11 
12 #include "ngspice/ngspice.h"
13 #include "ngspice/cktdefs.h"
14 #include "ngspice/sperror.h"
15 
16 
17 
18 int
CKTclrBreak(CKTcircuit * ckt)19 CKTclrBreak(CKTcircuit *ckt)
20 {
21     double *tmp;
22     int j;
23 
24     if(ckt->CKTbreakSize >2) {
25         tmp = TMALLOC(double, ckt->CKTbreakSize - 1);
26         if(tmp == NULL) return(E_NOMEM);
27         for(j=1;j<ckt->CKTbreakSize;j++) {
28             tmp[j-1] = ckt->CKTbreaks[j];
29         }
30         FREE(ckt->CKTbreaks);
31         ckt->CKTbreakSize--;
32         ckt->CKTbreaks=tmp;
33     } else {
34         ckt->CKTbreaks[0] = ckt->CKTbreaks[1];
35         ckt->CKTbreaks[1] = ckt->CKTfinalTime;
36     }
37     return(OK);
38 }
39