1 #ifndef ngspice_MIFTYPES_H
2 #define ngspice_MIFTYPES_H
3 
4 /* ===========================================================================
5 FILE    MIFtypes.h
6 
7 MEMBER OF process XSPICE
8 
9 Copyright 1991
10 Georgia Tech Research Corporation
11 Atlanta, Georgia 30332
12 All Rights Reserved
13 
14 PROJECT A-8503
15 
16 AUTHORS
17 
18     9/12/91  Bill Kuhn
19 
20 MODIFICATIONS
21 
22     <date> <person name> <nature of modifications>
23 
24 SUMMARY
25 
26     This file contains typedefs shared by several header files in
27     the MIF package.
28 
29 INTERFACES
30 
31     None.
32 
33 REFERENCED FILES
34 
35     None.
36 
37 NON-STANDARD FEATURES
38 
39     None.
40 
41 =========================================================================== */
42 
43 
44 
45 
46 /* ***************************************************************************** */
47 
48 
49 typedef int Mif_Boolean_t;
50 
51 #define  MIF_FALSE  0
52 #define  MIF_TRUE   1
53 
54 
55 typedef int Mif_Status_t;
56 
57 #define  MIF_OK     0
58 #define  MIF_ERROR  1
59 
60 /*
61 typedef enum {
62     MIF_OK,
63     MIF_ERROR,
64 } Mif_Status_t;
65 */
66 
67 
68 /* ***************************************************************************** */
69 
70 
71 /*
72  * The type of call to a code model - analog or event-driven
73  */
74 
75 typedef enum {
76     MIF_ANALOG,         /* Analog call */
77     MIF_EVENT_DRIVEN,   /* Event-driven call */
78 } Mif_Call_Type_t;
79 
80 
81 
82 /*
83  * Analysis type enumerations
84  */
85 
86 typedef enum {
87     MIF_DC,                /* A DC or DCOP analysis */
88     MIF_AC,                /* A swept AC analysis   */
89     MIF_TRAN,              /* A transient analysis  */
90 } Mif_Analysis_t;
91 
92 
93 
94 /*
95  * Port type enumerations
96  */
97 
98 typedef enum {
99     MIF_VOLTAGE,                /* v - Single-ended voltage */
100     MIF_DIFF_VOLTAGE,           /* vd - Differential voltage */
101     MIF_CURRENT,                /* i - Single-ended current */
102     MIF_DIFF_CURRENT,           /* id - Differential current */
103     MIF_VSOURCE_CURRENT,        /* vnam - Voltage source current */
104     MIF_CONDUCTANCE,            /* g - Single-ended VCIS */
105     MIF_DIFF_CONDUCTANCE,       /* gd - Differential VCIS */
106     MIF_RESISTANCE,             /* h - Single-ended ICVS */
107     MIF_DIFF_RESISTANCE,        /* hd - Differential ICVS */
108     MIF_DIGITAL,                /* d - Digital */
109     MIF_USER_DEFINED,           /* <identifier> - Any user defined type */
110 } Mif_Port_Type_t;
111 
112 
113 
114 /*
115  * The direction of a connector
116  */
117 
118 typedef enum {
119     MIF_IN,                    /* Input only */
120     MIF_OUT,                   /* Output only */
121     MIF_INOUT,                 /* Input and output (e.g. g or h type) */
122 } Mif_Dir_t;
123 
124 
125 
126 /*
127  * The type of a parameter
128  */
129 
130 typedef enum {
131 
132     MIF_BOOLEAN,
133     MIF_INTEGER,
134     MIF_REAL,
135     MIF_COMPLEX,
136     MIF_STRING,
137 
138 } Mif_Data_Type_t;
139 
140 
141 
142 /*
143  * The type of a token
144  */
145 
146 typedef enum {
147 
148     MIF_LARRAY_TOK,
149     MIF_RARRAY_TOK,
150     MIF_LCOMPLEX_TOK,
151     MIF_RCOMPLEX_TOK,
152     MIF_PERCENT_TOK,
153     MIF_TILDE_TOK,
154     MIF_STRING_TOK,
155     MIF_NULL_TOK,
156     MIF_NO_TOK,
157 
158 } Mif_Token_Type_t;
159 
160 
161 
162 /*
163  * Type of controlled source
164  */
165 
166 typedef enum {
167     MIF_VCVS,
168     MIF_VCIS,
169     MIF_ICVS,
170     MIF_ICIS,
171     MIF_minus_one,
172 } Mif_Cntl_Src_Type_t;
173 
174 
175 /*
176  * The "reason" for a callback invocation
177  */
178 
179 typedef enum {
180     MIF_CB_DESTROY = 1,   /* MIFdestroy has been invoked, its time to clean up */
181 }  Mif_Callback_Reason_t;
182 
183 
184 /* ***************************************************************************** */
185 
186 
187 /*
188  * Complex numbers
189  */
190 
191 typedef struct Mif_Complex {
192 
193     double  real;
194     double  imag;
195 
196 } Mif_Complex_t;
197 
198 
199 
200 /*
201  * Values of different types used by the load, ... routines
202  */
203 
204 typedef union {
205 
206     Mif_Boolean_t  bvalue;         /* For digital node value */
207     int            ivalue;         /* For integer parameters */
208     double         rvalue;         /* For spice node values and real parameters */
209     Mif_Complex_t  cvalue;         /* For complex parameters */
210     char           *svalue;        /* For string parameters  */
211     void           *pvalue;        /* For user defined nodes */
212 
213 } Mif_Value_t;
214 
215 
216 
217 /* types from mifparse.h */
218 typedef struct Mif_Parse_Value Mif_Parse_Value_t;
219 typedef struct Mif_Conn_Info Mif_Conn_Info_t;
220 typedef struct Mif_Param_Info Mif_Param_Info_t;
221 typedef struct Mif_Inst_Var_Info Mif_Inst_Var_Info_t;
222 
223 /* types from mifcmdat.h */
224 typedef struct Mif_Private Mif_Private_t;
225 
226 /* types from mifdefs.h */
227 typedef struct MIFinstance MIFinstance;
228 typedef struct MIFmodel MIFmodel;
229 
230 typedef void (* Mif_Callback_t)(Mif_Private_t *, Mif_Callback_Reason_t);
231 
232 
233 #endif
234