1 /********** 2 Copyright 1990 Regents of the University of California. All rights reserved. 3 Author: 1985 Thomas L. Quarles 4 **********/ 5 6 #include "ngspice/ngspice.h" 7 #include "ngspice/tskdefs.h" 8 #include "ngspice/jobdefs.h" 9 #include "ngspice/ifsim.h" 10 #include "ngspice/iferrmsg.h" 11 #include "ngspice/cktdefs.h" 12 13 #include "analysis.h" 14 15 extern SPICEanalysis *analInfo[]; 16 17 /* ARGSUSED */ 18 int CKTnewAnal(CKTcircuit * ckt,int type,IFuid name,JOB ** analPtr,TSKtask * taskPtr)19CKTnewAnal(CKTcircuit *ckt, int type, IFuid name, JOB **analPtr, TSKtask *taskPtr) 20 { 21 NG_IGNORE(ckt); 22 23 if(type==0) { 24 /* special case for analysis type 0 == option card */ 25 *analPtr = &(taskPtr->taskOptions); /* pointer to the task itself */ 26 (*analPtr)->JOBname = name; 27 (*analPtr)->JOBtype = type; 28 return(OK); /* doesn't need to be created */ 29 } 30 *analPtr = (JOB *) tmalloc((size_t) analInfo[type]->size); 31 if(*analPtr==NULL) return(E_NOMEM); 32 (*analPtr)->JOBname = name; 33 (*analPtr)->JOBtype = type; 34 (*analPtr)->JOBnextJob = taskPtr->jobs; 35 taskPtr->jobs = *analPtr; 36 return(OK); 37 } 38