Jspice3
Main Page
Data Structures
Files
File List
Globals
ifnewuid.c
Go to the documentation of this file.
1
/***************************************************************************
2
JSPICE3 adaptation of Spice3e2 - 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
1992 Stephen R. Whiteley
6
****************************************************************************/
7
8
#include "
spice.h
"
9
#include "
ftedefs.h
"
10
#include "
inpdefs.h
"
11
#include "
iferrmsg.h
"
12
#include "
misc.h
"
13
14
15
int
16
IFnewUid
(ckt,newuid,olduid,suffix,
type
,nodedata)
17
18
GENERIC
*ckt;
19
IFuid
*newuid;
20
IFuid
olduid;
21
char
*suffix;
22
int
type
;
23
GENERIC
**nodedata;
24
{
25
char
*newname;
26
int
error;
27
28
if
(olduid) {
29
newname = (
char
*)
30
tmalloc
(
sizeof
(
char
)*(strlen(suffix)+strlen((
char
*)olduid)+2));
31
/* 2 = '#' + '\0' */
32
sprintf(newname,
"%s#%s"
,(
char
*)olduid,suffix);
33
}
34
else
{
35
newname = (
char
*)
tmalloc
(
sizeof
(
char
)*
36
(strlen(suffix)+1));
/* 1 = '\0' */
37
sprintf(newname,
"%s"
,suffix);
38
}
39
40
switch
(type) {
41
case
UID_ANALYSIS
:
42
case
UID_TASK
:
43
case
UID_INSTANCE
:
44
case
UID_OTHER
:
45
case
UID_MODEL
:
46
error =
INPinsert
(&newname,
47
(
INPtables
*)
ft_curckt
->
ci_symtab
);
48
if
(error && error !=
E_EXISTS
)
return
(error);
49
*newuid = (
IFuid
) newname;
50
break
;
51
52
case
UID_SIGNAL
:
53
error =
INPmkTerm
(ckt,&newname,
54
(
INPtables
*)
ft_curckt
->
ci_symtab
,nodedata);
55
if
(error && error !=
E_EXISTS
)
return
(error);
56
*newuid = (
IFuid
) newname;
57
return
(error);
58
59
default
:
60
return
(
E_BADPARM
);
61
}
62
return
(
OK
);
63
}
IFnewUid
int IFnewUid(GENERIC *ckt, IFuid *newuid, IFuid olduid, char *suffix, int type, GENERIC **nodedata)
Definition:
ifnewuid.c:16
misc.h
UID_TASK
#define UID_TASK
Definition:
ifsim.h:81
UID_MODEL
#define UID_MODEL
Definition:
ifsim.h:83
E_BADPARM
#define E_BADPARM
Definition:
iferrmsg.h:26
UID_SIGNAL
#define UID_SIGNAL
Definition:
ifsim.h:84
E_EXISTS
#define E_EXISTS
Definition:
iferrmsg.h:20
INPmkTerm
int INPmkTerm()
INPinsert
int INPinsert()
OK
#define OK
Definition:
iferrmsg.h:17
tmalloc
char * tmalloc()
IFuid
GENERIC * IFuid
Definition:
ifsim.h:72
type
Definition:
types.c:18
inpdefs.h
ft_curckt
struct circ * ft_curckt
Definition:
main.c:184
spice.h
iferrmsg.h
ftedefs.h
UID_INSTANCE
#define UID_INSTANCE
Definition:
ifsim.h:82
UID_OTHER
#define UID_OTHER
Definition:
ifsim.h:85
circ::ci_symtab
char * ci_symtab
Definition:
ftedefs.h:28
UID_ANALYSIS
#define UID_ANALYSIS
Definition:
ifsim.h:80
sINPtables
Definition:
inpdefs.h:30
GENERIC
char GENERIC
Definition:
ifsim.h:27
src
lib
inp
ifnewuid.c
Generated by
1.8.11