Jspice3
cpstd.h
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: 1986 Wayne A. Christopher
5  1992 Stephen R. Whiteley
6 ****************************************************************************/
7 
8 /*
9  * Standard definitions. This file serves as the header file for std.c and
10  * wlist.c
11  */
12 
13 #ifndef _STD_H_
14 #define _STD_H_
15 
16 typedef int bool;
17 
18 #include "misc.h"
19 
20 /* Doubly linked lists of words. */
21 struct wordlist {
22  char *wl_word;
23  struct wordlist *wl_next;
24  struct wordlist *wl_prev;
25 } ;
26 typedef struct wordlist wordlist;
27 
28 /* Complex numbers. */
29 struct _complex { /* IBM portability... */
30  double cx_real;
31  double cx_imag;
32 } ;
33 typedef struct _complex complex;
34 
35 #define realpart(cval) ((struct _complex *) (cval))->cx_real
36 #define imagpart(cval) ((struct _complex *) (cval))->cx_imag
37 
38 /* Variables that are accessible to the parser via $varname expansions.
39  * If the type is VT_LIST the value is a pointer to a list of the elements.
40  */
41 struct variable {
42  char va_type;
43  char *va_name;
44  union {
45  bool vV_bool;
46  int vV_num;
47  double vV_real;
48  char *vV_string;
49  struct variable *vV_list;
50  } va_V;
51  struct variable *va_next; /* Link. */
52 } ;
53 
54 #define va_bool va_V.vV_bool
55 #define va_num va_V.vV_num
56 #define va_real va_V.vV_real
57 #define va_string va_V.vV_string
58 #define va_vlist va_V.vV_list
59 
60 #define VT_BOOL 1
61 #define VT_NUM 2
62 #define VT_REAL 3
63 #define VT_STRING 4
64 #define VT_LIST 5
65 
66 /* Misc externs */
67 
68 extern int cp_numdgt;
69 #ifdef __STDC__
70 extern void fatal(void);
71 #else
72 extern void fatal();
73 #endif
74 
75 /* Externs from wlist.c */
76 
77 #ifdef __STDC__
78 extern int wl_length(wordlist*);
79 extern void wl_free(wordlist*);
80 extern wordlist *wl_copy(wordlist*);
82 extern void wl_print(wordlist*,FILE*);
83 extern wordlist *wl_build(char**);
84 extern char **wl_mkvec(wordlist*);
86 extern wordlist *wl_reverse(wordlist*);
87 extern char *wl_flatten(wordlist*);
88 extern wordlist *wl_nthelem(int,wordlist*);
89 extern void wl_sort(wordlist*);
90 extern wordlist *wl_range(wordlist*,int,int);
91 #else
92 extern int wl_length();
93 extern void wl_free();
94 extern wordlist *wl_copy();
95 extern wordlist *wl_splice();
96 extern void wl_print();
97 extern wordlist *wl_build();
98 extern char **wl_mkvec();
99 extern wordlist *wl_append();
100 extern wordlist *wl_reverse();
101 extern char *wl_flatten();
102 extern wordlist *wl_nthelem();
103 extern void wl_sort();
104 extern wordlist *wl_range();
105 #endif
106 
107 #endif /* _STD_H_*/
void wl_print()
wordlist * wl_range()
int wl_length()
wordlist * wl_reverse()
int vV_num
Definition: cpstd.h:46
double cx_imag
Definition: cpstd.h:31
Definition: cpstd.h:29
struct variable * vV_list
Definition: cpstd.h:49
int bool
Definition: cpstd.h:16
double cx_real
Definition: cpstd.h:30
char va_type
Definition: cpstd.h:42
void wl_free()
struct wordlist * wl_prev
Definition: cpstd.h:24
char ** wl_mkvec()
char * va_name
Definition: cpstd.h:43
char * vV_string
Definition: cpstd.h:48
wordlist * wl_nthelem()
wordlist * wl_splice()
wordlist * wl_build()
wordlist * wl_append()
double vV_real
Definition: cpstd.h:47
Definition: cpstd.h:21
struct wordlist * wl_next
Definition: cpstd.h:23
char * wl_word
Definition: cpstd.h:22
void wl_sort()
bool vV_bool
Definition: cpstd.h:45
void fatal()
Definition: help.c:174
char * wl_flatten()
int cp_numdgt
Definition: printnum.c:15
struct variable * va_next
Definition: cpstd.h:51
union variable::@0 va_V
Definition: cpstd.h:41
wordlist * wl_copy()