Jspice3
cktnewan.c
Go to the documentation of this file.
1 /***************************************************************************
2 JSPICE3 adaptation of Spice3f2 - Copyright (c) Stephen R. Whiteley 1992
3 Copyright 1990 Regents of the University of California. All rights reserved.
4 Authors: 1985 Thomas L. Quarles
5  1993 Stephen R. Whiteley
6 ****************************************************************************/
7 
8 #include "spice.h"
9 #include <stdio.h>
10 #include "cktdefs.h"
11 #include "tskdefs.h"
12 #include "jobdefs.h"
13 #include "util.h"
14 #include "iferrmsg.h"
15 
16 
17 /* ARGSUSED */
18 int
19 CKTnewAnal(ckt,type,name,analPtr,taskPtr)
20 
21 GENERIC *ckt;
22 int type;
23 IFuid name;
24 GENERIC **analPtr;
25 GENERIC *taskPtr;
26 {
27  if (type == 0) {
28  /* special case for analysis type 0 == option card */
29  *analPtr = taskPtr; /* pointer to the task itself */
30  (*(JOB **)analPtr)->JOBname = name;
31  (*(JOB **)analPtr)->JOBtype = type;
32  return (OK); /* doesn't need to be created */
33  }
34  *analPtr = (GENERIC *)MALLOC(analInfo[type]->size);
35  if (*analPtr == NULL) return(E_NOMEM);
36  (*(JOB **)analPtr)->JOBname = name;
37  (*(JOB **)analPtr)->JOBtype = type;
38  (*(JOB **)analPtr)->JOBnextJob = ((TSKtask *)taskPtr)->jobs;
39  ((TSKtask *)taskPtr)->jobs = (JOB *)*analPtr;
40  return (OK);
41 }
int CKTnewAnal(GENERIC *ckt, int type, IFuid name, GENERIC **analPtr, GENERIC *taskPtr)
Definition: cktnewan.c:19
Definition: cktdefs.h:23
SPICEanalysis * analInfo[]
Definition: sconfig.c:57
#define OK
Definition: iferrmsg.h:17
GENERIC * IFuid
Definition: ifsim.h:72
#define MALLOC(x)
Definition: util.h:9
#define NULL
Definition: spdefs.h:121
Definition: types.c:18
#define E_NOMEM
Definition: iferrmsg.h:27
int type
Definition: cktdefs.h:56
char GENERIC
Definition: ifsim.h:27