Browse Source

ngspice/mifparse.h, ngspice/mifcmdat.t, reduce scope of these include files

pre-master-46
rlar 10 years ago
parent
commit
af93d79675
  1. 3
      src/include/ngspice/ifsim.h
  2. 4
      src/include/ngspice/mifcmdat.h
  3. 30
      src/include/ngspice/mifparse.h
  4. 25
      src/include/ngspice/miftypes.h
  5. 4
      src/xspice/mif/mifdelete.c

3
src/include/ngspice/ifsim.h

@ -11,8 +11,7 @@ Author: 1986 Thomas L. Quarles
/* gtri - add - wbk - 10/11/90 - for structs referenced in IFdevice */ /* gtri - add - wbk - 10/11/90 - for structs referenced in IFdevice */
#ifdef XSPICE #ifdef XSPICE
#include "ngspice/mifparse.h"
#include "ngspice/mifcmdat.h"
#include "ngspice/miftypes.h"
#endif #endif
/* gtri - end - wbk - 10/11/90 */ /* gtri - end - wbk - 10/11/90 */

4
src/include/ngspice/mifcmdat.h

@ -357,7 +357,7 @@ typedef struct Mif_Inst_Var_Data_s {
* The top level data structure passed to code models. * The top level data structure passed to code models.
*/ */
typedef struct Mif_Private_s {
struct Mif_Private {
Mif_Circ_Data_t circuit; /* Information about the circuit */ Mif_Circ_Data_t circuit; /* Information about the circuit */
int num_conn; /* Number of connections on this model */ int num_conn; /* Number of connections on this model */
@ -367,7 +367,7 @@ typedef struct Mif_Private_s {
int num_inst_var; /* Number of instance variables */ int num_inst_var; /* Number of instance variables */
Mif_Inst_Var_Data_t **inst_var; /* Information about each inst variable */ Mif_Inst_Var_Data_t **inst_var; /* Information about each inst variable */
} Mif_Private_t;
};

30
src/include/ngspice/mifparse.h

@ -47,12 +47,30 @@ NON-STANDARD FEATURES
#include "ngspice/miftypes.h" #include "ngspice/miftypes.h"
/*
* Values of different types used by the parser. Note that this is a structure
* instead of a union because we need to do initializations in the ifspec.c files for
* the models and unions cannot be initialized in any useful way in C
*
*/
struct Mif_Parse_Value {
Mif_Boolean_t bvalue; /* For boolean values */
int ivalue; /* For integer values */
double rvalue; /* For real values */
Mif_Complex_t cvalue; /* For complex values */
char *svalue; /* For string values */
};
/* /*
* Information about a connection used by the parser to error check input * Information about a connection used by the parser to error check input
*/ */
typedef struct Mif_Conn_Info_s {
struct Mif_Conn_Info {
char *name; /* Name of this connection */ char *name; /* Name of this connection */
char *description; /* Description of this connection */ char *description; /* Description of this connection */
@ -69,7 +87,7 @@ typedef struct Mif_Conn_Info_s {
int upper_bound; /* Array size upper bound */ int upper_bound; /* Array size upper bound */
Mif_Boolean_t null_allowed; /* True if null is allowed for this connection */ Mif_Boolean_t null_allowed; /* True if null is allowed for this connection */
} Mif_Conn_Info_t;
};
@ -78,7 +96,7 @@ typedef struct Mif_Conn_Info_s {
* Information about a parameter used by the parser to error check input * Information about a parameter used by the parser to error check input
*/ */
typedef struct Mif_Param_Info_s {
struct Mif_Param_Info {
char *name; /* Name of this parameter */ char *name; /* Name of this parameter */
char *description; /* Description of this parameter */ char *description; /* Description of this parameter */
@ -98,7 +116,7 @@ typedef struct Mif_Param_Info_s {
int upper_bound; /* Array size upper bound */ int upper_bound; /* Array size upper bound */
Mif_Boolean_t null_allowed; /* True if null is allowed for this parameter */ Mif_Boolean_t null_allowed; /* True if null is allowed for this parameter */
} Mif_Param_Info_t;
};
@ -107,14 +125,14 @@ typedef struct Mif_Param_Info_s {
* Information about an instance parameter used by the parser to error check input * Information about an instance parameter used by the parser to error check input
*/ */
typedef struct Mif_Inst_Var_Info_s {
struct Mif_Inst_Var_Info {
char *name; /* Name of this instance var */ char *name; /* Name of this instance var */
char *description; /* Description of this instance var */ char *description; /* Description of this instance var */
Mif_Data_Type_t type; /* Is this a real, boolean, string, ... */ Mif_Data_Type_t type; /* Is this a real, boolean, string, ... */
Mif_Boolean_t is_array; /* True if instance var is an array */ Mif_Boolean_t is_array; /* True if instance var is an array */
} Mif_Inst_Var_Info_t;
};
#endif #endif

25
src/include/ngspice/miftypes.h

@ -205,23 +205,14 @@ typedef union {
/*
* Values of different types used by the parser. Note that this is a structure
* instead of a union because we need to do initializations in the ifspec.c files for
* the models and unions cannot be initialized in any useful way in C
*
*/
typedef struct {
Mif_Boolean_t bvalue; /* For boolean values */
int ivalue; /* For integer values */
double rvalue; /* For real values */
Mif_Complex_t cvalue; /* For complex values */
char *svalue; /* For string values */
} Mif_Parse_Value_t;
/* types from mifparse.h */
typedef struct Mif_Parse_Value Mif_Parse_Value_t;
typedef struct Mif_Conn_Info Mif_Conn_Info_t;
typedef struct Mif_Param_Info Mif_Param_Info_t;
typedef struct Mif_Inst_Var_Info Mif_Inst_Var_Info_t;
/* types from mifcmdat.h */
typedef struct Mif_Private Mif_Private_t;
#endif #endif

4
src/xspice/mif/mifdelete.c

@ -45,6 +45,10 @@ NON-STANDARD FEATURES
#include "ngspice/mifproto.h" #include "ngspice/mifproto.h"
#include "ngspice/mifdefs.h" #include "ngspice/mifdefs.h"
#if defined(_MSC_VER) || defined(__MINGW32__)
#include "ngspice/mifparse.h"
#endif
#include "ngspice/suffix.h" #include "ngspice/suffix.h"
#include "ngspice/devdefs.h" #include "ngspice/devdefs.h"

Loading…
Cancel
Save