2008-11-30 22:16:36 +01:00
|
|
|
/*
|
|
|
|
|
variable.h
|
|
|
|
|
*/
|
|
|
|
|
|
2013-01-22 21:00:29 +01:00
|
|
|
#ifndef ngspice_VARIABLE_H
|
|
|
|
|
#define ngspice_VARIABLE_H
|
2008-11-30 22:16:36 +01:00
|
|
|
|
2011-12-11 19:05:00 +01:00
|
|
|
#include "ngspice/cpextern.h"
|
2010-07-17 17:14:45 +02:00
|
|
|
|
2008-11-30 22:16:36 +01:00
|
|
|
/* Variables that are accessible to the parser via $varname
|
2010-07-17 22:48:20 +02:00
|
|
|
* expansions. If the type is CP_LIST the value is a pointer to a
|
2008-11-30 22:16:36 +01:00
|
|
|
* list of the elements. */
|
|
|
|
|
struct variable {
|
2010-07-17 22:56:12 +02:00
|
|
|
enum cp_types va_type;
|
2008-11-30 22:16:36 +01:00
|
|
|
char *va_name;
|
|
|
|
|
union {
|
|
|
|
|
bool vV_bool;
|
|
|
|
|
int vV_num;
|
|
|
|
|
double vV_real;
|
|
|
|
|
char *vV_string;
|
|
|
|
|
struct variable *vV_list;
|
|
|
|
|
} va_V;
|
|
|
|
|
struct variable *va_next; /* Link. */
|
2012-09-20 20:30:53 +02:00
|
|
|
};
|
2008-11-30 22:16:36 +01:00
|
|
|
|
|
|
|
|
#define va_bool va_V.vV_bool
|
|
|
|
|
#define va_num va_V.vV_num
|
|
|
|
|
#define va_real va_V.vV_real
|
|
|
|
|
#define va_string va_V.vV_string
|
|
|
|
|
#define va_vlist va_V.vV_list
|
|
|
|
|
|
|
|
|
|
struct xxx {
|
|
|
|
|
struct variable *x_v;
|
|
|
|
|
char x_char;
|
2012-09-20 20:30:53 +02:00
|
|
|
};
|
2008-11-30 22:16:36 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
extern struct variable *variables;
|
|
|
|
|
extern bool cp_echo;
|
|
|
|
|
|
|
|
|
|
/* extern struct variable *variables; */
|
2012-09-20 20:30:53 +02:00
|
|
|
wordlist *cp_varwl(struct variable *var);
|
|
|
|
|
wordlist *cp_variablesubst(wordlist *wlist);
|
2009-04-05 10:02:03 +02:00
|
|
|
void free_struct_variable(struct variable *v);
|
2008-11-30 22:16:36 +01:00
|
|
|
|
2012-09-20 20:30:53 +02:00
|
|
|
#endif
|