1 /* -----------------------------------------------------------------
2 FILE:	    readpar.h
3 DESCRIPTION:The include file for reading TimberWolf parameter files.
4 CONTENTS:
5 DATE:	    Oct 25, 1990
6 REVISIONS:  Sat Jan 26 12:36:04 PST 1991 - added genrows GENR to
7 		list of programs.
8 	    Sat Feb 23 00:46:29 EST 1991 - added TOMUS program and
9 		added wildcarding argument to Yreadpar_next.
10 	    Thu Apr 18 00:53:01 EDT 1991 - added design rule
11 		parameter extraction routines.
12 ----------------------------------------------------------------- */
13 #ifndef YREADPAR_H
14 #define YREADPAR_H
15 
16 
17 #include <yalecad/base.h>
18 #include <yalecad/rbtree.h>
19 
20 /* The following are valid programs */
21 #define ALLP	-1
22 #define UNKN	0
23 #define CMPT	1
24 #define GENR	2
25 #define MICK	3
26 #define MINC	4
27 #define PART	5
28 #define SGGR	6
29 #define TWAR	7
30 #define TWMC	8
31 #define TWSC	9
32 #define USER	10
33 #define MAXID   USER    /* set this to the last program */
34 
35 typedef YTREEPTR YPARPTR ;
36 typedef YTREEBOX YPARBOX ;
37 
38 extern VOID Yreadpar_init( P4(char *design_name, INT  program,
39 				INT  filter, BOOL abortFlag ) ) ;
40 /* ******************* READPAR ROUTINES ****************** */
41 /*
42 Function:
43     Initializes the readpar mechanism.  This must be call before any
44     other readpar functions.  Restrictions: only one parameter file
45     may be read at a time.  Design_name is the name of the design.
46     Program is one of the listed program id's at the top of this
47     file.  The filter is used to screen out other programs. There
48     are two ways of initializing the parameter files.  In the
49     first case program = USER, and filter is one of the programs
50     such as SGGR.  The second way is to specify program =
51     filter = program such as SGGR.  If abort flag is set true, the
52     routine will exit program if file is not found.  If abort flag is
53     set false, it will ignore any subsequent readpar commands
54     relating to this file.
55 */
56 
57 extern char **Yreadpar_next( P5(char **lineptr,INT *line,
58     INT *numtokens,BOOL *onNotOff,BOOL *wildcard)) ;
59 /*
60 Function:
61     Reads a parameter one line at a time ignoring comments. Returns
62     only parameters which pertain to the given program.  Nothing
63     is stored in memory.  Lineptr is the contents of the current
64     line, line is the current line number. Numtokens is the
65     number of tokens returned and onNotOff tells the state of
66     the variable.   Wildcard returns whether this line is
67     a wildcard.  Wildcard should not generate error messages
68     in the programs readpar file.
69 */
70 
71 extern YPARPTR Yreadpar_file();
72 /*
73 Function:
74     Reads the an entire parameter file and stores the data in memory
75     to be accessed randomly using Yreadpar_lookup.  Returns a
76     par_object to be used with Yreadpar_lookup.
77 */
78 
79 extern char **Yreadpar_lookup( P4(YPARPTR par_object, char *param,
80 			    INT program, INT *numtokens )) ;
81 /*
82 Function:
83     Given a par object, and a program id, look up the given parameter.
84     If the parameter is found it will return a token buffer similar
85     to argv[]. In addition, numtokens will be set to the number
86     of tokens in the argument vertor.  If no match is found for
87     the parameter, a NULL ptr is returned.
88 */
89 
90 
91 /* The routines below get spacing, width, pitch, etc. for the design */
92 extern DOUBLE Yreadpar_spacing( P2(char *object1, char *object2 ) ) ;
93 
94 extern DOUBLE Yreadpar_width( P1(char *object) )  ;
95 
96 extern DOUBLE Yreadpar_pitch( P1(char *object) )  ;
97 
98 extern DOUBLE Yreadpar_layer_res( P1(char *object) ) ;
99 
100 extern DOUBLE Yreadpar_layer_cap( P1(char *object) ) ;
101 
102 extern BOOL Yreadpar_layer_HnotV( P1(char *object) ) ;
103 
104 extern INT Yreadpar_layer2id( P1(char *object) ) ;
105 
106 extern char *Yreadpar_id2layer( P1(INT layerid) ) ;
107 
108 extern INT Yreadpar_numlayers() ;
109 
110 extern char *Yreadpar_vianame( P2(char *object1, char *object2) ) ;
111 
112 extern char *Yreadpar_viaId2name( P1(INT viaid) ) ;
113 
114 #endif /* YREADPAR_H */
115