Corrected a long-standing error in which ending text with a literal
[xcircuit.git] / asg / var.h
blobdd6f3f6b7e73c6fdc314d5b6ac69b05bf5913b62
1 /************************************************************
2 **
3 ** COPYRIGHT (C) 1993 UNIVERSITY OF PITTSBURGH
4 ** COPYRIGHT (C) 1996 GANNON UNIVERSITY
5 ** ALL RIGHTS RESERVED
6 **
7 ** This software is distributed on an as-is basis
8 ** with no warranty implied or intended. No author
9 ** or distributor takes responsibility to anyone
10 ** regarding its use of or suitability.
12 ** The software may be distributed and modified
13 ** freely for academic and other non-commercial
14 ** use but may NOT be utilized or included in whole
15 ** or part within any commercial product.
17 ** This copyright notice must remain on all copies
18 ** and modified versions of this software.
20 ************************************************************/
21 /*
22 * file var.h
23 * As part of MS Thesis Work, S T Frezza, UPitt Engineering
24 * June, 1990
28 typedef union var_item_union varItem;
29 typedef struct var_item_struct varStruct;
30 typedef struct var_struct var;
31 typedef struct var_list_struct varlist;
33 /* ---------- Srange structures lifted from "route.h" ---------------------------- */
34 typedef struct short_range_struct srange;
35 typedef struct short_range_list_struct srnglist;
37 struct short_range_struct
39 int q1, q2, orient;
42 struct short_range_list_struct
44 srange *this;
45 srnglist *next;
49 /* --------------------- var type definition and supports -------------------------*/
51 /* Used to identify the action associated with the var*/
52 #define MULTIPLY 1
53 #define DIVIDE 2
54 #define ADD 3
55 #define SUBTRACT 4
57 #define VAR 1
58 #define INT 2
59 #define RNG 3
61 #define X 1 /* The orientation of a given edge */
62 #define Y 2
64 #define XFUZZ 4
65 #define YFUZZ 4
67 struct var_struct
68 /* structure to assemble strings of ranges; Each of these is meant to collapse into a
69 * single point (integer). In lisp, the structure is like an unevaluated list:
70 * '(function item1 item2), which is waiting for evaluation. */
72 int action;
73 varStruct *item1;
74 varStruct *item2;
77 struct var_item_struct
78 /* This is a structure to contain the union of *int, *srange, and *varItem (s)
79 * and a code of what the union actually contains. */
81 varItem *this;
82 int type;
86 union var_union_type
87 /* This is a union of *int, *srange, and *varItems: */
89 int *i;
90 srange *r;
91 var *v;
95 struct var_struct_list
97 var *this;
98 varlist *next;
102 /*---------------------------------------------------------------
103 * Defined in var.c
104 *---------------------------------------------------------------
106 extern int eval_var();
107 /* var *v */
109 extern var *reduce_var();
110 /* var *v */
112 extern varStruct *eval_action();
113 /* int a */
114 /* varStruct *i1, *i2 */
116 extern varStruct *create_rng_varStruct();
117 /* srange *sr */
119 extern varStruct *create_var_varStruct();
120 /* var *v */
122 extern varStruct *create_int_varStruct();
123 /* int *i */
125 extern var *create_var_struct();
126 /* int a */
127 /* varStruct *i1, *i2 */
129 extern srange *create_srange();
130 /* int q1, q2, or */